Refactor: clean data/UI boundary — actions as data, app-level hook (#99) - #104
Open
mitschabaude wants to merge 3 commits into
Open
mitschabaude wants to merge 3 commits into
mitschabaude wants to merge 3 commits into
Conversation
- Replace useRepoData with app-level useAppData hook (instantiated once in App.tsx)
- Actions are now data: UI dispatches { type, ...payload } instead of calling functions
- Routing is bidirectional: route flows in via dispatch, activePath flows out as state
- Remove setActivePath and recordRecent as hook inputs
- Rewrite tests to use new useAppData + dispatch API
- All 172 tests pass, type check clean
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
Refactors the data ↔ UI boundary as prep for the data layer V2 rebuild.
Changes
{ type, ...payload }objects viadispatch()instead of callingactions.createNote()etc.useRepoData(per-repo) →useAppData(instantiated once inApp.tsx). Session, auth, recents are properly global now.dispatch({ type: 'route-changed', route }). Active path flows out asstate.activePath. The data layer never knows about URLs.setActivePathandrecordRecentcallbacks no longer passed into the data hook.Validation
npm run checkcleannpm test— 172/172 passdispatch)Closes #99