Repository navigation
feat(3C): editing UI + Publish page - #2
Merged
Merged
Conversation
Client wrappers for every 3C write endpoint (aviary/perch/subject/ behavior/group/option CRUD, enablement replace-set, config diff + publish) and a reload() on useFetch so pages can refetch after a mutation. Additive and green (31 tests, lint, build); the editing pages that consume these are the next step.
SubjectsSection: add a subject (P2-D8 reserved names and the Excel sheet-name rule are enforced server-side; errors surface inline), record a departure, change type (one close+reopen action), and remove — removal of a published episode shows the API's friendly refusal. PerchesSection: add / edit label+group / retire / unretire / remove, same refusal handling. Shared useAction hook wraps every mutation (busy + friendly error), constants.js centralizes wire-value labels. 41 tests.
EnablementSection replaces the read-only counts block on the aviary page: the full catalog renders as checkbox grids (behaviors by group, then the four option kinds), seeded from the aviary's enabled sets, and Save submits the complete replace-set the PUT endpoint expects. Save stays disabled until something actually changed. Draft-config hint added at the top of the page.
VocabularyPage splits into BehaviorCatalog and OptionsCatalog. Add a behavior captures everything the schema and Excel derivation need (design §5): group picker, the six requires-flags as plain-language checkboxes, Excel row label, and row placement via insert-after. Add a group prefills the next sort order. Both catalogs get inline editing, one-click retire/unretire, and draft removal with the API's refusal surfaced for published entries. The enablement matrix stays read-only here — each aviary's page owns its enabled set.
GET /config/diff drives the review step: the change list since the latest version, a blocking violations panel when a draft change would break published values (with the server's fix-it messages), and the two explicit confirmation checkboxes the publish endpoint requires when behaviors changed requires-flags or Excel rows. Optional notes ride into the version history. Success shows the published version and its changes; the diff reloads to the clean state. Nav gains Publish; the Overview drift badge now links here.
…fresh Review findings fixed (same find→verify pass as the api branch): - AviaryPage/VocabularyPage/PublishPage only blank to 'Loading…' on first load. During post-mutation reloads the stale data keeps rendering, so sibling sections (an open editor row, a half-built form) are no longer unmounted and silently discarded. - EnablementSection resyncs its draft on enablement CONTENT, not prop identity — a perch rename two sections up no longer clobbers a dirty enabled-vocabulary draft. Real content changes still resync. - PublishPage refreshes the diff after a FAILED publish too: the server may require a confirmation the mount-time diff didn't show (draft moved under the page); without the refresh the needed checkbox never rendered and the page dead-ended. - Test gap closed: the default at-the-end add-behavior path is pinned to OMIT insertAfter (the server rejects an empty string). 61 tests (was 58).
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.
Phase 3 stage 3C — the editing UI + Publish page
The dashboard half of 3C (design §5), against the API client committed earlier on this branch. Everything edits the draft config; nothing observers see changes until Publish.
What's here
GET /config/diff, a blocking violations panel with the server's fix-it messages, the two confirmation checkboxes the publish endpoint requires when behaviors changed requires-flags or Excel rows, optional notes, and a success panel with the published version. Nav gains Publish; the Overview drift badge links here.useActionhook (busy + friendly error per mutation),constants.jsfor wire-value labels.Pre-merge review (standing multi-angle find→verify pass)
Same authorized find→verify pass as the API branch. Admin-side dispositions:
Loading…screen, unmounting ALL sections — an open editor row or half-built enablement draft in a sibling section was silently discardedinsertAfter: ''(which the server rejects) would pass the suitegroup: ''and show a server 400Verification
Merges with ethogram-api PR (3C backend). Note for the owner's future bulk push: the admin app still has no Vercel project — the staging test path remains local dev app ↔ staging api, per HANDOFF.