-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(models): normalize mobile tab spacing and stabilize Combos layout #3374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
aa130a6
fix(models): normalize mobile tab spacing and stabilize Combos layout
0ec4601
docs(pr-assets): show the Models tab width stability fix
6d095ca
fix(gui): anchor the page-tabs guard to the base rule
16b358d
fix(gui): restore the Logs table clipping rules the carry reverted
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import { expect, test } from "bun:test"; | ||
| import { effectiveDeclaration, ruleBodies, withoutComments } from "./helpers/css-declarations"; | ||
|
|
||
| async function readStylesheet(path: string): Promise<string> { | ||
| return withoutComments(await Bun.file(new URL(path, import.meta.url)).text()); | ||
| } | ||
|
|
||
| test("Models tab strips keep their full-bleed container borders aligned", async () => { | ||
| const baseStyles = await readStylesheet("../src/styles.css"); | ||
| const workspaceStyles = await readStylesheet("../src/styles-models-workspace.css"); | ||
| const compatibilityStyles = await readStylesheet("../src/styles-compatibility-matrix.css"); | ||
|
|
||
| // The Combos workspace removes the outer container padding. Replacing the tab strip's | ||
| // padding with an equal inline margin keeps its border aligned with the tab buttons. | ||
| const tabStripSelector = ".main-inner.main-inner--combos > .page-tabs"; | ||
| const tabStripBodies = ruleBodies(baseStyles, tabStripSelector); | ||
| expect(tabStripBodies[0]).toMatch(/margin-inline:\s*36px/); | ||
| expect(effectiveDeclaration(baseStyles, tabStripSelector, "margin-inline")).toBe("18px"); | ||
| expect(effectiveDeclaration( | ||
| baseStyles, | ||
| tabStripSelector, | ||
| "padding-inline", | ||
| )).toBe("0"); | ||
| expect(tabStripBodies.at(-1)).toMatch(/padding-inline:\s*0/); | ||
|
|
||
| // Loading, empty, and error fallbacks do not render the workspace shell. Keep those | ||
| // shell-free states boxed instead of allowing the full-bleed Combos container to stretch | ||
| // their notice and retry controls edge to edge. | ||
| const shellFreeContainer = ".main-inner.main-inner--combos:not(:has(.combos-workspace-shell))"; | ||
| expect(effectiveDeclaration(baseStyles, shellFreeContainer, "max-width")).toBe("1200px"); | ||
| expect(effectiveDeclaration(baseStyles, shellFreeContainer, "margin")).toBe("0 auto"); | ||
| expect(ruleBodies(baseStyles, shellFreeContainer)[0]).toMatch(/padding:\s*32px 0 64px/); | ||
| expect(effectiveDeclaration(baseStyles, shellFreeContainer, "padding")).toBe("22px 18px 48px"); | ||
|
|
||
| const shellFreePanel = `${shellFreeContainer} > .models-tab-panel--fill:not([hidden])`; | ||
| expect(effectiveDeclaration(baseStyles, shellFreePanel, "display")).toBe("block"); | ||
| expect(ruleBodies(baseStyles, shellFreePanel)[0]).toMatch(/padding-inline:\s*36px/); | ||
| expect(effectiveDeclaration(baseStyles, shellFreePanel, "padding-inline")).toBe("0"); | ||
|
|
||
| for (const selector of [ | ||
| `${shellFreeContainer} > .page-head`, | ||
| `${shellFreeContainer} > .page-tabs`, | ||
| `${shellFreeContainer} > .page-sub`, | ||
| ]) { | ||
| expect(effectiveDeclaration(baseStyles, selector, "padding-inline")).toBe("0"); | ||
| } | ||
| expect(effectiveDeclaration(baseStyles, `${shellFreeContainer} > .page-tabs`, "margin-inline")).toBe("0"); | ||
|
|
||
| // Every Models workspace tab uses the same column width, including loading/error states | ||
| // where the panel content itself may not have mounted yet. | ||
| for (const selector of [ | ||
| ".main-inner:has(#models-panel-catalog:not([hidden]))", | ||
| ".main-inner:has(#models-panel-routing:not([hidden]))", | ||
| ]) { | ||
| expect(effectiveDeclaration(workspaceStyles, selector, "max-width")).toBe("1200px"); | ||
| } | ||
| expect(effectiveDeclaration( | ||
| compatibilityStyles, | ||
| ".main-inner:has(#models-panel-compatibility:not([hidden]))", | ||
| "max-width", | ||
| )).toBe("1200px"); | ||
| }); |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
gui/tests/dashboard-tabs.test.tsruns, it locates the first literal.page-tabs {block in this stylesheet; placing this scoped selector before the base.page-tabsrule makes the test inspect this margin-only block and fail becauseflex-wrap: wrapis absent. Move this scoped declaration below the base rule or update the source-contract test to match the exact selector so the required GUI test gate passes.AGENTS.md reference: gui/AGENTS.md:L46-L50
Useful? React with 👍 / 👎.