Repository navigation
fix(web): third dogfood pass on sign-out note, invite undo, payment edit rule - #43
Merged
Merged
Conversation
When the periodic check found the session gone, auth-js had already dropped the stored session inside getUser, so endEndedSession saw nothing to sign out and never left the note. confirmSession now leaves it as soon as the check says the session is missing (session_not_found, user_not_found, session_ended), before any sign out, and the sign-in page listens for a note that lands after it opened. Co-authored-by: Ferrin <[email protected]> Co-authored-by: noorelmosrati <[email protected]>
The sheet makes the page behind it inert, so tapping the toast's Undo only closed the sheet, and keyboard users could not reach it. The revoked link now leaves its "Invite revoked" line with an Undo button in its place, focus on Undo, and the toast only shows once the panel goes away. Co-authored-by: Ferrin <[email protected]> Co-authored-by: noorelmosrati <[email protected]>
Under "You" the split card read "owes" and "gets back", and the other languages used third person for paid and got too. The viewer's row now has its own strings in all five languages. "You blocked Dee and Gus, so you two cannot share an expense" counted wrong. The note no longer assumes one person, in every language. Co-authored-by: Ferrin <[email protected]> Co-authored-by: noorelmosrati <[email protected]>
After a lost reply the debts refetch and may already count the payment, so "You owe Ava 20" sat above a held 30, which read like paying too much. While the form is held it shows the debt it was sent against, the same snapshot the settled screen uses. Co-authored-by: Ferrin <[email protected]> Co-authored-by: noorelmosrati <[email protected]>
/payments/:id/edit opened for someone the payment page shows no Edit to (the blocked side of a tab, on a payment the other person recorded) and only failed on Save. mayEditPayment is now the one rule for the button and the route, which sends them back to the payment instead. Co-authored-by: Ferrin <[email protected]> Co-authored-by: noorelmosrati <[email protected]>
Co-authored-by: Ferrin <[email protected]> Co-authored-by: noorelmosrati <[email protected]>
musa-kal
force-pushed
the
fix/dogfood-3
branch
from
November 16, 2026 17:33
f03985b to
b764d11
Compare
This branch was successfully deployed
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.
Intent
Fixes from the third dogfood check:
No server changes. Must keep: i18n for every string, no dashes.
What Changed
confirmSessionnow leaves the "session ended" note before it signs out, both when the session is missing and when the account is gone. A newonSessionEndedlistener lets an already open sign-in page show a note that arrives late. When you revoke an invite, the sheet shows an inline "Invite revoked" row with an Undo button for 8 seconds. It is a real button, so it works from the keyboard. If a revoke is still undoable when the sheet closes, or its reply comes back after the panel is gone, the Undo moves to a toast.mayEditPaymentrule insettle/payment-rules.tscontrols three places: the Edit button on the payment page, the Edit item in the expenses-list payment menu (now hidden for archived groups), and the/payments/:id/editroute. The route now sends refused viewers back to the payment page withreplace. While a payment is held after a lost reply, the settle form's debt line keeps the amount that was owed when it was sent.expenses.detail.you.*strings give the viewer's own row on the expense page second-person verbs ("owe", "get back"). The "you blocked" note on the expense form is reworded so it reads correctly with one name or several. Unit tests (including a newedit-payment.test.tsx), the account and invite e2e specs, anddocs/development.mdanddocs/testing.mdare updated to match.Risk Assessment
✅ Low: Client-only UI and copy changes with no server changes; the fix-round code (one Undo note per revoked invite, inSheet toasts, a late-reply toast, mayEditPayment in the expenses-list menu with archived gating) traces correctly through concrete sequences and matches the intent and the recorded user decisions.
Testing
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (3) ✅
apps/web/src/features/settle/settlement-actions.tsx:53- Intent item 6 says one rule (mayEditPayment) decides the Edit button and the edit route. A second Edit entry point still uses its own copy of the rule: the payment menu in the group's expenses list (SettlementActions, rendered from expenses-tab.tsx:373 with no archived check). Its check iscan(viewerRole, 'settlement.edit', { isParty })plus its own blocked-side check, and it never looks at archived_at. Concrete path: in an archived group, a party opens the payment's menu in the expenses tab and taps Edit. That navigates to /payments/:id/edit, and EditPayment now getsmayEditPayment(...) === false(archived) and replaces the URL with the payment page. The user taps Edit and lands back on the payment page with no form and no explanation. Before this change the form at least opened. Fix: decide this Edit link with mayEditPayment, passingarchivedfrom the group (expenses-tab already computes it at line 130), and drop the parallelcan(...)check. Delete in the same menu also shows in archived groups (pre-existing; the server refuses with group_archived), so it may be worth gating onarchivedin the same edit.apps/web/src/lib/auth.ts:216- Simplification: sessionIsGone acceptserror.code === 'session_ended', and the use-session-check test covers it. confirmSession only calls supabase.auth.getUser(), which talks to Supabase Auth (GoTrue).session_endedis this app's own Postgres error code and is never a GoTrue /user response, so this branch cannot be reached from confirmSession. auth-js also already mapssession_not_foundto AuthSessionMissingError. No intent requirement needs the extra code. The narrower form isAuthSessionMissingError || session_not_found || user_not_found. Remove thesession_endedmatch and its test case unless a caller really passes database errors here.🔧 Fix applied.
2 issues (1 warning, 1 info) still open:
apps/web/src/features/invites/invite-sheet.tsx:227- A revoke whose reply arrives after the panel has unmounted leaves no Undo anywhere. The revoke mutation's onSuccess now only calls setUndoable. TanStack runs useMutation callbacks even after unmount, so this is a no-op once the panel is gone. The unmount cleanup (line 188) has already run with undoable null, so no toast shows either. Sequence: in the invite sheet, tap Revoke, then close the sheet (Escape or the close button) before the server answers. The link is revoked and there is no inline note and no toast. Before this change, onSuccess raised the toast unconditionally. Fix: keep a mounted ref, and in onSuccess raise the same toast directly (Undo calling restoreRef/restoreInvite) when the panel is no longer mounted. Otherwise setUndoable as now.apps/web/src/features/invites/invite-sheet.tsx:188- The 'toast when the panel unmounts' rule also applies where InvitePanel is not in a sheet: members-page.tsx:471 renders it inline while the viewer is alone in the group. The undoable state never clears on its own. Sequence: on the members page, revoke a link (the inline note with Undo shows). Some minutes later, navigate to another screen, or have someone join soaloneturns false and the panel unmounts. A toast 'Invite revoked. That link is closed.' with Undo then appears on an unrelated screen, long after the action. Intent item 2 only asks for the toast after the sheet closes. Decide whether the inline host should skip the unmount toast, for example a prop on InvitePanel that only InviteSheet sets, or clearing undoable after a timeout.🔧 Fix applied.
4 issues (1 warning, 3 infos) still open:
apps/web/src/features/invites/invite-sheet.tsx:227- A revoke whose reply arrives after the panel has unmounted leaves no Undo anywhere. The revoke mutation's onSuccess now only calls setUndoable. TanStack runs useMutation callbacks even after unmount, so this is a no-op once the panel is gone. The unmount cleanup (line 188) has already run with undoable null, so no toast shows either. Sequence: in the invite sheet, tap Revoke, then close the sheet (Escape or the close button) before the server answers. The link is revoked and there is no inline note and no toast. Before this change, onSuccess raised the toast unconditionally. Fix: keep a mounted ref, and in onSuccess raise the same toast directly (Undo calling restoreRef/restoreInvite) when the panel is no longer mounted. Otherwise setUndoable as now.apps/web/src/features/invites/invite-sheet.tsx:188- The 'toast when the panel unmounts' rule also applies where InvitePanel is not in a sheet: members-page.tsx:471 renders it inline while the viewer is alone in the group. The undoable state never clears on its own. Sequence: on the members page, revoke a link (the inline note with Undo shows). Some minutes later, navigate to another screen, or have someone join soaloneturns false and the panel unmounts. A toast 'Invite revoked. That link is closed.' with Undo then appears on an unrelated screen, long after the action. Intent item 2 only asks for the toast after the sheet closes. Decide whether the inline host should skip the unmount toast, for example a prop on InvitePanel that only InviteSheet sets, or clearing undoable after a timeout.apps/web/src/features/invites/invite-sheet.tsx:275- The note's Undo only takes focus when the note mounts. RevokedNote focuses its button in a mount-only effect (line ~402), and its element is not keyed by the revoked invite. When a second link in the same slot is revoked while the note is still up, the same instance stays mounted, so focus is not moved. Sequence: in the sheet, a keyboard user revokes the latest link A (focus lands on Undo), tabs to the new latest link B, and presses Revoke within 8 s. B's row and its focused Revoke button go away, the note now refers to B, and Radix's FocusScope sends focus to the sheet container, not to Undo. Intent item 2 asks for an inline Undo 'reachable by keyboard'. The same applies to the!wasLatestnote in the older-links list (line ~375). Fix: key both RevokedNote renders byundoable.invite.idso each new revoke remounts the note and focuses Undo. This came in with the original commit 7dee0e9 and was left in place by the round-2 fix.apps/web/src/features/invites/invite-sheet.tsx:244- Only the most recent revoke can be undone.undoableholds a single invite, so a second revoke within 8 s replaces the first. Its inline Undo, and the toast the sheet would raise on close, are both gone. Sequence: revoke the latest link A, then within 8 s revoke an older link B. Only B can come back; A stays revoked with no way to restore it (the old code raised one toast per revoke, each with its own Undo). Keeping a list of undoable invites would add state beyond the intent's single inline row, so this is a product call: is losing Undo on the earlier link acceptable?🔧 Fix applied.
✅ Re-checked - no issues remain.
⏭️ **Test** - skipped
Step was skipped.
✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.