Skip to content

feat(ui): update homepage hero to execution-layer framing (#100)#263

Merged
ezedike-evan merged 3 commits into
ezedike-evan:mainfrom
collinsezedike:feat/100-homepage-hero-copy
Jun 1, 2026
Merged

feat(ui): update homepage hero to execution-layer framing (#100)#263
ezedike-evan merged 3 commits into
ezedike-evan:mainfrom
collinsezedike:feat/100-homepage-hero-copy

Conversation

@collinsezedike
Copy link
Copy Markdown
Contributor

Summary

  • Badge: "Built on Stellar" → "Stellar Execution Layer"
  • H1: "Find the best rates on Stellar, in real time." → "Where stablecoin transactions happen on Stellar."
  • Subcopy: now references "execution layer for cross-border stablecoin flows" instead of compare-first framing
  • Module section heading: "Choose a comparator" → "Start transacting"
  • Off-ramp card description: "Compare USDC withdrawal rates…" → "Execute USDC off-ramps…"
  • Adds tests/components/HomePage.test.tsx with 4 tests (hero copy, subcopy, CTA link, snapshot)

Test plan

  • Verify hero heading reads "Where stablecoin transactions happen on Stellar."
  • Verify subcopy contains "execution layer for cross-border stablecoin flows"
  • Off-ramp card still links to /offramp and is the sole CTA
  • npx vitest run tests/components/HomePage.test.tsx — 4 tests pass

Closes #100

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@collinsezedike is attempting to deploy a commit to the ezedikeevan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@collinsezedike Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Comment thread tests/freighter-detect.spec.tsx Fixed
Copy link
Copy Markdown
Owner

@ezedike-evan ezedike-evan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hero copy changes for app/page.tsx are exactly right and the four tests in HomePage.test.tsx are well written. But this PR bundles significant scope that wasn't asked for in #100, and some of that extra scope has real correctness issues. This can't merge as-is.


1. PR scope far exceeds issue #100 — blocking

Issue #100 says: "Estimated File Changes: 1 (app/page.tsx)". The PR touches 11 files and introduces:

  • A new lib/session.ts module (JWT nonce/sessionStorage utilities)
  • A full refactor of WalletContext.tsx (WatchWalletChanges lazy-import + polling fallback)
  • A near-complete rewrite of hooks/useFreighter.ts (two-phase polling + event listeners)
  • A mainnet network guard in RateTable.tsx and app/offramp/page.tsx
  • URL-based tracking state rehydration in app/offramp/page.tsx

These changes are individually meaningful but they are not what #100 asks for. They belong in their own PRs, each linked to their own issues, with their own descriptions and test plans. Please split accordingly:

  • Keep app/page.tsx + tests/components/HomePage.test.tsx + snapshot in this PR.
  • Open a separate PR for the session / URL-rehydration work (lib/session.ts + offramp page changes).
  • Open a separate PR for the WalletContext / useFreighter refactor.
  • Open a separate PR for the mainnet guard in RateTable.

2. useFreighter.ts rewrite has a dangling onVisibilityDetect listener — correctness bug

function onVisibilityDetect() {
  if (!cancelled) void detect()
}
// ...
earlyTimeoutId = setTimeout(() => {
  // ...
  window.addEventListener('focus', onVisibilityDetect)
  document.addEventListener('visibilitychange', onVisibilityDetect)
}, EARLY_POLL_DURATION_MS)

The cleanup function runs window.removeEventListener('focus', onVisibilityDetect) unconditionally. But the listeners are only registered inside the timeout callback, which may not have fired yet when the component unmounts (e.g. during SSR test or fast navigation). That's fine in that direction. The real bug: if the component unmounts after the timeout fires, cancelled = true is set, but onVisibilityDetect still holds a reference to the outer scope's cancelled variable and correctly checks it — so no state update occurs. This is actually OK. However, the earlyTimeoutId is cleared but if the timeout has already fired, that clearTimeout is a no-op and the event listeners remain attached until the next mount/unmount, which can't remove them because the function reference is lost (the onVisibilityDetect is a closure created in the previous effect invocation). The event listeners will leak across re-mounts unless the reference is stable. Move onVisibilityDetect outside the useEffect or capture the reference in a ref so the cleanup can remove the correct instance.


3. lib/session.ts JWT stored in sessionStorage without any expiry — security concern

The JWT written by saveJwtToSession is keyed only by nonce and has no TTL. If the anchor JWT has a 24-hour validity and the user leaves the tab open, a stale JWT could be replayed. Consider writing the expiry timestamp alongside the JWT and rejecting it in loadJwtFromSession if expired. At a minimum, document the non-expiry as a known limitation in a comment.


4. Missing CHANGELOG.md entry for the hero copy change

The checklist box for user-facing behaviour → CHANGELOG is unchecked. A hero copy update is user-visible; it needs an [Unreleased] entry.


5. Checklist mostly unchecked

Please complete the checklist for the items that are in scope for this PR.


To summarise: the app/page.tsx copy + HomePage tests are ready to merge as soon as they're in a clean, focused PR. Please split the out-of-scope changes into separate PRs and re-open this one with only the copy work.

@collinsezedike collinsezedike force-pushed the feat/100-homepage-hero-copy branch from 27a69cc to 3755227 Compare June 1, 2026 16:30
Copy link
Copy Markdown
Owner

@ezedike-evan ezedike-evan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sprint re-review — changes requested

1. Merge conflict — mergeable: CONFLICTING (must fix before anything else)

The branch feat/100-homepage-hero-copy is conflicting with main. This PR cannot be merged until the author rebases onto the current main and resolves all conflicts. Run:

```
git fetch origin
git rebase origin/main

resolve conflicts, then:

git push --force-with-lease
```

Note from last sprint: the previous review flagged scope concerns about the 10 extra files that were outside the 1-file scope of this issue. This PR has since been narrowed down to 4 files (app/page.tsx, CHANGELOG.md, tests/components/HomePage.test.tsx, and the snapshot) which is a clean, focused scope — that issue is resolved.

2. "Linked issue" template section left as Closes # with no issue number

The PR body contains the raw template placeholder:

Closes #

The top-of-body line correctly says Closes #100, but the "Linked issue" section inside the template body was not filled in (it still reads Closes #). Remove or complete that section to avoid ambiguity.

3. Snapshot committed to the repo

tests/components/__snapshots__/HomePage.test.tsx.snap (224 lines) is committed into version control. Vitest/Jest snapshots are typically gitignored or treated as automatically regenerated artefacts. Check .gitignore — if snapshots are not listed there, add the tests/components/__snapshots__/ directory. If the team intentionally tracks them, leave as-is, but be aware that any future page.tsx change will require a snapshot update commit.

Fix the rebase conflict first; the other two items can be addressed in the same push.

@collinsezedike collinsezedike force-pushed the feat/100-homepage-hero-copy branch from 3755227 to 4ed48e4 Compare June 1, 2026 17:12
@ezedike-evan ezedike-evan merged commit ebbdf45 into ezedike-evan:main Jun 1, 2026
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.

[#052] homepage hero copy update

3 participants