-
Notifications
You must be signed in to change notification settings - Fork 0
Rework landing page: copy, real tool screenshots, design system alignment #38
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
Changes from all commits
e75b53a
86bc3c4
9297f6e
dbc578c
bb0f4d3
18db3b2
4664a89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| 'use client'; | ||
|
|
||
| import { useEffect, useRef, useState, type ReactNode } from 'react'; | ||
|
|
||
| interface RevealSectionProps { | ||
| children: ReactNode; | ||
| className?: string; | ||
| } | ||
|
|
||
| /** | ||
| * Reveals once and stays revealed. Unobserving after the first match | ||
| * (instead of toggling visibility on every crossing) keeps the section | ||
| * from re-hiding if a user scrolls back up past it. | ||
| */ | ||
| export function RevealSection({ children, className }: RevealSectionProps) { | ||
| const ref = useRef<HTMLElement>(null); | ||
| const [visible, setVisible] = useState(false); | ||
|
|
||
| useEffect(() => { | ||
| const el = ref.current; | ||
| if (!el) return; | ||
| const observer = new IntersectionObserver( | ||
| ([entry]) => { | ||
| if (!entry) return; | ||
| // Also reveal if the element is already above the viewport (e.g. a | ||
| // hash link landed past it). Without this, content scrolled past | ||
| // before ever intersecting would stay permanently invisible. | ||
| if (entry.isIntersecting || entry.boundingClientRect.top < 0) { | ||
| setVisible(true); | ||
| observer.unobserve(el); | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| }, | ||
| { threshold: 0.15, rootMargin: '0px 0px -40px 0px' }, | ||
| ); | ||
| observer.observe(el); | ||
| return () => observer.disconnect(); | ||
| }, []); | ||
|
Comment on lines
+15
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift Add regression tests for the reveal behavior. Cover intersection, the above-viewport fallback, cleanup, and an empty observer entry list. As per coding guidelines, 🧰 Tools🪛 GitHub Actions: CI / 2_Quality Gates.txt[error] 28-28: Typecheck failed (tsc --noEmit). TS18048: 'entry' is possibly 'undefined'. 🪛 GitHub Actions: CI / Quality Gates[error] 28-28: TypeScript (tsc) error TS18048: 'entry' is possibly 'undefined'. 🪛 GitHub Check: Quality Gates[failure] 28-28: [failure] 28-28: 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
|
|
||
| return ( | ||
| <section ref={ref} className={`${className ?? ''}${visible ? ' is-visible' : ''}`}> | ||
| {children} | ||
| </section> | ||
| ); | ||
| } | ||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: projectamazonph/amph-v2
Length of output: 161
🏁 Script executed:
Repository: projectamazonph/amph-v2
Length of output: 1528
🏁 Script executed:
Repository: projectamazonph/amph-v2
Length of output: 8837
🏁 Script executed:
Repository: projectamazonph/amph-v2
Length of output: 38305
🏁 Script executed:
Repository: projectamazonph/amph-v2
Length of output: 11258
Add a focused test for the homepage simulator cards.
src/app/page.tsx:16-57The only current coverage here is the homepage smoke check intests/e2e/critical-path.spec.ts, which doesn’t assert theSIMULATORSdata or rendered cards.🤖 Prompt for AI Agents
Source: Coding guidelines