feat(propdates): collapse long milestone reports with a Read-more toggle - #994
feat(propdates): collapse long milestone reports with a Read-more toggle#994sktbrd wants to merge 1 commit into
Conversation
The propdates feed rendered every update full-height, so a few long milestone reports buried everything below them. Mirror the About-page DaoDescription pattern: measure the rendered message and, only when it overflows a collapsed height (240px), clamp it with a soft fade (tuned to the card background2) and a 'Read full update →' / 'Show less' toggle. Short updates render unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@sktbrd is attempting to deploy a commit to the Nouns Builder Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughPropDate cards now detect overflowing messages, clamp them to a fixed height, apply a fade overlay, and provide an accessible control to expand or collapse the message. Overflow is recalculated after content and size changes. ChangesPropDate message expansion
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/proposal-ui/src/components/PropDates/PropDateCard.css.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. packages/proposal-ui/src/components/PropDates/PropDateCard.tsxESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. 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. Comment |
Description
The propdates feed rendered every update at full height, so a couple of long milestone reports buried everything below them. This clamps long propdate messages to a collapsed height with a soft fade and a "Read full update →" / "Show less" toggle — the feed stays scannable, and short updates render unchanged.
Mirrors the existing About-page
DaoDescription"Read More" pattern (same measure-then-clamp approach,ResizeObserver,aria-expanded/aria-controls) so the interaction feels native. The fade gradient is tuned to the card message'sbackground2token.Before / after
Collapsed feed — long milestone propdates now fit on one screen, each with a fade + toggle:
Expanded in place ("Show less" to recollapse):
Implementation
PropDateCard.tsx— measure the rendered message viaResizeObserver; only clamp + show the toggle when it overflows the collapsed height (240px). Defaults collapsed; resets when the message changes.PropDateCard.css.ts(new) — collapsed-height constant + fade-out gradient tuned tobackground2.Notes
scrollHeight), so no unit test — jsdom performs no layout, which would make such a test hollow. Verified on a live preview deploy (screenshots above).type-checkandlintare clean forpackages/proposal-ui.Bonus contribution from the Gnars team, alongside Prop 61 Milestone 3.
Summary by CodeRabbit