fix: re-invite replaces existing invite, search empty state uses searched flag (#136)#141
Conversation
…ched flag (#136) Co-authored-by: Ona <no-reply@ona.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
✅ UI verification passed — design spec compliance confirmed. Changed files: Static analysis: No violations found. The search empty state uses Visual verification (Playwright screenshots):
No broken layouts, no overlapping elements, no horizontal scroll, adequate touch targets on mobile. |
|
✅ Post-merge verification passed. E2E suite: 39/42 passed. 3 failures are pre-existing flaky editor tests (strict mode violations from leftover content) already fixed by PR #142 — not present in this branch's test code.
These are test isolation issues fixed in PR #142 ( Ad-hoc smoke tests (all passed):
|
Closes #136
What
Two E2E failures detected after PR #134:
Re-invite toast not shown — The
InviteFormblocked re-inviting when a pending invite already existed, showing "An invite has already been sent to this email." instead of "Invite sent." This happened because the previous revoke's database delete could fail silently (Supabase RLS-blocked deletes return success with 0 rows affected), leaving a stale invite record.Search empty state missing — The "No pages match your search" message depended on
workspaceResolved, which could create a timing gap where neither the skeleton nor the empty state rendered. When the workspace resolution was slow, the search callback returned early (noworkspaceId), setloading = false, butworkspaceResolvedwas stillfalse— showing skeletons indefinitely until a second search cycle completed.How
InviteForm: Changed the duplicate-invite check from blocking with an error to deleting the existing invite before creating a new one. This makes re-inviting idempotent — it works whether the previous invite was properly revoked or not.
PageSearch: Added a
searchedflag that only becomestrueafter a real API call completes (not after an early return due to missingworkspaceId). The empty state condition now usessearchedinstead ofworkspaceResolved, ensuring the empty state only appears after the search API has actually responded with zero results.Testing
pnpm test)pnpm test:e2e), including the two previously failing tests:e2e/members.spec.ts:139— "owner can re-invite and invited user can accept" ✅e2e/search.spec.ts:159— "search with no matches shows empty state" ✅page-search.test.tsxunit tests (3 tests) continue to pass with thesearchedflag change