Skip to content

ENG-1491: Part of the discourse context query settings blocks appears in the page if you select "hide interface" in the discourse context menu at the top of the page#953

Open
sid597 wants to merge 4 commits intomainfrom
eng-1491-part-of-the-discourse-context-query-settings-blocks-appears
Open

ENG-1491: Part of the discourse context query settings blocks appears in the page if you select "hide interface" in the discourse context menu at the top of the page#953
sid597 wants to merge 4 commits intomainfrom
eng-1491-part-of-the-discourse-context-query-settings-blocks-appears

Conversation

@sid597
Copy link
Copy Markdown
Collaborator

@sid597 sid597 commented Apr 11, 2026

https://www.loom.com/share/ca2fa22b6a9e419abe811f8df4d4c4b0

NOTE: For review use hide whitespaces settings


Open with Devin

Summary by CodeRabbit

  • Refactor
    • Reorganized the menu structure to consolidate results-related options (Layout, Column Views, Search, Inputs, Filters, Sort, Get Random, Rows per page) under a new "Results" submenu for improved navigation.
    • Updated settings menu visibility based on context and user interactions.

…s true

Discourse context renders ResultsView with preventSavingSettings={true}
but the kebab menu still showed settings items (Layout, Alias, Hide
Interface, etc.). Clicking them wrote Roam blocks onto the page.

Hide the Results submenu, Alias, Hide Interface, and Copy Query items
when preventSavingSettings is true. Menu collapses to "Share Data" in
discourse context and overlays.
@supabase
Copy link
Copy Markdown

supabase bot commented Apr 11, 2026

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Pre-existing no-floating-promises warnings on setInputSetting /
navigator.clipboard.writeText calls. The previous commit re-indented
these lines due to JSX wrapping, so reviewdog now flags them as added.
Mark them void — they're fire-and-forget side effects.
@sid597
Copy link
Copy Markdown
Collaborator Author

sid597 commented Apr 11, 2026

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

✅ Actions performed

Full review triggered.

devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

📝 Walkthrough

Walkthrough

The ResultsView component's "more" menu was restructured to consolidate multiple settings options (Layout, Column Views, Search, Inputs, Filters, Sort, Get Random, Rows per page) into a nested "Results" submenu, with conditional rendering of settings-based items controlled by preventSavingSettings and onEdit flags.

Changes

Cohort / File(s) Summary
Menu Restructuring & Conditional Rendering
apps/roam/src/components/results-view/ResultsView.tsx
Consolidated multiple menu items into a nested "Results" submenu; added conditional rendering logic for settings-related menu entries based on preventSavingSettings and onEdit flags; updated click handlers for "Search/Hide Search" (uses setInputSetting conditionally), "Inputs" (corrected to write showInputs instead of showSearchFilter), and "Copy Query" (now gated behind !preventSavingSettings); modified divider visibility logic to gate it by (isEditBlock || !preventSavingSettings || onDeleteQuery).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main bug fix: hiding settings UI menu items when preventSavingSettings is true to prevent unwanted interface blocks from appearing when 'hide interface' is selected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

sid597 added 2 commits April 11, 2026 22:03
Copy Query is read-only — it doesn't save settings, so gating it behind
preventSavingSettings was a misuse of the flag. It is still broken in
discourse context (copies whole page tree wrapped in {{query block}})
but that's a separate bug for a separate ticket.

Also restores the trailing Divider to unconditional since the only
reason it was conditional was the Copy Query wrap.
@sid597 sid597 requested a review from mdroidian April 11, 2026 16:49
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

⚠️ 1 issue in files not directly in the diff

⚠️ onDragEnd in ResultsTable persists column widths even when preventSavingSettings is true (apps/roam/src/components/results-view/ResultsTable.tsx:622-629)

The PR forwards preventSavingSettings to ResultsTable and correctly guards resultHeaderSetFilters at ResultsTable.tsx:636, but onDragEnd at ResultsTable.tsx:622-629 unconditionally calls setInputSettings to persist column widths to Roam blocks. When preventSavingSettings is true, dragging column borders will still write layout width settings, defeating the purpose of the flag.

View 3 additional findings in Devin Review.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant