Skip to content

Redesign followups/fixes - #512

Merged
joeyballentine merged 3 commits into
mainfrom
redesign-followups
Jul 31, 2026
Merged

Redesign followups/fixes#512
joeyballentine merged 3 commits into
mainfrom
redesign-followups

Conversation

@joeyballentine

Copy link
Copy Markdown
Contributor

No description provided.

joeyballentine and others added 3 commits July 31, 2026 12:29
…ion order

Three reported bugs, all in the page layer.

Dataset pages opened in edit mode on the deployed site. `useWebApi`'s argument
means "allow editing even though we are deployed" — it exists for the add-model
preview — so passing `IS_DEPLOYED` made being deployed the one condition that
switched editing on. Dataset pages now call `useWebApi()` like every other page
that renders existing content.

The images notice rendered twice on dataset pages. `PageContainer` is the whole
page shell (header, notice, footer), and this was the only page in the repo that
nested two of them: `Page` wrapped `PageContent`, and both rendered one. Dropped
the outer one and moved the not-found branch inside the remaining one so it
keeps its shell.

On mobile the model page put two card grids ahead of the model's own details.
The page grid collapses to a single column below `lg` and renders in DOM order,
and both grids lived at the bottom of the description column, so downloads and
specs came after "Similar models". The sidebar is now the second grid child.

Similar models is also capped at 4 (was 24) and spans the full width under both
columns rather than continuing the description column. The card grid is
`auto-fill minmax(280px, 1fr)`, so four is exactly one row at page width.

Tests render both pages against the deployed origin. `vite-plugin-svgr` needed
an explicit `include`: it only claims `*.svg?react` by default, and the app
imports plain `*.svg`, so the logo resolved to a URL string and any page-level
render died on it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpogQiNgM8Lg8PTTfTGSNk
Two suites, because neither alone covers "any page".

use-web-api covers the mechanism: both the `(!IS_DEPLOYED || override)` gate and
`useEditModeToggle`'s separate check, including that the api object itself is
withheld and not just the boolean.

Each case awaits the provider's own promise and pairs its assertion with an
overriding caller in the same render. On the first tick `webApi` is undefined
and `editMode` is false, which is also what a correct deployed build looks
like — so a `waitFor` here passes before the api ever arrives, and stays green
with the deployment check deleted. The control makes "still locked" and "hasn't
loaded yet" distinguishable. For the same reason the toggle case toggles twice:
`enabled` starts true, so one flip only ever turns editing off.

edit-mode-guard covers the reach: it scans every call site under src/ and
requires the argument to be absent or listed as a documented exception.
Rendering every page against the deployed origin is impractical and would only
ever cover the pages that exist today; the scan covers a page added later the
moment it is written.

The exception list is real rather than a loophole — add-model and add-dataset do
unlock editing when deployed, on purpose. That is the "propose a contribution"
flow, and there `getWebApi` returns session-storage-backed collections, so the
edits are a local scratch copy that cannot reach the database.

Verified by mutation: reintroducing the dataset bug fails 4 tests, and breaking
each gate in use-web-api.tsx separately fails 3 and 2.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpogQiNgM8Lg8PTTfTGSNk
Each category's buttons sat in a bare <div>. They are inline-flex boxes and JSX
drops the whitespace between them, so a category rendered as one unbroken strip
of touching pills. The simple selector already solved this with `.groupTags`;
the advanced one never got the equivalent, and now uses the same 0.375rem gap.

Also covers the selector with tests, which it had none of despite being the
site's main filtering control: single-select and auto-deselect in simple mode,
the required/forbidden/any cycle in advanced mode, clear-all, the datasets
context filter, and the automatic switch to advanced when a selection has no
simple representation.

Tag ids and names are read from data/tags.json rather than hard-coded, so
editing the tag list does not break the suite.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpogQiNgM8Lg8PTTfTGSNk
@joeyballentine
joeyballentine merged commit 3a84a05 into main Jul 31, 2026
4 checks passed
@joeyballentine
joeyballentine deleted the redesign-followups branch July 31, 2026 17:52
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.

1 participant