Repository navigation
Hand views only what they call, and drop what nothing uses (#118, #119) - #130
Merged
Merged
Conversation
Views were handed more of the bridge than they used. ProjectView and PageView took all of PagesApi, LinkedReferences took all of it to pass on, and ProjectView declared an availability prop it never read, which App fetched for every project only to pass it. Each view's bridge prop is now what it calls and what the views it renders call: StepsPages beside the steps, PageViewPages as that plus search and deleteBlock (LinkedReferences takes the same, since each cut is a PageView), and ProjectViewPages as PageViewPages plus ProjectView's own ten calls, which is what App takes. ProjectView loses availability, and App stops fetching it. The projects:availability channel and the bridge stay. formatLastOpened and AVAILABILITY_LABEL in ui.ts were imported nowhere, and formatLastOpened was the renderer's one Date.now() outside index.tsx; ui.ts now holds only Act. getLogStatus returned view.status and nothing else: the session reads view.status, and the comment moves onto that field. getPage was already the one kept by #113. No behaviour changes beyond App no longer asking for reachability nothing shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #118.
Closes #119.
What changed
#118: each view takes only the bridge calls it makes, and the ones of the views it renders. The types build up the tree:
StepsPages(PageView/steps/steps.ts): the five write calls the steps make.PageViewPages(PageView.tsx):StepsPagesplussearchanddeleteBlock, whichPageViewcalls itself.LinkedReferencestakes the same type, since each cut it renders is aPageView.ProjectViewPages(ProjectView.tsx):PageViewPagesplus the ten callsProjectViewmakes itself (onChanged,show,locate,go,back,rezoom,addImage,addBlock,indentBlock,blockMenu).App'spagesprop is exactly this.A call added to a child shows up in its parents' types with no edit to them.
ProjectViewalso loses itsavailabilityprop, which it never read.#119: what nothing used is gone.
formatLastOpenedandAVAILABILITY_LABELinapp/src/renderer/ui.tswere imported nowhere.formatLastOpenedwas also the renderer's oneDate.now()outsideindex.tsx.ui.tsnow holds onlyAct.getLogStatus(view)inpages-store.tsreturnedview.statusand nothing else. The session'sstatusreadsview.status, and the function's comment moves onto thestatusfield ofPagesView.getPagewas the third item in the issue. pages: queries take the fold state, not the whole view #113 keptgetPageas the public query and droppedpageOf, so there is nothing left to do there.app/CLAUDE.mdno longer namesgetLogStatus.For the reviewer
Appno longer callsprojects.availability. It fetched each project's reachability after every refresh only to pass it toProjectView's unread prop, so nothing on screen changes. Theprojects:availabilitychannel, its preload entry andstore.checkAvailabilityall stay, per "Before removing anything" inapp/CLAUDE.md. A comment inApp.refreshsays the fetch comes back with the code that draws it.Tests
--user-data-dirand a scratch project): with the project opened and the window reloaded, the journal loaded without the availability fetch,pages.status()answered through the session, and a block typed through the view's box was written.npm test(201 tests across all workspaces),npm run typecheckandnpm run lintpass.🤖 Generated with Claude Code