Repository navigation
fix(desktop): skip approval small-print when reason repeats the badge label - #412
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
|
Thanks @TanmayNileshShinde, and welcome! Nice quick pick-up of #409. It now conflicts with main because #367 changed the same approval card files after you opened this, and GitHub won't run CI on a conflicting PR. I'm merging main into your branch for you, then testing it in the real app. I'll follow up with a review. |
|
Thanks @TanmayNileshShinde, nice clean fix! #367 and #404 changed the same files after you opened this, so I merged main into your branch. I also:
I tested it in the built app with a real engine: the free Subscribe card shows "Signs up" once, and the Delete account card shows "Deletes" once. The PR got locked by our CLA bot when I closed and reopened it to start CI. Sorry about that; it's unlocked now and #434 stops that from happening again. Merging once the CLA check re-runs. Thanks for the contribution! |
bd412fa
Summary
Skips the small-print reason line in
ApprovalCard.tsxwhenapproval.reasonmatches the badge label (risk.label) after trimming and case-insensitive comparison, avoiding duplicate lines such as[Signs up]badge followed by"Signs up"in the card body.Closes #409
Changes
approvalCardReasonindesktop/src/features/chat/approvalRisk.tsthat returnsnullwhenreasonmatchesbadgeLabel(trimmed, case-insensitive).approvalCardReasonindesktop/src/features/chat/ApprovalCard.tsxso the card falls back to its own line (meta.done using ...) or to nothing when the reason repeats the badge label.desktop/tests/approvalRisk.test.tsverifying identical and case/whitespace variations are skipped while distinct reasons are preserved.Verification
npm testindesktop/: all 69 unit tests passing.npm run typecheckindesktop/: passes with 0 errors.npm run buildindesktop/: builds cleanly with 0 errors.Summary by CodeRabbit