Redesign followups/fixes - #512
Merged
Merged
Conversation
…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
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.
No description provided.