Skip to content

fix: re-invite replaces existing invite, search empty state uses searched flag (#136)#141

Merged
zacharias-ona merged 1 commit into
mainfrom
fix/136-e2e-reinvite-and-search-empty-state
Apr 16, 2026
Merged

fix: re-invite replaces existing invite, search empty state uses searched flag (#136)#141
zacharias-ona merged 1 commit into
mainfrom
fix/136-e2e-reinvite-and-search-empty-state

Conversation

@zacharias-ona
Copy link
Copy Markdown
Collaborator

Closes #136

What

Two E2E failures detected after PR #134:

  1. Re-invite toast not shown — The InviteForm blocked 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.

  2. 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 (no workspaceId), set loading = false, but workspaceResolved was still false — showing skeletons indefinitely until a second search cycle completed.

How

  1. 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.

  2. PageSearch: Added a searched flag that only becomes true after a real API call completes (not after an early return due to missing workspaceId). The empty state condition now uses searched instead of workspaceResolved, ensuring the empty state only appears after the search API has actually responded with zero results.

Testing

  • All 125 unit tests pass (pnpm test)
  • All 42 E2E tests pass (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" ✅
  • Existing page-search.test.tsx unit tests (3 tests) continue to pass with the searched flag change
  • Lint and typecheck clean

…ched flag (#136)

Co-authored-by: Ona <no-reply@ona.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Apr 16, 2026 11:53pm

Request Review

@zacharias-ona zacharias-ona merged commit c6d128f into main Apr 16, 2026
6 checks passed
@zacharias-ona zacharias-ona deleted the fix/136-e2e-reinvite-and-search-empty-state branch April 16, 2026 23:57
@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ UI verification passed — design spec compliance confirmed.

Changed files: invite-form.tsx (logic only), page-search.tsx (empty state condition)

Static analysis: No violations found. The search empty state uses text-xs text-muted-foreground with centered text — consistent with the design spec. No arbitrary colors, spacing, or typography values introduced.

Visual verification (Playwright screenshots):

Route Desktop Mobile
Workspace (sidebar + search)
Settings (invite form context)
Search empty state

No broken layouts, no overlapping elements, no horizontal scroll, adequate touch targets on mobile.

@zacharias-ona
Copy link
Copy Markdown
Collaborator Author

✅ 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.

Failure Cause
editor-slash-commands.spec.ts:46 — heading insertion h1 locator matches 2 elements (pre-existing + new)
editor-toolbar.spec.ts:34 — bold button strong locator matches 2 elements
editor-toolbar.spec.ts:94 — Cmd+B shortcut Same strong strict mode violation

These are test isolation issues fixed in PR #142 (fix/140-e2e-strict-mode-violations), which was merged after this branch.

Ad-hoc smoke tests (all passed):

  • ✅ Landing page — loads, has title
  • /sign-in — renders email input
  • /api/health — returns healthy status
  • ✅ Authenticated login — redirects to workspace
  • ✅ Workspace page — fully loaded
  • ✅ Editor navigation — page button click navigates to editor route, editor element rendered
  • ⏭️ Skipped: /dashboard (not yet built)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: E2E failures after PR #134 — re-invite toast not shown, search empty state missing

1 participant