You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): let the Featured hero grow when its title wraps - #3984
Closes#2979
Related issue: N/A
Validation tasks: none
On the web home page and a library's Recommended tab, a Featured title that wraps to three or four lines no longer fits in the hero at short window heights such as 1280×720, 1366×768 or 844×390 landscape. The hero had a fixed height with its text anchored to the bottom, so the extra lines pushed the "Featured — No. 01" eyebrow and the top of the title out of the hero's top edge: clipped on Home, and hidden under the header on Recommended. This change lets the hero grow taller instead, so the eyebrow and the whole title stay visible.
Since this branch was opened, #3995 removed the eyebrow from main. The branch now includes that change, so the title is the top of the text block. The fix still applies: a long title still overflowed the hero's top edge before this change.
Approach
HERO_BANNER_SIZE and HERO_BANNER_SIZE_TALL are now minimum heights, using the same clamp() values as the old fixed height, minimum and maximum. The text block fills the hero through flex instead of h-full, so it still sits at the bottom when it fits and makes the hero taller when it does not. Home's hero text also gets 64 px of top padding, so a grown hero keeps the eyebrow off the top edge and, on phones, clear of the slide counter. Recommended already reserves space for its header. The Home error placeholder, which shares the size constant, gets the same flex layout so its text stays at the bottom.
This is the "let the hero grow with its content" option from the issue. The other options, capping the title's lines or size on short screens, would cut off or shrink the title instead.
Validation
Local build of this branch with the production web bundle, one synthetic movie with a 61-character title and one with a short title, checked in headless Chromium at 1280×720, 1366×768, 844×390, 1440×900 and 390×844 on Home and Recommended.
Long title, before: eyebrow 120 px above the hero's top edge on Home at 1280×720 and 76 px above it on Recommended; also clipped at 1366×768 and 844×390.
Long title, after: eyebrow 64 px inside the top edge on Home and 32 px below the header on Recommended at every size.
Short title, after: hero heights are the same as before at every size.
At 390 px phone width the eyebrow is hidden by design and the title was not clipped before or after.
pnpm run lint, pnpm run format:check, pnpm run build, pnpm run budget:check, make test-web: pass.
make verify-local-paths, verify-bidi, verify-case-collisions, verify-size-ratchet: pass. The Go checks were not run because no Go code changed.
No test added: the change is layout only, and CONTRIBUTING.md says not to test layout.
Surface and build: web app on Home and a library's Recommended tab, with desktop (1440 px), phone (390 px) and the short heights from the issue. Built from this branch and its base.
Risks
When the slides in one hero have different title lengths, the hero can change height from one slide to the next at short window heights, which moves the rows below it. This only happens when a slide's text would have been clipped before, or nearly so. Autoplay stops while the hero is off screen and with reduced motion on. Capping the title instead would avoid the shift but cut off titles.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or says there is none.
AI Disclosure
Harness: Claude Code (via T3 Code); Codex CLI for code review
Tool(s): Claude Code, Codex CLI, Playwright (headless Chromium), GitHub CLI
Adversarial review: independent reviews by claude-opus-5-5 and gpt-6.1-sol of the final diff for correctness, repository standards, and the issue's requirements. GPT found nothing. Opus raised two low-severity notes and no changes were made for them. First, the hero changes height between slides with different title lengths. This is the trade-off described under Risks. Second, the 64 px top padding on Home makes the hero grow a little for titles that nearly filled it before. That spacing is intentional, so the eyebrow does not sit flush against the top edge.
Note
Fix Featured hero to grow instead of clipping when its title wraps
Changes HERO_BANNER_SIZE and HERO_BANNER_SIZE_TALL in design-system.ts from fixed-height classes to responsive minimum heights using CSS clamp values, so the hero grows to fit content.
Reworks the HeroBanner section in HeroBanner.tsx into a flex column so the bottom-anchored content wrapper fills available space and expands when the wrapped title needs more room.
Applies the same flex layout to the hero error container in Home.tsx.
Updates the comment in HeroOverviewText.tsx to note the overview text stays clamped to avoid slide-to-slide height changes.
Behavioral Change: the hero's configured height is now a minimum; all consumers of HERO_BANNER_SIZE and HERO_BANNER_SIZE_TALL get taller heroes when content exceeds the clamped minimum.
On short viewports a title that wraps to several lines made the hero's
bottom-anchored text taller than its fixed height, so the eyebrow and the
top of the title were cut off on Home and slid under the header on a
library's Recommended tab. The hero sizes are now minimum heights, and the
text block fills the hero with flex instead of h-full, so a tall block
makes the hero taller. Home's hero content gets top padding so the eyebrow
keeps clear of the top edge when that happens.
Hero sizing now uses clamped minimum heights instead of fixed viewport heights. The hero and Home error-state layouts use column flex containers and flexible content areas. Hero content receives top padding by default, with larger responsive padding when reserveHeaderSpace is enabled.
The regular and tall hero size constants use clamped minimum heights. The overview text comment describes the hero growing when content exceeds its minimum height.
The hero section and Home error-state container use column flex layouts. Their content areas grow flexibly. Hero content always receives top padding, with larger responsive values when reserveHeaderSpace is enabled.
On mobile Recommended pages, a very long title can start at the same height as the slide counter and pause button, so the button can cover the first title line. Other hero layouts are unaffected. A small padding adjustment is worth making before merge, but the problem is cosmetic and limited to a narrow case.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the Featured hero now grows when its title wraps, which matches the raw summary (HERO_BANNER_SIZE clamp minimum heights, flex text block) and the PR objectives. It use…
Linked Issues check
Issue #2979 requires the Featured eyebrow and full title to stay visible on Home and on a library's Recommended tab when the title wraps at short viewport heights. The diff implements the grow-with-co…
Out of Scope Changes check
All changed hunks serve the hero sizing and layout fix for #2979: the size constants in design-system.ts, the HeroBanner section and content classes and comment, the Home error placeholder layout, and…
Description check
The description is related to the changeset. It explains that a Featured hero title wrapping to several lines was clipped at short window heights on the Home page and a library's Recommended tab. It s…
Full details: Title check
Explanation
The title names the main change: the Featured hero now grows when its title wraps, which matches the raw summary (HERO_BANNER_SIZE clamp minimum heights, flex text block) and the PR objectives. It uses the conventional fix(web) prefix and is 57 characters, so it is concise and specific.
Full details: Linked Issues check
Explanation
Issue #2979 requires the Featured eyebrow and full title to stay visible on Home and on a library's Recommended tab when the title wraps at short viewport heights. The diff implements the grow-with-content option the issue lists. In web/src/lib/design-system.ts, HERO_BANNER_SIZE and HERO_BANNER_SIZE_TALL change from fixed heights (h-[...]) to min-h-[clamp(...)] values with the same minimum, preferred, and maximum values. In web/src/components/HeroBanner.tsx, the section becomes a flex column and the content wrapper uses flex-1 instead of h-full, so the text block grows the hero when it does not fit. The content wrapper also has top padding: pt-16 when reserveHeaderSpace is off, which covers Home, and the existing responsive pt-24/sm:pt-28/lg:pt-32 when it is on, which covers Recommended. Home's error placeholder in web/src/pages/Home.tsx gets the same flex layout. The PR's measurements are reported in its Evidence section and were not re-run here. The issue's coding requirement is met by the source changes. No automated test was added, and the issue does not require one. Apple and Android heroes are outside the issue's scope.
Full details: Out of Scope Changes check
Explanation
All changed hunks serve the hero sizing and layout fix for #2979: the size constants in design-system.ts, the HeroBanner section and content classes and comment, the Home error placeholder layout, and the HeroOverviewText documentation comment that describes the new sizing. The HeroOverviewText change is comment-only, and the commit message summary says the documentation follows the change to minimum height. One point is not fully verified: the new pt-16 applies to every HeroBanner rendered without reserveHeaderSpace, not only Home. The PR describes this as Home-only. The diff alone does not show the other callers, so this was not checked. No change was found that is demonstrably unrelated to the issue.
Full details: Description check
Explanation
The description is related to the changeset. It explains that a Featured hero title wrapping to several lines was clipped at short window heights on the Home page and a library's Recommended tab. It states that HERO_BANNER_SIZE and HERO_BANNER_SIZE_TALL became minimum heights using clamp(), that the text block uses flex layout, that Home's hero text gets 64 px of top padding, and that the Home error placeholder receives the same flex layout. It also lists validation steps, the risks, and the reasons for the approach. These match the raw summary of changes in HeroBanner.tsx, HeroOverviewText.tsx, design-system.ts, and Home.tsx.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
Mobile library slide controls overlap tall hero titles
On the library Recommended tab below sm, tall titles overlap the slide counter and pause button. Increase the mobile top padding when reserveHeaderSpace is enabled.
Prompt for LLM
File web/src/components/HeroBanner.tsx, line 422:
Mobile library slide controls overlap tall hero titles
On the library Recommended tab below `sm`, a tall title starts at `pt-24`, exactly where the slide counter and pause button are positioned, so they overlap the title when the hero grows. Add enough top padding to clear the mobile counter when `reserveHeaderSpace` is enabled.
Suggested code:
reserveHeaderSpace ? "pt-36 sm:pt-28 lg:pt-32" : "pt-16"
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code via T3 Code (claude-opus-5-5)
The overlap can happen, but this PR does not cause it. Below sm on Recommended, the counter sits 96–124 px from the top and the text block has 96 px of top padding. The PR changes neither. The title only reaches that band when the text block is taller than the space left in the hero: about 370 px at 390×844, which is the 506 px minimum height minus 96 px top and 40 px bottom padding. Filling that takes roughly a five-line text-4xl title plus a two-line overview. On main, the same content overflows upward past 96 px and ends up under both the counter and the header, so this PR improves the case.
pt-36 would clear the counter, but it shrinks the phone content area by 48 px. Common four-line titles would then grow the phone hero too. I have left that trade-off for the maintainers to decide and am leaving this thread open.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking the existing behavior. If the same content overlaps the controls on main, this is a pre-existing issue, not a regression introduced by this PR. The change improves the overflow case, though it does not fully resolve the mobile overlap.
The pt-36 suggestion would clear the controls but could also make the hero grow for shorter titles, so I agree that it’s a product trade-off rather than an obvious required fix for this PR. Leaving the thread open for maintainers to decide is reasonable.
The reason will be displayed to describe this comment to others. Learn more.
🤖 Claude Code via T3 Code (claude-opus-5-5)
One low-severity finding, inline. The layout change itself holds up: every other child of the hero is absolutely positioned, so the flex column only sizes the text block, and the skeletons and error placeholder that share the size constants keep their heights.
Main removed the hero eyebrow, and the hero no longer has a fixed height,
so the comments explaining its padding and the overview clamp now refer to
the title and the minimum height.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewed head: 71f13c9, which is cb6d0fa with main merged in plus one comment-only commit.
Fit: 9/10 · Readiness: 8/10 — conditional (assuming CI is green)
Fit: the PR fixes a visible defect on the home screen. It takes the option from #2979 that keeps every title readable instead of cutting it off or shrinking it, and it adds no setting or new code path.
Readiness: the approach is sound and the diff is small. The hero's other children are all absolutely positioned, so the flex column only sizes the text block. The skeletons and the error placeholder that share the size constants keep their old heights. It is not marked ready for two reasons:
Phone counter on Recommended (Kody's thread): below sm, a title long enough to grow the hero reaches the band where the slide counter sits, 96–124 px from the top. This PR does not cause the overlap: on main the same content overflows higher and also sits under the header. pt-36 below sm would clear the counter, but common four-line titles would then grow the phone hero as well. It is a trade-off rather than a defect, so it stays open.
Tests
The PR adds no tests, which matches the "Decide what to test" rule for layout-only changes. After the merge, Prettier, ESLint, and the HeroBanner, HeroOverview and Home vitest files pass. I did not repeat the browser measurements. Validation of the behavior rests on the PR's evidence page.
Validated features
The project board query was unavailable to this review. I found no hero or Featured case in the web validation tasks for curated home sections (#1142) or AI translation (#1215).
Other checks
User manual: unaffected. The Home sections page does not describe the hero's size.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 429c910f-f263-4005-8439-0636cddf0d97
Commits
Reviewing files that changed from the base of the PR and between 8dadc2c and 71f13c9.
Files selected for processing: 4
web/src/components/HeroBanner.tsx
web/src/components/HeroOverviewText.tsx
web/src/lib/design-system.ts
web/src/pages/Home.tsx
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Keep the mobile counter above the title.
On Recommended below sm, a long title can grow the hero until the content starts at pt-24. The slide counter also starts at top-24, so it can cover the first title line and obscure the pause control. Reserve additional space for the counter when reserveHeaderSpace is set.
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
bugSomething isn't workingjavascriptPull requests that update javascript codesize/S0–49 added + deleted lines (all files); change volume, not priority.
2 participants
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.
Problem
Closes #2979
Related issue: N/A
Validation tasks: none
On the web home page and a library's Recommended tab, a Featured title that wraps to three or four lines no longer fits in the hero at short window heights such as 1280×720, 1366×768 or 844×390 landscape. The hero had a fixed height with its text anchored to the bottom, so the extra lines pushed the "Featured — No. 01" eyebrow and the top of the title out of the hero's top edge: clipped on Home, and hidden under the header on Recommended. This change lets the hero grow taller instead, so the eyebrow and the whole title stay visible.
Since this branch was opened, #3995 removed the eyebrow from main. The branch now includes that change, so the title is the top of the text block. The fix still applies: a long title still overflowed the hero's top edge before this change.
Approach
HERO_BANNER_SIZEandHERO_BANNER_SIZE_TALLare now minimum heights, using the sameclamp()values as the old fixed height, minimum and maximum. The text block fills the hero through flex instead ofh-full, so it still sits at the bottom when it fits and makes the hero taller when it does not. Home's hero text also gets 64 px of top padding, so a grown hero keeps the eyebrow off the top edge and, on phones, clear of the slide counter. Recommended already reserves space for its header. The Home error placeholder, which shares the size constant, gets the same flex layout so its text stays at the bottom.This is the "let the hero grow with its content" option from the issue. The other options, capping the title's lines or size on short screens, would cut off or shrink the title instead.
Validation
pnpm run lint,pnpm run format:check,pnpm run build,pnpm run budget:check,make test-web: pass.make verify-local-paths,verify-bidi,verify-case-collisions,verify-size-ratchet: pass. The Go checks were not run because no Go code changed.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3984/
Surface and build: web app on Home and a library's Recommended tab, with desktop (1440 px), phone (390 px) and the short heights from the issue. Built from this branch and its base.
Risks
When the slides in one hero have different title lengths, the hero can change height from one slide to the next at short window heights, which moves the rows below it. This only happens when a slide's text would have been clipped before, or nearly so. Autoplay stops while the hero is off screen and with reduced motion on. Capping the title instead would avoid the shift but cut off titles.
Checklist
AI Disclosure
Note
Fix Featured hero to grow instead of clipping when its title wraps
HERO_BANNER_SIZEandHERO_BANNER_SIZE_TALLin design-system.ts from fixed-height classes to responsive minimum heights using CSS clamp values, so the hero grows to fit content.HeroBannersection in HeroBanner.tsx into a flex column so the bottom-anchored content wrapper fills available space and expands when the wrapped title needs more room.HERO_BANNER_SIZEandHERO_BANNER_SIZE_TALLget taller heroes when content exceeds the clamped minimum.Macroscope summarized 71f13c9.