Skip to content

ENG-2185 Move export settings out of Settings into the Export panel - #1374

Open
trangdoan982 wants to merge 8 commits into
eng-2188-node-type-settings-are-spread-across-seven-inner-tabs-putfrom
eng-2185-move-export-settings-out-of-settings-into-the-export-panel
Open

trangdoan982 wants to merge 8 commits into
eng-2188-node-type-settings-are-spread-across-seven-inner-tabs-putfrom
eng-2185-move-export-settings-out-of-settings-into-the-export-panel

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented Aug 31, 2026

Copy link
Copy Markdown
Member

https://www.loom.com/share/0c24f4b276f049d29f5c21bbeb67083a

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

Reviewer brief

  • Result: the 7 export options are set from a collapsed Export options disclosure at the bottom of the Export dialog's Export tab. The Export tab is gone from Settings. Storage keys, the getExportSettings read path, and export behaviour are untouched, so saved values carry over.
  • Review focus: ExportOptions was moved with git mv, so it reads as a rename. The only content changes are the import paths (it is no longer inside settings/) and the component name.
Verification
  • pnpm install --frozen-lockfile then pnpm ci:validate from the repo root: exit 0. check-types across 12 packages, 142 tests in 23 files passing.
  • ESLint on every changed apps/roam file: 0 errors. Export.tsx (40) and BlockPropSettingPanels.tsx (3) report the same warning counts before and after this change (stashed and re-ran to compare), so no new ones. One exhaustive-deps warning this change introduced in Settings.tsx is fixed rather than left.
  • Dev bundle rebuilt clean; dist/extension.js contains the new disclosure and posthog event, and no longer contains the discourse-graph-export tab id.

Scope check

  • Ran $scope-check against the ENG ticket and final diff.
  • Scope beyond Done When:
    • apps/website/content/roam/guides/sharing-discourse-graph.md said the options live on the Export tab of the configuration, which this change makes wrong.

Local delegated full review

  • Ran a comprehensive review of the entire final diff in a subagent with a fresh context. Use $dg-delegated-full-review when no other full-review workflow is available.

Known gap: export can read a stale setting

The pending-write flush this PR used before (await flushPendingSettingWrites() in the export path) has been removed. It and its registry are tracked in ENG-2286, which blocks this ticket.

Until ENG-2286 lands, editing an export option and pressing Export within about 350 ms reads the option at its previous value. The export settings and the Export button share this dialog, so no unmount happens on that path and the commit-on-unmount landed in ENG-2186 (#1375) does not cover it.

The underlying debounce bug is ENG-2287.

@linear-code

linear-code Bot commented Aug 31, 2026

Copy link
Copy Markdown

ENG-2185

@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 18, 2026 10:12pm 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 ↗︎.

Comment thread apps/roam/src/components/settings/Settings.tsx

@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 1 potential issue.

2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment thread apps/roam/src/components/Export.tsx
@trangdoan982
trangdoan982 changed the base branch from main to roam-setting-overhaul August 31, 2026 17:05
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from 28c63a1 to a2f5284 Compare August 31, 2026 17:19
@trangdoan982
trangdoan982 changed the base branch from roam-setting-overhaul to eng-2186-grammar-nodes-drill-down-and-settings-navigation-primitive August 31, 2026 17:19
@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-2185-move-export-settings-out-of-settings-into-the-export-panel branch from d528b99 to 9d3d1ae Compare September 3, 2026 20:30
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from 9d3d1ae to cfba308 Compare September 4, 2026 21:57
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from cfba308 to 478402c Compare September 4, 2026 22:46
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from 478402c to 7eaf604 Compare September 5, 2026 22:55
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from a0293d1 to d29883b Compare September 7, 2026 22:23
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from d29883b to 156347d Compare September 8, 2026 01:02
@mdroidian

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T02:43:55.947555Z 5b39f50 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b39f50174

ℹ️ 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".

Comment thread apps/roam/src/components/Export.tsx Outdated
try {
// Awaited, not just fired: a commit only starts the Roam update, and an option edited
// a moment ago would otherwise still read as its previous value here.
await flushPendingSettingWrites();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Await all option writes before reading export settings

When a user toggles one of the four GlobalFlagPanel options (or adds/removes frontmatter) and immediately clicks Export, this flush does not cover that write. BaseFlagPanel.handleChange awaits direct roamAlphaAPI calls and only afterward calls setGlobalSetting, while BaseMultiTextPanel also performs untracked legacy creates/deletes; neither path registers those operations with pendingSettingWrites. On a slow write, the Markdown/PDF callback's getExportSettings() can therefore read the previous value and produce an export with references, embeds, or frontmatter contrary to the selection. Register and track those writes so this flush waits for every displayed option.

Useful? React with 👍 / 👎.

// Collapse unmounts the panels while closed, so each open seeds them from current values.
const exportGlobalSettings = useMemo(
() => bulkReadSettings().globalSettings,
// eslint-disable-next-line react-hooks/exhaustive-deps

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.

Could we read the current settings explicitly when opening the options and store that snapshot in state? That would make the intent clearer and avoid the extra useMemo dependency and lint suppression.

<Button
minimal={true}
small={true}
icon={exportOptionsOpen ? "chevron-down" : "chevron-right"}

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.

We could use rightIcon to fix the alignment issue

Image

We have a range of options for customizing the markdown export. These can be found on the `Export` tab of the discourse graph configuration.

![](/docs/roam/settings-export.png)
We have a range of options for customizing the markdown export. These can be found under `Export options` on the `Export` tab of the export dialog, alongside the export you are about to run.

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.

Maybe change one or two of these "Export"s, otherwise it reads like "export ... export ... export ... export".

"Change export dialog to "share dialog" and remove ", alongside the export you are about to run"

@mdroidian
mdroidian self-requested a review September 11, 2026 03:30
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from 5b39f50 to f29d9c6 Compare September 17, 2026 17:22
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from f29d9c6 to 24c90a9 Compare September 17, 2026 19:59
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from a82e191 to 37df89d Compare September 17, 2026 20:18
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from 37df89d to f7c8e77 Compare September 17, 2026 20:30
trangdoan982 and others added 8 commits September 18, 2026 16:39
The 7 export controls were used by exactly one surface but lived in
Settings, so changing an option meant leaving the Export flow, opening
Settings, and coming back.

Move them into a collapsed "Export options" disclosure at the bottom of
the Export dialog's Export tab, and remove the Advanced > Export tab that
ENG-2186 parked in Settings for this change to take out. The controls,
their storage keys, and the read path in getExportSettings are unchanged,
so saved values persist and export behaviour is untouched.

The advancedExport tab id goes with it, and the saved
"discourse-graph-export" deep link now resolves to the default tab
instead of a tab that no longer renders.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The image showed the export options inside the Settings dialog, with the
vertical tab list and the pre-taxonomy tab names. Both the Export tab and
that chrome are gone, so the screenshot contradicted the prose above it.

Removed rather than replaced: the surrounding text already names where the
options live, and no fresh capture of the Export dialog is available yet.
The frontmatter close-up further down is a crop of the control itself, so
it stays accurate and is kept.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…eads

The number and select panels in Export options defer their block-prop write
behind a short timer, so an option edited a moment before clicking Export was
read at its previous value.

Awaited rather than fired: the commit only starts the Roam block update, so a
synchronous flush would not have been enough on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Review feedback on the Export dialog: the options toggle sits on the left of
one row with "Exporting N results" and the discourse-context checkbox on the
right, instead of taking a row of its own.

The option panels are also seeded from a fresh settings read each time the
section opens. Collapse unmounts them while closed, so reading once at dialog
mount meant a long-lived dialog could show values that had since changed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review feedback: the checkbox sits right-aligned on the line above; the line
below is the Export options toggle on the left and the result count on the
right.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ltip

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The flush and its registry move to ENG-2286, which blocks this ticket.

Known gap until then: the export settings and the Export button share this
dialog, so an option edited within ~350ms of pressing Export is read at its
previous value. No unmount happens in that path, so the commit-on-unmount in
ENG-2186 does not cover it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@trangdoan982
trangdoan982 force-pushed the eng-2185-move-export-settings-out-of-settings-into-the-export-panel branch from f7c8e77 to 037e56c Compare September 18, 2026 20:40
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