Skip to content

feat: animate hero collapse, hide search controls on non-home routes (#615 follow-up)#617

Merged
rdmueller merged 1 commit into
LLM-Coding:mainfrom
raifdmueller:feat/615-hero-animation
Jun 12, 2026
Merged

feat: animate hero collapse, hide search controls on non-home routes (#615 follow-up)#617
rdmueller merged 1 commit into
LLM-Coding:mainfrom
raifdmueller:feat/615-hero-animation

Conversation

@raifdmueller

@raifdmueller raifdmueller commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Two refinements on the merged #616, from user testing:

1. Animated hero collapse

The hero vanished abruptly (display: none cannot transition). It now collapses via a grid-template-rows: 1fr → 0fr transition (300 ms, together with opacity and margin) and slides back on clearing the query. visibility flips after the transition so the collapsed hero's links leave the tab order; prefers-reduced-motion disables the animation. Measured mid-transition via Playwright: 547 px → 141 px → 0 px and cleanly back to 547 px.

2. Direction change: hide search controls off-home

Instead of jumping to the home page, the search controls now disappear entirely on non-home routes — the search input, role filter, and anchor counter form one #header-catalog-controls row toggled by the existing route:changed listener. The jump-to-home code from #616 is removed; a query left in the input still re-applies when returning to the catalog.

Verification

  • 115/115 unit tests (hero tests updated to the class-based collapse), 38/38 E2E (controls hidden on /about/, visible on /)
  • Playwright on the built preview: smooth collapse/restore measured, hero layout unchanged, static no-JS home unaffected
  • App version 0.8.0 → 0.8.1

Refs #615

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Sanfte Hero-Kollaps-Animation (300ms) beim Aktivieren der Suche.
  • Bug Fixes

    • Suchsteuerelemente nur auf der Startseite sichtbar; auf anderen Routen ausgeblendet.
    • Unterstützung für prefers-reduced-motion implementiert.
  • Chores

    • App-Version auf 0.8.1 aktualisiert.

Two refinements on LLM-Coding#615 after user testing:

1. The hero disappeared abruptly (display:none). It now collapses via
   a grid-template-rows 1fr->0fr transition (300ms, with opacity and
   margin), restores the same way, flips visibility after the
   transition so collapsed hero links leave the tab order, and honors
   prefers-reduced-motion. Hero content gained an inner wrapper div
   for the 0fr clip; applyCardFilters toggles a .hero-collapsed class
   instead of inline display.

2. Direction change: instead of jumping to the home page, the search
   controls disappear entirely on non-home routes. The whole header
   row (search input, role filter, anchor counter) is one
   #header-catalog-controls container now, toggled by the existing
   route:changed listener; the jump-to-home code is removed. A query
   left in the input still re-applies when returning home.

Verified via Playwright on the built preview: hero height 547px ->
141px (mid-transition) -> 0px and back, visibility hidden when
collapsed, layout unchanged. 115/115 unit tests, 38/38 E2E.

App version 0.8.0 -> 0.8.1.

Refs LLM-Coding#615

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: d5eea380-cb78-4ea4-954f-f9bb22d2c51f

📥 Commits

Reviewing files that changed from the base of the PR and between 1f04053 and 4f47b97.

📒 Files selected for processing (8)
  • docs/changelog.adoc
  • website/src/components/card-grid.js
  • website/src/components/card-grid.test.js
  • website/src/components/header.js
  • website/src/components/main-content.js
  • website/src/main.js
  • website/src/styles/main.css
  • website/tests/e2e/website.spec.js

Walkthrough

Diese PR implementiert die Such-UX-Verbesserungen (#615): Die Hero-Section kollabiert sanft via CSS-Klasse hero-collapsed (anstatt display:none), mit einer 300ms-Animation und Unterstützung für prefers-reduced-motion. Header-Suchbox und Anker-Zähler werden nur auf der Home-Route angezeigt; die Suche auf anderen Routes navigiert nicht mehr automatisch zur Home-Route.

Changes

Search UX Hero Collapse and Route Visibility (#615)

Layer / File(s) Summary
Hero Collapse Markup and Filter Logic
website/src/components/main-content.js, website/src/components/card-grid.js
Die Hero-Section wird mit einer zusätzlichen wrapper <div> strukturiert. Die applyCardFilters() Logik wechselt von hero.style.display zu der CSS-Klasse hero-collapsed, um das Collapse-Verhalten zu steuern.
Hero Collapse Animation and Accessibility
website/src/styles/main.css
Neue CSS-Regeln für #hero und #hero.hero-collapsed implementieren die 300ms-Übergangsanimation mit grid-template-rows, opacity, margin-bottom und visibility. Die Animation wird bei prefers-reduced-motion: reduce deaktiviert.
Route-Based Control Visibility and Search Input
website/src/main.js, website/src/components/header.js
Der Route-Listener zeigt/versteckt header-catalog-controls nur auf der Home-Route (/). Die Suche im Header leitet nicht mehr automatisch zur Home-Route um, sondern synchronisiert und wendet Filter direkt an. Version wird auf 0.8.1 angehoben.
Tests and Documentation Updates
website/src/components/card-grid.test.js, website/tests/e2e/website.spec.js, docs/changelog.adoc
Unit-Tests validieren hero-collapsed Klasse statt style.display. E2E-Tests prüfen Sichtbarkeit des Such-Inputs auf Home vs. anderen Routes. Changelog dokumentiert das Collapse-Verhalten mit Animation und prefers-reduced-motion Support.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related issues

  • LLM-Coding/Semantic-Anchors#615: Die Hauptänderungen implementieren direkt die in diesem Issue beschriebene Search-UX mit Hero-Collapse, CSS-Animation, und Route-basierter Sichtbarkeit der Steuerelemente.

Possibly related PRs

  • LLM-Coding/Semantic-Anchors#462: Beide PRs ändern das Hero-Markup in website/src/components/main-content.js#462 strukturiert das Hero-Layout grundlegend um, während diese PR die Hero-Section mit einem zusätzlichen wrapper versieht, um das neue CSS-basierte Collapse-Verhalten zu unterstützen.
  • LLM-Coding/Semantic-Anchors#549: Beide PRs ändern applyCardFilters() in website/src/components/card-grid.js — diese PR ändert das Hero-Collapse-Verhalten bei aktiver Suche, während #549 den gleichen Filtering-Fluss erweitert, um Zähler in der kategoriefixierten Quick-Nav zu synchronisieren.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rdmueller rdmueller merged commit 6352f0b into LLM-Coding:main Jun 12, 2026
5 of 6 checks passed
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.

2 participants