Skip to content

Split App.tsx: side panel and history logic - #34

Merged
thierrysays merged 1 commit into
mainfrom
tss/split-app-tsx
Nov 29, 2026
Merged

thierrysays merged 1 commit into
mainfrom
tss/split-app-tsx

Conversation

@thierrysays

Copy link
Copy Markdown
Collaborator

Stacked on #33 (base is that PR's branch; retarget to main once it merges).

App.tsx mixed several jobs. This takes out two, by job, without changing behaviour:

  • src/Panel.tsx: the inspector beside the map (fill, shape, markers, text style, links, picture, notes). It takes props only.
  • src/history.ts: commit, undo, redo and the sheet-list operations (park, add, delete, open) as pure functions. They now have tests (src/history.test.ts): the undo cap, no-op edits, undo/redo, and the index maths of deleting a sheet, none of which had a test before.

App.tsx goes from 1030 to about 900 lines.

Not split yet: persistence and file handling, the canvas camera and pointer tools, the map rendering and the toolbar. They share a lot of state with the rest of the component, so each needs its own step.

Checks: tsc clean, 157 vitest tests pass, npm run build passes. Smoke test in Chromium against the dev server: the panel renders, Tab adds a topic, undo and redo work, and no console errors. Not run in the Tauri window.


Generated by Claude Code

- Panel.tsx: the inspector beside the map, props only
- history.ts: commit, undo, redo and the sheet list operations as pure functions, now tested (cap, no-op edits, sheet index maths)

No behaviour change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016C1G4M3Q75H4ct7Z9N3maY
@thierrysays
thierrysays changed the base branch from tss/pensive-babbage-327lhr to main November 29, 2026 17:43
@thierrysays
thierrysays marked this pull request as ready for review November 29, 2026 17:43
@thierrysays
thierrysays merged commit 1e3309b into main Nov 29, 2026
2 checks passed
@thierrysays
thierrysays deleted the tss/split-app-tsx branch November 29, 2026 17:50
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