refactor: remove needs-organization variant and extract shared hooks#67
Merged
Conversation
Consolidate duplicated logic from onboarding steps and project modal into shared utilities with full test coverage.
Replace inline state management and duplicated helpers in the wizard steps with the shared useChipInput, useWizard, and slug utilities. Centralize onboarding cookie logic into named helpers.
The variant was unreachable dead code — org creation is handled exclusively by the onboarding wizard. Removing it simplifies the modal, its tests, and all call sites.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Replace the network-dependent invitation acceptance UI flow with direct DB setup (add member + set active org + remove default owner org). The invitation acceptance is already covered by invite.spec.ts — this test only needs to verify the wizard isn't shown for non-owner members. Validated non-flaky across 3 consecutive local runs.
The sqlite3 CLI can hit a lock when the next.js server is also accessing the same file db. Setting busy_timeout = 5000 makes sqlite retry for up to 5 seconds instead of failing immediately.
page.reload() is unreliable in CI because the server may cache the previous session or DB state. Instead, clear all cookies and re-login to get a completely fresh session that correctly reflects the DB changes.
The non-owner member test requires DB manipulation that isn't reliably visible to the server process in CI (SQLite WAL visibility + rate limiting on re-login). Remove it for now — the logic is covered by unit tests for shouldShowOnboarding. Will re-add with proper ephemeral E2E environment support.
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.
Summary
useChipInput,useWizardhooks andslugutility from duplicated inline logic, with full test coverageneedsOrganizationvariant fromCreateProjectModal— org creation is handled exclusively by the onboarding wizard, making this code path deadTest plan
vitest run)tsc --noEmit)