Skip to content

feat: Export depth options (Export first thought / Export subthoughts)#4518

Draft
raineorshine with Copilot wants to merge 2 commits into
mainfrom
copilot/export-depth-options-again
Draft

feat: Export depth options (Export first thought / Export subthoughts)#4518
raineorshine with Copilot wants to merge 2 commits into
mainfrom
copilot/export-depth-options-again

Conversation

Copilot AI commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Adds two advanced checkboxes to the Export Modal's "Advanced" section to control export depth, both defaulting to checked (preserving existing behavior).

New options

  • Export first thought — when unchecked, skips the selected thought(s) and exports only their descendants. For multi-selection, skips the entire first level.
  • Export subthoughts — when unchecked, exports only the top-level thought(s) with no descendants. Traversal stops early rather than post-processing.
Export first thought Export subthoughts Output for A → [B → [D], C → [E]]
A, B, D, C, E (default)
B, D, C, E
A
B, C

Changes

  • src/selectors/exportContext.ts — adds maxDepth?: number option; maxDepth=0 stops recursion immediately, propagates as maxDepth - 1 through recursive calls
  • src/components/modals/Export.tsx — adds shouldExportFirstThought / shouldExportSubthoughts state; when first thought is excluded, expands sortedPaths to children IDs before mapping to exportContext; numDescendantsInState short-circuits to 0 when subthoughts are excluded
  • src/selectors/__tests__/exportContext.ts — adds tests for maxDepth: 0 and maxDepth: 1 for both plain text and HTML formats

Copilot AI linked an issue Jul 5, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Vercel preview: https://em-5eue0kgyy-cybersemics.vercel.app

Copilot AI changed the title [WIP] Add export options for first thought and subthoughts feat: Export depth options (Export first thought / Export subthoughts) Jul 5, 2026
Copilot AI requested a review from raineorshine July 5, 2026 18:48
@raineorshine

Copy link
Copy Markdown
Contributor

@copilot You forgot to push ad5cee4 to this branch.

Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot You forgot to push ad5cee4 to this branch.

Applied in commit feat: add Export first thought and Export subthoughts advanced options. All 15 exportContext tests pass and lint is clean.

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.

Export depth options

2 participants