Truncate settlements list to latest five with expandable cutoff preview#8
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
ClementLSW
June 5, 2026 09:24
View session
✅ Deploy Preview for omoneypmoney ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the readability of the Group Detail “Settlements” section by showing only the 5 most recent settlements by default, while providing an explicit control to reveal older history plus a clipped preview of the next (6th) settlement when collapsed.
Changes:
- Split settlements into
recentSettlements(latest 5) andolderSettlements(the remainder), rendering recents by default. - Add an expandable cutoff control (“Show N older settlements” / “Hide…”) to toggle rendering of older settlements.
- Add a collapsed-state preview row for the first hidden settlement with a gradient fade to indicate additional content.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const [receiptUrls, setReceiptUrls] = useState({}) // expenseId → signed URL | ||
| const [memberAction, setMemberAction] = useState(null) // { type: 'remove'|'promote'|'demote', member } | ||
| const [showSettlements, setShowSettlements] = useState(false) | ||
| const [showOlderSettlements, setShowOlderSettlements] = useState(false) |
Comment on lines
+651
to
+656
| <button | ||
| onClick={() => setShowOlderSettlements(v => !v)} | ||
| className="w-full" | ||
| aria-expanded={showOlderSettlements} | ||
| aria-controls="older-settlements" | ||
| > |
Comment on lines
+664
to
+666
| <p className="text-xs font-display font-semibold text-osps-gray uppercase tracking-wider"> | ||
| {showOlderSettlements ? 'Hide older settlements' : `Show ${olderSettlements.length} older settlements`} | ||
| </p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Long settlement histories were fully rendered, making the transaction records section noisy and hard to scan. This change keeps the latest five records visible by default and moves older entries behind an explicit cutoff affordance with a partial sixth-row preview.
UI behavior: default recency window
groupSettlementsintorecentSettlements(first 5) andolderSettlements(remaining).Cutoff affordance for hidden history
Show N older settlements/Hide older settlements).Sixth-record visual preview