Skip to content

The web and the iPhone app take library actions through one createLibrary - #121

Merged
NiallJoeMaher merged 2 commits into
mainfrom
arch-library-actions
Oct 27, 2026
Merged

NiallJoeMaher merged 2 commits into
mainfrom
arch-library-actions

Conversation

@NiallJoeMaher

Copy link
Copy Markdown
Contributor

Architecture candidate "the library actions, once" (docs/architecture.md).

  • packages/client: createLibrary(client) holds the actions both apps take (move, restore, edit, remove, fromBin, forever, Tags, Lists, setTag, setInList, mark, reorder, putBack). Each one owns its route, body and how its error is read (through answer). It runs over a transport: sameOrigin() for the web (the session cookie) or the iPhone app's bearer api. There's one fake-fetch test per action, plus tests for error mapping and for a 404 when taking an Item out of a List.
  • Web: lib/moves.ts, tagging.ts and listing.ts are replaced by lib/actions.ts, which holds the library, went() (did it go through) and the moves that also update the rail counts. ItemBar, ItemList, ItemTags, ItemLists, ArchiveView, ListView, TagsSection, Reader, Preview and NoteEditor now use it.
  • iPhone: lib/data.ts wraps each action with what it makes stale, so screens no longer repeat invalidateQueries. pick, lists/[id], archive, bin, tags, ItemsScreen and usePatchItem now use it.
  • Left alone on purpose: settings and account, sharing (people, visibility, copy, leave), highlights, search, imports, opening and re-reading an Item, the web's keepalive PATCHes, and ListView's note, position and List edits. Each is used on one screen of one app, or needs its own transport.

One behaviour change: on the iPhone, Undo after taking marked rows out of a List now marks them again, as the web already does.

Gates: typecheck, lint, test (499), e2e (56) and design (0) all pass. The iPhone screens were only typechecked.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Per4f8yL5A7nL9frZVDJj7

…rary that owns each route, body and error; the iPhone app refetches what each makes stale in one place

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Per4f8yL5A7nL9frZVDJj7
Signed-off-by: NiallJoeMaher <nialljoemaher@gmail.com>
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
pluck Ready Ready Preview Oct 27, 2026 7:54am UTC

Request Review

…rops the finished session section

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Per4f8yL5A7nL9frZVDJj7
Signed-off-by: NiallJoeMaher <nialljoemaher@gmail.com>
@NiallJoeMaher
NiallJoeMaher merged commit 3834f65 into main Oct 27, 2026
2 of 3 checks 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