Skip to content

Refactor renderer state: tabs as views, page state split, writes without tabs - #10

Merged
ljm12914 merged 3 commits into
mainfrom
refactor/renderer-state
Nov 19, 2026
Merged

ljm12914 merged 3 commits into
mainfrom
refactor/renderer-state

Conversation

@ljm12914

Copy link
Copy Markdown
Member

Renderer-state phase of the bottom-up refactor, in three commits.

Cleanup (225fdf3)

  • Page kinds reduced to editable, paper, annotation, feed; task and event kinds removed.
  • Schedule date, start, end, status and priority become starter ordinary attributes; a new status attribute type with incomplete/complete groups mutes reminders when complete.
  • Dead code removed; knip added to the scripts and CI.

Tabs as view renders (9884744)

  • Each tab saves only its id and a view (type + params); a view registry declares component, title, history source and keep-alive.
  • Library, paper library, pinned and trash merge into one library view with saved params; the calendar and overview take their attributes as params.
  • Restore validates each view with typia and drops only invalid tabs.

Page state and writes (448b0b5)

  • The page state module is split by responsibility; behaviour unchanged.
  • Writes carry no tab id: each states its history (a page or the workspace) and may carry a write id echoed by the change notification.
  • Sidebar and command writes go to the workspace history; undo follows focus.
  • Undo is linear; redo branches are removed.
  • The main process no longer changes user-editable data after a network wait. A new attachments module downloads any file type, streams to disk with an idle timeout and returns the attachment id; the caller attaches it. Network feed operations no longer lock tabs.

Checks run locally

  • pnpm typecheck, pnpm lint (0 errors, existing 47 warnings), pnpm knip, pnpm db:check
  • pnpm test:db (5 + 235), pnpm test:feed (45)
  • pnpm perf within absolute and relative thresholds (run by Codex on the host)
  • Real-input smoke test not done.

🤖 Generated with Claude Code

ljm12914 and others added 3 commits November 19, 2026 16:44
Page kinds are now editable, paper, annotation and feed; the renderer
only creates editable pages. Date, start, end, status and priority
become ordinary attributes created once with each new workspace. A new
status attribute type groups options into incomplete and complete; any
status attribute in the complete group mutes the page's reminders. The
calendar and overview read pages by attribute instead of kind, through
a new hasValue page query.

Removes unused exports, files, components, aliases, test-only service
functions and four unused Tiptap dependencies. Adds knip with a CI step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each tab now saves only its id and a view (type plus params). A view
registry declares each type's component, title, history source and
whether it stays mounted when hidden. Tab titles are derived from the
params, so page tabs follow the page's current title.

The library, paper library, pinned and trash tabs become one library
view whose scope, page kind, sort, tags and attribute filters are saved
params. The calendar reads its date, start and status attributes from
params and gets a date-attribute selector; the overview counts the
incomplete group of its status attribute. Missing referenced pages or
attributes show a notice with a re-pick instead of dropping the tab.

Restoring checks each view with typia and drops only invalid tabs; a
broken layout falls back to the default layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Split the page state module by responsibility: confirmation dialogs, the
per-page edit buffer and autosave, page session registry, tab visit sync
and write tracking. Behaviour is unchanged.

Writes no longer carry a tab id. Each write states where the user did it
(a page or the workspace) and may carry a write id that the change
notification echoes, so the editor recognises its own saves in either
arrival order. The renderer waits for all in-flight writes when entering
or closing a tab or quitting. Sidebar and command writes go to the
workspace history; undo follows focus: editor -> that page, a tab group
-> its active view, sidebar or elsewhere -> workspace.

Undo is linear: a new write drops that history's redo references, and
the redo branch pickers are gone.

The main process no longer changes user-editable data after a network
wait. A new attachments module downloads any file type, streams it to
disk with an idle timeout and no size cap, and returns the attachment
id; the caller attaches it with a normal write. Handed-out attachments
are protected from cleanup until referenced. Network feed operations
are not tracked as writes, so they no longer lock tabs.

Also: tab titles re-read only when the title block changes, the
calendar picks status options by group, and view titles live in the
view registry only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ljm12914
ljm12914 merged commit 24c41fe into main Nov 19, 2026
1 check passed
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.

1 participant