Skip to content

ENG-1670: Fix global left sidebar fold toggle#1080

Open
sid597 wants to merge 1 commit into
mainfrom
eng-1670-fix-global-left-sidebar-fold-toggle
Open

ENG-1670: Fix global left sidebar fold toggle#1080
sid597 wants to merge 1 commit into
mainfrom
eng-1670-fix-global-left-sidebar-fold-toggle

Conversation

@sid597
Copy link
Copy Markdown
Collaborator

@sid597 sid597 commented May 25, 2026

https://www.loom.com/share/508b72a5994149d89b3e8bdb13a306f6

Summary by CodeRabbit

  • Refactor
    • Updated left sidebar fold/unfold behavior handling
    • Reorganized settings panel ordering in left sidebar configuration

Review Change Stack

Remove the redundant Folded checkbox from settings (chevron is the single
source of truth), default the global section to open when children are
present, and fix the folded semantic so a persisted Folded block now
actually means closed.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 25, 2026

ENG-1670

@supabase
Copy link
Copy Markdown

supabase Bot commented May 25, 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 ↗︎.

@sid597
Copy link
Copy Markdown
Collaborator Author

sid597 commented May 25, 2026

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

✅ Actions performed

Full review triggered.

@sid597
Copy link
Copy Markdown
Collaborator Author

sid597 commented May 25, 2026

@codex review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f765fde6-c669-4b4f-9497-45d7face618f

📥 Commits

Reviewing files that changed from the base of the PR and between 5e13351 and 6a38767.

📒 Files selected for processing (2)
  • apps/roam/src/components/LeftSidebarView.tsx
  • apps/roam/src/components/settings/LeftSidebarGlobalSettings.tsx

📝 Walkthrough

Walkthrough

This PR refactors left sidebar folded-state handling to cleanly separate personal and global section concerns. toggleFoldedState now handles only personal sections with a required sectionIndex parameter, while GlobalSection manages its own folding state inline via direct block mutations and settings persistence.

Changes

Left Sidebar Folded-State Refactoring

Layer / File(s) Summary
Personal section folded-state handler
apps/roam/src/components/LeftSidebarView.tsx
toggleFoldedState now requires sectionIndex and removes isGlobal branching to constrain it to personal-section updates only. Implementation clones personal sidebar sections, overwrites the target section's Settings.Folded field, and persists via setPersonalSetting.
Global section folded-state management
apps/roam/src/components/LeftSidebarView.tsx
GlobalSection's initial isOpen state is now negated. The toggle handler is rewritten to compute nextIsOpen, update isOpen immediately, delete/create the "Folded" child block under settings.uid, mutate settings.folded.uid/value, refresh the config tree, and persist via setGlobalSetting instead of calling toggleFoldedState.
Global settings styling and ordering
apps/roam/src/components/settings/LeftSidebarGlobalSettings.tsx
The global-section-settings container's inline style object formatting is adjusted. The "Collapsable" GlobalFlagPanel order prop is changed from 1 to 0.

Possibly Related PRs

  • DiscourseGraphs/discourse-graph#440: Directly refactors the left sidebar's folding behavior in LeftSidebarView.tsx, changing toggleFoldedState's API and rewriting GlobalSection's folded/open logic—same core folding functionality.
  • DiscourseGraphs/discourse-graph#844: Overlaps with dual-read/dual-write refactor of folding logic in LeftSidebarView and global/personal settings handling.
  • DiscourseGraphs/discourse-graph#804: Updates left sidebar global settings wiring; main PR changes the global "folded/collapsable" toggle behavior and persistence via setGlobalSetting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main purpose of the PR: fixing the global left sidebar fold toggle behavior, which is the core change across the modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sid597 sid597 requested a review from mdroidian May 25, 2026 09:38
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