Skip to content

ENG-2186 Grammar › Nodes drill-down and settings navigation primitive - #1375

Merged
trangdoan982 merged 8 commits into
roam-setting-overhaulfrom
eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive
Sep 28, 2026
Merged

trangdoan982 merged 8 commits into
roam-setting-overhaulfrom
eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Reviewer brief

  • Result: the rail no longer grows one tab per node type. Grammar › Nodes opens a list of node types. Clicking one opens that node's page in place, with a back button and a Grammar › Nodes › <node> breadcrumb. The node page itself is unchanged here (still the tabbed NodeConfig); ENG-2188 (ENG-2188 Node type settings are spread across seven inner tabs; put them on one page #1420) rebuilds it on top of this PR.
  • Review focus: the route. Navigation state is a path array (["grammar-nodes", nodeTypeUid]) owned by a reducer with four actions: select-tab, push, pop, truncate. Blueprint Tabs only sees path[0]; the Nodes panel reads the rest through SettingsNavContext. Deep links still work: resolveInitialSettingsPath treats any id that is not a registered tab as a node type uid and opens it inside Grammar › Nodes. A uid that no longer matches a node falls back to the list.
  • No settings-write changes. This PR is presentation only. The deferred-write rework, the template buffer flush and its delete ordering, and the node colour commit-on-unmount have all been reverted out. The only non-navigation change left is an optional title on the template panel, which the drill-down needs to render it without a label.
  • Known bug this PR makes easier to hit (ENG-2287): settings panels debounce their write and cancel it on unmount. Back and the breadcrumbs sit next to the field and are keyboard-reachable, so typing and leaving within ~350ms drops the edit; between 250ms and 350ms it writes the legacy block but not the new store, leaving the two disagreeing. Previously the only exit was a deliberate tab click, reliably slower than that. ENG-2286 separately covers flush-before-read.

Verification

  • tsc --noEmit and eslint report no errors or warnings for apps/roam. Production build completes with 0 errors.
  • Checked in Roam: the rail lists no node types; list → node page → Back and breadcrumb both return to the list; openers that pass a node type uid as selectedTabId land on that node's page; typing and then pressing Back immediately keeps the edit.

Loom video

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

Scope check

  • Ran $scope-check against the ENG ticket and final diff.
  • Scope beyond Done When: none. The write plumbing has been removed to ENG-2286 and ENG-2287.

Local delegated full review

  • Ran a comprehensive review of the entire final diff in a subagent with a fresh context.

@linear-code

linear-code Bot commented Aug 31, 2026

Copy link
Copy Markdown

ENG-2186

@vercel

vercel Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
discourse-graph Ready Ready Preview Sep 22, 2026 8:55pm UTC

Request Review

@supabase

supabase Bot commented Aug 31, 2026

Copy link
Copy Markdown

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 ↗︎.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread apps/roam/src/components/settings/navigation/SettingsPageHeader.tsx
Comment thread apps/roam/src/utils/settingsNavigation.ts Outdated
@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from ac26028 to 17ad1b7 Compare August 31, 2026 15:57
@trangdoan982
trangdoan982 changed the base branch from main to eng-2189-reorganize-roam-settings-replace-the-personalglobal-split August 31, 2026 15:57
Comment thread apps/roam/src/components/settings/components/EphemeralBlocksPanel.tsx Outdated
* is not a tab at all is a node type uid from when every node type had its own rail tab;
* those links now open the node's page inside Grammar > Nodes.
*/
export const resolveInitialSettingsPath = (

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the ENG-2186 "existing deep links still resolve" requirement. resolveSettingsTabId (ENG-2189) maps the renamed tabs; its passthrough comment assumes per-node tabs still exist, keyed by node page uid. This PR removes those tabs, so an id that is not a known tab is now read as a node type uid and opens that node inside Grammar › Nodes instead of selecting a tab that no longer exists.

Deliberately no separate deep-link API: selectedTabId plus this resolution covers it, and ENG-2189 already addresses individual rows via settingAnchor.

Comment thread apps/roam/src/styles/settingsStyles.css Outdated
// A deleted node type or stale deep link resolves to nothing; return to the list.
const isStalePath = Boolean(nodeTypeUid) && !node;
useEffect(() => {
if (isStalePath) goToDepth(0);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The path outlives this panel — renderActiveTabPanelOnly unmounts and remounts it on every tab switch — so it can point at a node type deleted in the meantime, or arrive stale from a saved link. goToDepth(0) rather than pop() so a depth-2 stale path converges in one dispatch instead of two.

@graphite-app

graphite-app Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

PR size/scope check

This PR is over our review-size guideline.

  • Recommended: ~200 lines changed
  • Acceptable limit: up to 400 lines when well-scoped/self-contained
  • Preferred file count: fewer than 5 files

Please split this into smaller PRs unless there is a clear reason the changes need to land together.

If keeping it as one PR, please add a brief justification covering:

  • What single problem this PR solves
  • Why the files/changes are coupled

@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from bd1b4fe to 592a07c Compare September 3, 2026 20:30
@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from 592a07c to 5c92bfd Compare September 4, 2026 21:57
@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from 5c92bfd to 92a4176 Compare September 4, 2026 22:46
@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from 9dba941 to fd1a59a Compare September 7, 2026 22:23
@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from f4058f2 to 9ffa982 Compare September 8, 2026 17:08
@trangdoan982
trangdoan982 removed this pull request from stack #1423 September 9, 2026 19:16
@trangdoan982
trangdoan982 added this pull request to stack #1426 September 9, 2026 19:30

@mdroidian mdroidian left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I’m blocking this on scope and size. ENG-2186 covers the node list and drill-down navigation. The proposal explicitly limits M1 to presentation changes without changing how settings work.

Please remove the settings-write refactor and export flush infrastructure from this PR and track them in a separate ticket.

The persistence issue appears to be pre-existing. If the new Back button makes it easier to encounter, call that out in the separate ticket with the specific failure, reproduction steps, and acceptance criteria. That will make the problem and proposed fix much easier to review.

If any part is needed to prevent a regression introduced by this PR, please identify that dependency explicitly.

Comment thread apps/roam/src/components/settings/navigation/SettingsNavContext.tsx Outdated
Comment thread apps/roam/src/components/settings/navigation/SettingsPageHeader.tsx Outdated
Comment thread apps/roam/src/styles/settingsStyles.css Outdated
@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from 0ae32bc to 324529f Compare September 17, 2026 17:19
@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from 2c9d5c2 to 6aee216 Compare September 18, 2026 20:39
Base automatically changed from eng-2189-reorganize-roam-settings-replace-the-personalglobal-split to roam-setting-overhaul September 22, 2026 20:54
trangdoan982 and others added 8 commits September 22, 2026 16:54
Replaces the per-node-type rail tabs with a single Grammar › Nodes entry that
drills from the node list into a node type's page, with a back button and a
breadcrumb. The route state is a path reducer (select-tab / push / pop /
truncate) exposed through SettingsNavContext; an incoming id that is not a
known tab is treated as a node type uid so the old per-node deep links keep
resolving.

Also carries the write plumbing the drill-down made necessary. Panels debounce
their writes and used to cancel the pending one on unmount; a back button puts
an unmount one keystroke from every input, so a commit now runs exactly once
by timer, flush, or unmount (useDeferredWrite). Legacy block writes go through
an awaitable hook registered with the same in-flight tracker, and every commit
re-reads the config tree only after its write resolves, so a reader that
flushes first (the export) sees the value it was just given.

The node type page itself keeps its inner tabs here; ENG-2188 rebuilds it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Roam ships Tailwind, so the hand-rolled dg-settings-* rules were
redundant with the utilities the rest of apps/roam already uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The registry, flushPendingSettingWrites and trackRoamWrite have no consumer
at this point in the stack; their only caller is Export, two PRs above.
Tracked in ENG-2286, which must land before ENG-2185.

useDeferredWrite still commits on unmount rather than cancelling: Back and
the breadcrumbs added here are fast unmount paths mid-debounce.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Reverts the deferred-write rework, the template buffer flush and its
delete ordering, and the node colour commit-on-unmount. Only the optional
title on the template panel stays, which the drill-down needs.

This PR is now presentation only. The debounce bug is ENG-2287 and the
flush-before-read is ENG-2286.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@trangdoan982
trangdoan982 force-pushed the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch from 6aee216 to d54edbc Compare September 22, 2026 20:54
@trangdoan982

Copy link
Copy Markdown
Member Author

@mdroidian i removed the deferred write settings. for this PR all changes are just cosmetic reorganization. I recorded the follow-up ticket: ENG-2286: Settings writes: pending-write registry and flush-before-read

@trangdoan982
trangdoan982 merged commit d2955f2 into roam-setting-overhaul Sep 28, 2026
9 checks passed
@trangdoan982
trangdoan982 deleted the eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive branch September 28, 2026 14:32

This branch was successfully deployed

1 active deployment
Preview — d54edbc5 Deployed Sep 22, 2026 by vercel[bot]
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