Skip to content

feat(ui-core): schema foreshadowing banner on Ingest and Batches (#290) - #296

Merged
JArmandoAnaya merged 3 commits into
mainfrom
journey/pr3-banner
Aug 4, 2026
Merged

feat(ui-core): schema foreshadowing banner on Ingest and Batches (#290)#296
JArmandoAnaya merged 3 commits into
mainfrom
journey/pr3-banner

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

Closes #290. Stacked on #295 (journey/pr2-checklist) — merge order #294#295 → this.

What

The schema gate stays exactly where it is — server-side, refused at batch approval — and the foreshadowing moves earlier: a quiet Alert (its first consumer as an informational banner) on the two screens a user reaches before the gate, saying "You can ingest now — you'll need labels before annotating." with a "Define your labels" link.

  • New frontend/ui-core/src/screens/SchemaForeshadow.tsx, promoted rather than copied — two screens render it and two spellings of one warning are free to drift. Driven by useProjectReadiness (Add useProjectReadiness hook and normalize the has-schema question #288): it renders only on a positive hasSchema: false; while readiness has no answer, nothing renders. No dismiss mechanism — the banner's exit is the remedy itself.
  • IngestScreen: banner between the header and the stepper; new optional onOpenSchema prop. The stepper itself is untouched.
  • BatchesScreen: banner under the header; new optional onOpenSchema prop.
  • ProjectScreen: threads onOpenSchema into the Batches tab as onTabChange("schema"), only when the host controls the tabs.
  • frontend/app/src/routes.tsx: the ingest route wires onOpenSchema to /projects/{id}?tab=schema — spelling the URL is the shell's job.

No client-side pre-validation anywhere: approval still goes to the server and renders whatever it answers.

Tests

  • gallery.test.tsx +2 (BatchesScreen): banner present without a schema and its link fires the callback; absent once a schema exists (asserted after the readiness sources have answered, so it is a decision, not a pending query).
  • ingest.test.tsx +2: same pair, plus the assertion that the dropzone stays live under the banner — foreshadowing, not a gate.
  • Existing suites untouched: tests that don't stub schema/stats get a null readiness and no banner.

bash scripts/check.sh frontend: All checks passed (ui-core 393 tests / 26 files).
Playwright navigation.spec.ts shell.spec.ts gallery.spec.ts: 44 passed.

useProjectReadiness composes the three queries the project header already
runs — active schema, project stats, batches — so it costs zero requests
on the project screen, and it is the single spelling of "has a schema"
from here on: the schema-less 404 is an answer, any other failure means
the hook answers null rather than guessing. currentStep walks
labels -> images -> annotate -> export; "done" is declared and waits on
hasReleases and an ingest-in-flight signal, both recorded as out of v1.
A Checklist pattern — every step rendered, one active, finished ones
checked — driven on the project Overview by useProjectReadiness, so the
strip costs no request the header was not already paying for. It renders
above the stat tiles and above the empty state alike, because a project
with nothing ingested is exactly the reader the journey exists for, and
it retires itself at "done". Deliberately not an extraction of the
ingest stepper: that one mounts only its active step and its tests pin
the choreography. An upcoming step is plain text even when a callback
exists — pointing three steps ahead lands somebody on a screen that
refuses everything.
The schema gate stays server-side — approval still refuses with
SchemaNotFound and nothing pre-checks it. What moves earlier is the
foreshadowing: one Alert on Ingest and on the batch list, rendered only
when useProjectReadiness positively answers hasSchema: false, with a
link to the schema tab. Promoted into one SchemaForeshadow component
rather than spelled twice, and no dismiss — the banner's exit is the
remedy itself.
@JArmandoAnaya
JArmandoAnaya changed the base branch from journey/pr2-checklist to main August 4, 2026 04:19
@JArmandoAnaya
JArmandoAnaya merged commit a2fafee into main Aug 4, 2026
14 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the journey/pr3-banner branch August 4, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schema foreshadowing banner on Ingest and Batches

1 participant