Skip to content

[codex] Polish Rapid Grants page#2273

Merged
somepersonnamedjosh merged 1 commit into
masterfrom
codex/rapid-grants-polish
Apr 13, 2026
Merged

[codex] Polish Rapid Grants page#2273
somepersonnamedjosh merged 1 commit into
masterfrom
codex/rapid-grants-polish

Conversation

@somepersonnamedjosh

Copy link
Copy Markdown
Collaborator

Summary

  • rebalance the Rapid Grants hero so the desktop layout uses the space intentionally and matches the white program-page canvas
  • cap the funded projects grid to a two-row responsive preview and add a soft fade with a floating expand control
  • align copy and navigation labels around "funded projects" and keep the grants section tests in sync

Why

The Rapid Grants page had an awkward desktop dead zone in the hero, a mismatched cream background compared with the other program pages, and an abrupt full-length grantee list that felt unfinished. This makes the page feel more polished and easier to scan while keeping the full project list accessible.

Impact

  • cleaner visual hierarchy and less empty space in the hero
  • more delightful project browsing with a clearer collapsed/expanded interaction
  • more consistent CTA language between the hero and the funded projects section

Validation

  • npm run test:update -- GrantProgramHero GranteesListSection programs
  • npm run lint
  • npm run typecheck
  • npm run test
  • npm run build

@render render Bot temporarily deployed to codex/rapid-grants-polish - bluedot-preview PR #2273 April 13, 2026 10:27 Destroyed
@somepersonnamedjosh

Copy link
Copy Markdown
Collaborator Author

@claude review please!

@claude

claude Bot commented Apr 13, 2026

Copy link
Copy Markdown

Claude finished @somepersonnamedjosh's task —— View job


Code Review for Rapid Grants Polish

Reviewing the changes to polish the Rapid Grants page:

Todo List:

  • Read and analyze all changed files
  • Review GrantProgramHero.tsx changes for hero layout improvements
  • Review GranteesListSection.tsx changes for project grid capping and fade effects
  • Review test file updates for alignment with component changes
  • Review rapid-grants.tsx page changes for copy/navigation alignment
  • Assess code quality, TypeScript usage, and React patterns
  • Check for potential bugs or security issues
  • Provide comprehensive review feedback

Review Feedback

Overall Assessment:LGTM - This is a well-executed polish of the Rapid Grants page that successfully addresses the stated objectives. The code quality is high with good TypeScript usage, proper React patterns, and thoughtful UX improvements.

Key Improvements Delivered:

  • Hero Layout: New grid layout (lg:grid lg:grid-cols-[minmax(0,1.1fr)_minmax(320px,0.9fr)]) better utilizes desktop space
  • Background Consistency: Changed from cream to white background (bg-white) to match other program pages
  • Project Grid Enhancement: Added sophisticated preview/expand functionality with responsive row limiting and fade effect
  • Copy Alignment: Consistent "funded projects" terminology throughout

Detailed Analysis

GrantProgramHero.tsx (apps/website/src/components/grants/GrantProgramHero.tsx:71)

  • Excellent layout improvement: The new CSS Grid layout with fractional units creates better visual balance
  • Responsive design: Proper breakpoint handling with mobile-first approach
  • Accessibility maintained: All semantic structure preserved

GranteesListSection.tsx (apps/website/src/components/grants/GranteesListSection.tsx:74-147)

  • Smart preview logic: The previewRows prop with responsive column calculation is well-implemented
  • Elegant fade effect: The gradient overlay and floating expand button create a polished UX
  • Performance conscious: Window resize listener properly cleaned up in useEffect
  • State management: Clear separation between search, pagination, and preview states

Technical Excellence:

  • TypeScript: Proper typing throughout, including new previewRows?: number prop
  • React patterns: Correct hook usage, proper event handling, no anti-patterns
  • Performance: No unnecessary re-renders, efficient filtering logic
  • Accessibility: Proper ARIA labels maintained, keyboard navigation supported

rapid-grants.tsx (apps/website/src/pages/programs/rapid-grants.tsx:279)

  • Clean integration: The previewRows={2} prop usage is exactly right for the two-row preview
  • Copy consistency: All references now use "funded projects" terminology

Tests (apps/website/src/components/grants/GranteesListSection.test.tsx:38)

  • Updated correctly: Test reflects new terminology change from "grants made" to "funded projects"
  • Coverage maintained: All core functionality still tested

Code Quality Highlights

  1. Responsive Design Excellence: The viewport width tracking and responsive column calculation is sophisticated and handles edge cases well

  2. UX Polish: The fade-in/fade-out expand mechanism with the floating button is a delightful touch that improves discoverability

  3. State Management: Clean separation of concerns between search functionality and preview limiting

  4. Performance: Proper cleanup of event listeners and efficient re-rendering patterns

Minor Suggestions (Non-blocking)

  1. Consider memoization (apps/website/src/components/grants/GranteesListSection.tsx:127-132): The viewport-based column calculation could be memoized to avoid recalculation on every render
  2. CSS custom properties: The gradient values could potentially be extracted to CSS custom properties for easier theming

Security & Best Practices ✅

  • No security concerns identified
  • Proper HTML sanitization maintained
  • No hardcoded sensitive values
  • Follows React security best practices

Verdict: This PR successfully delivers on all stated objectives with excellent code quality. The polish improvements are thoughtful and enhance the user experience while maintaining technical excellence. Ready to merge! 🚀


@somepersonnamedjosh somepersonnamedjosh marked this pull request as ready for review April 13, 2026 10:29
@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request refactors the grants program display components to implement responsive layout changes. The GrantProgramHero component is restructured from a single-column layout to a two-column grid layout on large screens, with facts rendering in a right-side column. The GranteesListSection component introduces a new previewRows prop to control initial list visibility and implements responsive preview column calculations based on viewport width, replacing fixed limit logic. The "show more" interaction is redesigned as an overlay gradient button with dynamic text. Supporting changes update styling and button labels across the rapid grants program page.

Possibly related PRs

  • PR #2261: Modifies GranteesListSection component to adjust list visibility and pagination logic that directly impacts how grantees are displayed and toggled.
  • PR #2262: Updates the same grants and programs UI files (GrantProgramHero, GranteesListSection, and rapid-grants page) with overlapping layout and styling changes.
  • PR #2016: Introduces related grantee and listing component structures that are now being modified through the GranteesListSection component updates in this change.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The pull request description provides clear context on what was changed and why, but lacks required sections from the repository template such as Issue link, Developer checklist items, and Screenshots for visual changes. Add the missing template sections: link an Issue (or project) under the Issue section, complete the Developer checklist, and provide Before/After screenshots showing the visual changes to the hero layout and grantees list.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title '[codex] Polish Rapid Grants page' directly describes the main objective of the pull request, which is to improve the visual design and usability of the Rapid Grants page.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/rapid-grants-polish

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.

@greptile-apps

greptile-apps Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR polishes the Rapid Grants page: the hero gets a white background and a two-column desktop layout with a facts panel, and GranteesListSection gains a previewRows prop that caps the initial grid to a set number of rows (viewport-responsive) with a soft fade overlay and expand/collapse button. Copy and anchor labels are aligned around "funded projects" throughout.

Confidence Score: 5/5

Safe to merge; all findings are P2 style suggestions with no logic or data-integrity issues.

The three findings are non-blocking: a redundant effect call, a missing scroll offset on a secondary navigation path, and an untested new prop. None affect correctness of the primary user flows or data handling.

apps/website/src/pages/programs/rapid-grants.tsx — scroll-mt-28 placement; apps/website/src/components/grants/GranteesListSection.test.tsx — previewRows coverage

Important Files Changed

Filename Overview
apps/website/src/components/grants/GranteesListSection.tsx New previewRows prop with viewport-aware column calculation drives expand/collapse logic; redundant handleResize() call in useEffect; SSR default of 1120 is correctly guarded.
apps/website/src/components/grants/GranteesListSection.test.tsx Tests expand/collapse via limit prop but doesn't cover the new previewRows responsive column logic; existing assertions remain valid.
apps/website/src/pages/programs/rapid-grants.tsx Uses id="grants-made" on an outer wrapper div rather than the GranteesListSection's own section element, making the scroll-mt-28 offset ineffective for direct anchor navigation.
apps/website/src/components/grants/GrantProgramHero.tsx Background changed from cream to white; two-column desktop grid with facts panel added; responsive layout looks correct and matches other program pages.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([GranteesListSection mounts]) --> B{previewRows set?}
    B -- Yes --> C[previewLimit = previewRows x previewColumns based on viewportWidth]
    B -- No --> D[previewLimit = undefined]
    C --> E[effectiveLimit = previewLimit]
    D --> F{limit prop set?}
    F -- Yes --> G[effectiveLimit = limit]
    F -- No --> H[effectiveLimit = undefined]
    E --> I{shouldLimitResults?}
    G --> I
    H --> I
    I -- Yes --> J[visibleGrantees = slice 0..effectiveLimit, showCollapsedPreview = true]
    I -- No --> K[visibleGrantees = all filteredGrantees]
    J --> L[Render grid + fade overlay + expand button]
    K --> M[Render full grid]
    L --> N{User clicks expand}
    N --> O[setShowAll true]
    O --> K
    M --> P{showAll and hasHiddenGrantees?}
    P -- Yes --> Q[Render collapse button]
    Q --> R{User clicks collapse}
    R --> S[setShowAll false]
    S --> I
Loading

Comments Outside Diff (1)

  1. apps/website/src/components/grants/GranteesListSection.test.tsx, line 36-40 (link)

    P2 New previewRows behavior not covered by tests

    The test still exercises expand/collapse through the limit prop. The new previewRows path — which multiplies rows by a viewport-derived column count — isn't tested at all. Consider adding a test case that passes previewRows and verifies that the correct number of items is shown before and after expansion.

    Rule Used: Consider adding tests for any new functionality in... (source)

    Learnt From
    bluedotimpact/bluedot#956
    bluedotimpact/bluedot#969
    bluedotimpact/bluedot#958

Reviews (1): Last reviewed commit: "Polish Rapid Grants page" | Re-trigger Greptile

Comment on lines +95 to +106
useEffect(() => {
const handleResize = () => {
setViewportWidth(window.innerWidth);
};

handleResize();
window.addEventListener('resize', handleResize);

return () => {
window.removeEventListener('resize', handleResize);
};
}, []);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Redundant handleResize() call in effect

The useState lazy initializer on line 87–93 already reads window.innerWidth on the client, so the immediate handleResize() call inside useEffect (line 100) just sets the same value again. It can be removed without any behavioural change.

Suggested change
useEffect(() => {
const handleResize = () => {
setViewportWidth(window.innerWidth);
};
handleResize();
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}, []);
useEffect(() => {
const handleResize = () => {
setViewportWidth(window.innerWidth);
};
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}, []);

Comment on lines 277 to 281
<div id="grants-made">
<GrantPageSection title="Projects we have funded">
<GranteesListSection />
<GranteesListSection previewRows={2} />
</GrantPageSection>
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 scroll-mt-28 offset unreachable via direct URL navigation

id="grants-made" is on this outer <div>, but scroll-mt-28 is applied to the <section> element inside GranteesListSection. Browser native scroll-to-anchor targets the <div>, which carries no offset, so the sticky nav will overlap the section title when a user follows a #grants-made URL directly. The scrollToGrantees custom function compensates via navOffset = 96, so the hero CTA path is fine — but the gap remains for bare hash navigation.

Either pass id="grants-made" to GranteesListSection (which already has scroll-mt-28 on its section) and drop the outer wrapper, or add scroll-mt-28 to this <div>:

Suggested change
<div id="grants-made">
<GrantPageSection title="Projects we have funded">
<GranteesListSection />
<GranteesListSection previewRows={2} />
</GrantPageSection>
</div>
<div id="grants-made" className="scroll-mt-28">

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.

1 participant