Repository navigation
refactor(widget): the review asks on #318 — reuse, naming and file size - #340
Conversation
`submitPanelLayout` and `submitPanelPlacement` read as two names for one question. The placement helper answers sheet-versus-inline; this one answers the vaul direction and classes once that is `sheet`, so it says so, and its docblock names the question asked first. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
`useListingDraft` already sets `reviewed` on `start` and on every `setStep`, so the local `seenReview` flag and the `correction` fallback were two more answers to a question the store owns. The panel now takes the prop alone, and the story and spec harnesses carry the store's rule themselves. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
`offersMailingList` stays the name of SahajCloud's own virtual field, which the event read returns. The form's prop is the answer to a plainer question, so it reads `hasMailingList` from `RegistrationView` down. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
`LivePreviewController`'s capture-phase guard already inerts every link a document session draws, so hiding this one was a second answer to the same question. It was also the wrong answer for a translations session, which leaves links live on purpose so the translator can reach the screen their string is on — and that session hid the line carrying one. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
`PROPOSABLE_EVENT_FIELDS` already decides what `sendProposal` sends, and SahajCloud's `validateProposal` refuses the rest whatever this file says. The second list only restated that collection's own `PRIVILEGED_FIELDS` so a type could compare the two, which made an upstream rename this file's problem for no gain the allowlist did not already give. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
One underlined line in a padded paragraph did not need a molecule of its own. The four call sites render the `Link` atom directly, and the wiring assertions that kept each list offering the flow move to `src/views/add-class-entry.test.ts`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
The checklist-behind-a-field was never about languages: it took a label, a
trigger label and a list of options, and both of its users happened to pass
language codes. It is `MultiSelect` over `{ value, label }` now, so the next
checklist reuses it instead of copying it.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
`ProposalForm.tsx` held the panel, its five steps, the review bar and the shared field wrapper in 676 lines, so reading any one of them meant scrolling past the rest. The panel keeps the state and the step ladder at 212 lines; each step, the review bar and the shared `ValidatedInput` sit beside it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
The geocoder field also owned `?q` — it read it, mirrored every keystroke into it, and carried three modes to say which. It takes `value` and `onChange` now and holds nothing, so the header's `SearchField`, which already owned the navigation a pick causes, owns the URL text too, and the add-a-class Where step keeps its own beside the draft. The `?q` spec moves with the behaviour, to `src/views/search-field.query.test.tsx`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWPVpmtgwRFo6diztM
Deploying sahajatlas with
|
| Latest commit: |
6b3967a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://367dbd74.sahajatlas.pages.dev |
| Branch Preview URL: | https://claude-refactor-147-review-a.sahajatlas.pages.dev |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Nine commits, nine threads on #318, and nothing rides along — the diff is the asks and no more. The two it calls unbuilt are genuinely larger than one run, and the Proposal → EventSubmission rebuttal is evidenced rather than asserted.
The MapSearch split lands on the right seam: the field holds nothing, SearchField owns ?q beside the navigation a pick causes, and the Where step owns its own text. store.ts:328 and SubmitView.tsx:170 confirm the store is the only owner of reviewed, so dropping the two fallbacks changes no behaviour.
One ask landed as something other than reuse: AddClassLink went away, and its chrome went into four verbatim copies rather than a shared owner.
Findings
should-fix— four verbatim copies of the deleted molecule's chrome,DynamicEventsList.tsx:175should-fix— the body says "Preview pending" while the preview is live at https://pr-340-sahajatlas.contact-c66.workers.dev, which theAtlas previewcheck run carries. Refresh the body.consider—LanguageOptionis a second name forMultiSelectOption,use-language-options.ts:5consider— a fifth open #318 thread is missing from the body's unbuilt list,MoreStep.tsx:47
What was checked
- The whole diff, 41 files, plus #147 and all 14 threads on #318, each traced to a commit or a rebuttal.
- Read on the branch:
config/store.ts,SubmitView.tsx,atoms/Link/Link.tsx,MapSearch.tsx,views/shared.tsx, and the five newProposalForm/files. - No contract surface moves: every renamed prop is internal, and SahajCloud keeps
offersMailingList. git grep: the footnote classes (4 hits),LanguageOption(declaration only),SearchField(8 sites —read-onlysurvives atfallbacks.tsx:198).- Preview opened: the
sy-atlasshell andembed.jsboth serve.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Deleting `AddClassLink` left its wrapper paragraph copied verbatim at all four call sites, so a padding tweak edited four files. The ask on #318 was to reuse an existing component rather than add one, so the chrome becomes a `footnote` appearance on the `Link` atom: the link owns the whole row and no caller wraps it. The variant must stay declared after `color` — both set a text colour, and tailwind-merge keeps the last one, so the other order drops `text-gray-11` and the line renders in the inherited colour. `Link.test.tsx` pins that, watched failing against the swapped order. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZ8rbr929UcLqj8Haa
Every part of the 700-line `lib/proposal.ts` was checked against the rest of the repo for an owner that already exists. One had one: building a Lexical document from plain text is the inverse of `lexicalToText`, and `lib/shape/lexical.ts` is the module that owns that format — `types/event.ts` already points at it as the serializer. It moves there, with the round-trip assertion it never had. The rest each answer a question nothing else does, so the file's size was the real finding. It splits along the section banners it already carried, one module per concern, re-exported from `index.ts` so no call site moves: shared the two field formats, and the leaf algebra patch and preview share place a picked place, in both directions: geocoder, and a stored address draft the steps, the draft, and what a filled one says about itself validate what stops a step, and where a refused submit lands patch the Events patch, and a correction's diff event a published class read back as a draft preview the listing a draft previews as timezone the nearest listed class's zone No behaviour changes. `nearestTimeZone` keeps calling `@turf/distance` through `lib/geo`, which is where this repo's lat/lng arithmetic already lives. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYYy9uHc2vP99LuLjd
`LanguageOption` and `MultiSelectOption` had become the same shape, and nothing imported the alias. The hook returns the component's own type instead, so one word names a picker option. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZ8rbr929UcLqj8Haa
The panel already was its own vaul instance, portaled into the widget frame and measured against it, beside the stack rather than inside it. What was still true of it is the height: on a wide widget only the review bar docked to the bottom corner, and every step before it spanned the full right edge — over the map, and over the pin the class is being added at. It docks for every step now, sized to its content and bounded at 70% of the frame, which is what the narrow sheet has always done with the same steps. That leaves `compact` with no reader, so the panel stops reporting its own content back up to the sheet: the `onCompactChange` prop, the layout effect pair behind it and DrawerStack's `panelCompact` state all go, and the chrome reads the container signal alone. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYYy9uHc2vP99LuLjd
The molecules table still carried `AddClassLink/`, which this branch deleted. Its description moves to the `Link/` row, where the chrome now lives, with the declaration-order constraint beside it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZ8rbr929UcLqj8Haa
A concurrent session pushed three commits to this branch — the foot-of-panel link chrome, the picker-option rename and the design-system row. No file overlaps this run's, so the merge is clean.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | 6b3967a | Oct 27 2026, 11:28 PM |
|
Base merge: none needed, the branch was already level with
Also aa69ac3: the molecules table still listed Lean gate ✓ 163 files / 1883 tests. Security review: no findings — 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
I could not arm auto-merge here, so this is the step left for you.
🤖 sydevs dispatcher |
6d76d87
into
claude/feat-147-submit-a-class
* fix(review-pr): name how to read a file as the branch has it Step 4 told the critic to "Read/Grep the touched files whole" and did not say how. Three sessions on three distinct days reached for a checkout, had it refused as irreversible local destruction, and each independently recovered with `git show <ref>:<path>`: - 2026-10-27 sydevs/SahajAtlasWeb#340 review-pr, which named the gap: "review-pr step 4 says read the touched files whole and does not say how, and a routine clone sits on a detached HEAD" - 2026-10-28 sydevs/WeMeditateWeb#13 revise - 2026-10-31 sydevs/WeMeditateWeb#218 review-pr, which added the reason the refusal costs nothing: "A critic must not touch the branch anyway, so no work was lost" The refusal is harmless and the recovery is one call, so this buys back a refused call and a rediscovery on each of the week's 50 review-pr dispatches, not a lost run. It lands in step 4 because step 3 already names its own git invocation and its own trap ("Never `FETCH_HEAD`"), so the shape is established and the clause needs no new paragraph. Nothing in workflow/skills or docs/why.md mentioned `git show` or `git checkout` before this. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWJDL68qx8zBJgZjLF * chore(loop): bump the plugin cache key to 5.3.0 An installed plugin's cache directory is named after `version` and never revisits the commit it recorded, so the skill change above reaches no installed consumer until this string moves. The routines read `main` fresh and do not need it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWJDL68qx8zBJgZjLF --------- Co-authored-by: Claude <[email protected]>
Summary
lib/proposal.tsaudit, the submit panel's height, and one guard that was a second answer to a question the live-preview link guard already answers.claude/feat-147-submit-a-class, because feat(widget): submit or correct a class, and opt into a mailing list #318 is authored by a human and a cloud session cannot push to it. Merging this into that branch, then feat(widget): submit or correct a class, and opt into a mailing list #318, keeps one review.Change outline
Reuse — three things that did not need to exist
Ownership — one answer per question
The panel, by file
lib/proposal.ts, audited part by partEvery part was checked for an owner that already exists. One had one; the rest each answer a
question nothing else does, so the file's size was the finding. It splits along the section
banners it already carried, re-exported from
index.ts, so no call site moves.The step panel's own sheet
Preview
Preview pending — CI publishes the
pr-<n>Workers alias for this PR once it runs.Test results
pnpm build✓,pnpm size✓ — standalone 312.5 / embed 314.3 / loader 2.8 KiB, each inside budget and marginally under feat(widget): submit or correct a class, and opt into a mailing list #318's own figures: the split added nothing to the eager graph, and the droppedcompactplumbing took a little out.src/lib/shape/lexical.tsis asecurityReview.triggerPatternpath, andplainTextToLexicalarrives there unchanged — it builds text nodes only, never alinknode, so it cannot put an href into a documentlexicalToHtmllater serializes. Its sink path is the one feat(widget): submit or correct a class, and opt into a mailing list #318 reviewed. The new@/typesimport isimport type, erased at build, which the size run confirms.SearchFieldwriting?q,plainTextToLexical's two, and the wide panel's docking.Manual verification
?qstill tracks each keystroke, and the active filters,bboxandcentersurvive./addfrom a region: the address and city fields still seed from the draft after an Edit round trip./addon a wide widget and walk every step. Each one now sits in the bottom-right corner at its own height rather than spanning the right edge, leaving the listing and the map's pin in view. A tall step (More details) scrolls inside the 70% bound.Notes for reviewer
7c97a09fixes. Thread left open for you.ProposaltoEventSubmission.EventSubmissionsis SahajCloud's retired collection name — SahajCloud#800/#801 folded it intoUserSubmissions, whose livetypeis'proposal'and whose live modules aremergeProposal.tsandresolveProposalRegion.ts. Say the word and it lands next run, under whichever name you want.submit.errors.online_url, the join-link key. There is no open translations ticket to ride on, and feat(widget): submit or correct a class, and opt into a mailing list #318's own notes already record a second gap of the same kind (submit.errors.first_date). Options are on that thread.Detail
The audit's one real move.
plainTextToLexicalbuilt a Lexical document by hand inside the proposal flow whilelib/shape/lexical.tsowns that format in both directions —types/event.tsalready points at it as the serializer. Nothing else failed the "another part of the code could do this" test:nearestTimeZonealready delegates its arithmetic to@turf/distancethroughlib/geo, which is where this repo's lat/lng math lives by rule;previewSessionsprojects eight sessions before anything is saved, which SahajCloud cannot answer andrrulewould cost more bundle than the loop it replaces; andcompactturned out to be load-bearing where it looked redundant —ReviewBarcounts the keys oflocationto decide a correction changed nothing, so leavingundefinedids in would break the no-changes message.PrivilegedEventFieldemitted no runtime check —void noPrivilegedFieldis erased. What stops a privileged key reaching intake issendProposal's filter againstPROPOSABLE_EVENT_FIELDS, which is untouched, plus SahajCloud's ownvalidateProposal.The live-preview guard was wrong in one direction as well as redundant in the other: a translations session leaves links live on purpose, so the translator can reach the screen their string is on, and this guard hid the line carrying
submit.chrome.correct_entryfrom them.MapSearch's three query modes collapsed because two of the three were really "who owns the text". The header owns?qbecause it already owns the navigation a pick causes; a form field owns its own.A concurrent session pushed to this branch mid-run — three commits moving the foot-of-panel link chrome into the
Linkatom, renaming the picker option and updatingDESIGN_SYSTEM.md. No file overlapped this run's, so6b3967ais a clean merge commit and the gate above is the merged result.Generated by Claude Code