test(ui): pin draft/history helpers and relocate form seeds (#1044 follow-up) - #1157
Merged
Conversation
Pin rememberComposerDraft/readComposerDraft (key no-op, blank delete, 120k/32 caps), rememberComposerHistoryEntry (trim/dedup/50 cap), and navigateComposerHistory (up/down + saved-draft round trip) so the useComposerDraft/useComposerHistory seams from #1153 stay pure-unit covered.
PlanReminderFormSeed and the create/template/edit/duplicate seed builders are pure mappings — relocate them next to the other form helpers so PlanReminderFormDialog stays the React owner of field state and submit, matching the #1044 ownership split.
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.
Summary
Follow-up polish to #1153 (Closes #1044 already shipped). Behavior-neutral only:
useComposerDraft/useComposerHistory(rememberComposerDraft/readComposerDraft,rememberComposerHistoryEntry,navigateComposerHistory) — closes the untested-gap note from the refactor(ui): decompose composer and plan-reminder panels into focused hooks (#1044) #1153 review.PlanReminderFormSeed+ create/template/edit/duplicate seed builders fromplan-reminder-form-dialog.tsxintoplan-reminder-helpers.ts(pure mappings). Panel imports seeds from helpers; dialog stays the React owner of field state + submit.No behavior or visual change; no contract weakening.
Verification
npm --workspace @maka/ui run build+typecheck— clean.node --test packages/ui/dist/__tests__/composer-helpers.test.js— 22/22 pass (includes the new draft/history suites).npm --workspace @maka/ui run test:dist— 184/184 pass.npm --workspace @maka/desktop run typecheck— clean.Review focus
Seed move is mechanical (same functions, new module). Prefer reading the new pure tests against
composer-helpers.tsfor the draft Map caps and history navigation round trip.