fix: give Provider and Profile cards a consistent height - #165
Merged
Conversation
Cards in the same grid row had visibly different bottom edges. Measured at 1280px before this change, DeepSeek and Moonshot sat side by side at 124px and 104px. Two independent variables fed that, and both are removed rather than papered over with align-items: stretch -- stretch only moves the whitespace inside the shorter card, and one card with eight bindings would have dragged its whole row to 185px. The Anthropic endpoint row now always occupies its slot, showing "Unsupported" when the endpoint is absent instead of not rendering. That was worth 20px, and stating the absence also answers a question the missing row previously left the user to infer from a gap. Agent chips cap at three and collapse into "+N", which was worth 36px with eight bound Agents and grew without bound: .card-users wraps and had no row limit, so height scaled with bindings. Three matches requiredByHint in internal/app/runtime.go, which already renders "A, B, C +2" for the same kind of list. The hidden names stay recoverable from the chip's title. The chips move into a shared CardUsers component because both pages had the same markup and both grids use the same rule, so a change to one had to reach the other or the pages would drift. The Profile card gets the cap for free. Verified at 700/1280/1900px: one, two and three columns, every card equal height, no row with mismatched heights, no card or page overflow. Checked in both locales, since the absent-endpoint label is translated.
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.
Closes #164.
What was wrong
Cards in the same grid row had visibly different bottom edges. Measured at 1280px before the change:
Two independent variables fed the height, and the worst realistic combination was 129px vs 185px — a 1.43× spread.
Why not
align-items: stretchSwitching the grid to
stretchdoes equalize the row, and I verified that ([124, 104, 124, 124]→[124, 124, 124, 124]). I did not take it, for two reasons:The two variables are removed instead, so the heights match without the grid having to force them. The existing
align-items: startand the comment defending it stay as they are, and remain correct.Change 1 — the Anthropic row always occupies its slot (worth 20px)
It previously rendered only when
anthropic_base_urlwas set, so an OpenAI-only Provider was one row shorter. It now shows不支持/Unsupportedin the tertiary colour.This has a second benefit beyond layout: the user could previously only infer "this Provider does not serve Anthropic" from a missing row. Now it says so.
Change 2 — Agent chips cap at three, then "+N" (worth 36px, and unbounded)
.card-userswraps with no row limit, so height scaled with the number of bindings — with eight configurable Agents that is a real case, not a hypothetical. Chips now cap at three with the rest collapsed:Three matches
requiredByHintininternal/app/runtime.go:246, which already renders"A, B, C +2"for the same kind of list. Reusing the existing convention seemed better than picking a second one. The hidden names stay recoverable from the chip'stitle.Both pages, one component
#164noted that.profile-listshares the grid rule with.provider-list. Both pages also had the same chip markup, so the chips move into a sharedCardUserscomponent rather than being fixed twice — otherwise the next change to the cap reaches one page and not the other. The Profile card gets the cap for free.Verification
Measured in the running app, not inferred from CSS:
No card overflows horizontally and the page has no horizontal scroll at 700px. Checked in both locales, since the absent-endpoint label is translated — English renders
Unsupportedand heights stay equal at 144px.go test ./...14 packages pass. Frontend: 346 tests across 44 files (4 new),tsc --noEmitclean, build clean, and all 6 Wails E2E specs pass.The new
CardUserstest asserts the chip count, not just the presence of the "+N" label — the cap is a layout constraint, and only counting the rendered chips catches a regression that keeps the label while uncapping the list.🤖 Generated with Claude Code