Skip to content

Comments

ENG-1217: Port section component in left sidebar#804

Open
sid597 wants to merge 2 commits intomainfrom
eng-1217-section-components-in-left-sidebarv2
Open

ENG-1217: Port section component in left sidebar#804
sid597 wants to merge 2 commits intomainfrom
eng-1217-section-components-in-left-sidebarv2

Conversation

@sid597
Copy link
Collaborator

@sid597 sid597 commented Feb 20, 2026

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


Open with Devin

Summary by CodeRabbit

  • Bug Fixes

    • Fixed left sidebar page changes not persisting when reordering, adding, or removing pages.
  • Improvements

    • Enhanced synchronization of personal settings to ensure configuration changes are properly saved.
    • Improved flexibility in settings panel configuration options.

@linear
Copy link

linear bot commented Feb 20, 2026

@supabase
Copy link

supabase bot commented Feb 20, 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
Collaborator Author

sid597 commented Feb 20, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sid597 sid597 marked this pull request as ready for review February 20, 2026 19:25
Copy link
Collaborator Author

sid597 commented Feb 20, 2026

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

📝 Walkthrough

Walkthrough

The PR migrates left-sidebar settings components to new block-prop driven persistence approaches. Global settings now wire GlobalFlagPanel with setGlobalSetting for page operations (add/move/remove), while personal settings implement PersonalNumberPanel with a new sectionsToBlockProps synchronization layer and setPersonalSetting persistence. Zod schemas are updated to use UID-based identifiers and array-based structures.

Changes

Cohort / File(s) Summary
Global Settings Migration
apps/roam/src/components/settings/LeftSidebarGlobalSettings.tsx
Replaced FlagPanel with GlobalFlagPanel for global-section flags. Added pagesToUids helper to map pages to UIDs. Wired setGlobalSetting persistence for page reorder (movePage), add (addPage), and remove (removePage) operations. Updated state-first-then-persist flow.
Personal Settings Migration
apps/roam/src/components/settings/LeftSidebarPersonalSettings.tsx
Replaced NumberPanel with PersonalNumberPanel. Introduced sectionsToBlockProps and syncAllSectionsToBlockProps helpers to map section config to nested block-props structure. Added sectionsRef shared reference to avoid stale closures. Wired setPersonalSetting persistence across multiple mutation paths (add/move/edit sections, alias changes). Expanded aliasDebounceRef usage for debounced sync operations.
Block Prop Components
apps/roam/src/components/settings/components/BlockPropSettingPanels.tsx
Extended NumberWrapperProps with optional setter?: NumberSetter field. Updated PersonalNumberPanel to destructure and forward setter prop, defaulting to personalAccessors.number.setter when not provided, enabling per-instance setter override.
Schema Updates
apps/roam/src/components/settings/utils/zodSchema.ts
Added required name: string field to PersonalSectionSchema. Replaced Page string with uid: string in Children items. Changed LeftSidebarPersonalSettingsSchema from record<string, ...> (default \{\}) to array of PersonalSectionSchema (default \[\]).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Port section component in left sidebar' directly relates to the main changes in the PR, which involve porting/refactoring section-related components in the left sidebar settings files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

devin-ai-integration[bot]

This comment was marked as resolved.

@sid597 sid597 requested a review from mdroidian February 20, 2026 20:00
Copy link
Contributor

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

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

The audio in the loom is mostly inaudible. Please review the looms before submitting.
Also, a couple files are not formatted again.

There's a single comment asking to explain why caused the PersonalNumberPanel to break the pattern from the others. I think it would be worth exploring that deeper to see if there are alternative solutions prior to breaking the pattern.


export const PersonalNumberPanel = (props: NumberWrapperProps) => (
<BaseNumberPanel {...props} {...personalAccessors.number} />
export const PersonalNumberPanel = ({ setter, ...props }: NumberWrapperProps) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

format with prettier

uid={globalSection.settings?.folded?.uid || ""}
parentUid={globalSection.settings?.uid || ""}
disabled={!globalSection.children?.length}

Copy link
Contributor

Choose a reason for hiding this comment

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

format with prettier

export const PersonalNumberPanel = (props: NumberWrapperProps) => (
<BaseNumberPanel {...props} {...personalAccessors.number} />
export const PersonalNumberPanel = ({ setter, ...props }: NumberWrapperProps) => (
<BaseNumberPanel {...props} setter={setter ?? personalAccessors.number.setter} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this panel breaking the pattern with setter? What is the reason/need for this?

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.

2 participants