Skip to content

fix(onboarding): remove Screen & Accessibility Permissions step#557

Merged
graycyrus merged 4 commits intotinyhumansai:mainfrom
graycyrus:remove-screen-permissions-onboarding
Apr 14, 2026
Merged

fix(onboarding): remove Screen & Accessibility Permissions step#557
graycyrus merged 4 commits intotinyhumansai:mainfrom
graycyrus:remove-screen-permissions-onboarding

Conversation

@graycyrus
Copy link
Copy Markdown
Contributor

@graycyrus graycyrus commented Apr 14, 2026

Summary

  • Removes the Screen & Accessibility Permissions step from the onboarding flow to reduce friction
  • Users can still configure screen intelligence permissions later via Settings
  • Onboarding steps are now: Welcome → Referral → Skills → Context Gathering

Changes

  • Onboarding.tsx: removed ScreenPermissionsStep, renumbered steps (max 3 instead of 4)
  • Deleted ScreenPermissionsStep.tsx and its test
  • Updated E2E login-flow spec to match new step sequence

Test plan

  • yarn typecheck passes
  • yarn lint passes (only pre-existing warnings)
  • Walk through onboarding: Welcome → (Referral if applicable) → Skills → Context Gathering → complete
  • Verify screen intelligence permissions still accessible in Settings

Summary by CodeRabbit

  • Onboarding

    • Removed the Screen & Accessibility Permissions step, streamlining and renumbering the onboarding flow; skipping now jumps directly to Skills.
    • Context step can be bypassed automatically when no external sources are connected.
  • Tests

    • Updated end-to-end tests to match the simplified 4-step onboarding.
    • Removed unit tests covering the removed Screen & Accessibility step.

The permissions step added friction to onboarding without being essential —
users can still configure screen intelligence permissions later via Settings.

Steps are now: Welcome → Referral → Skills → Context Gathering.
The permissions step added friction to onboarding without being essential —
users can still configure screen intelligence permissions later via Settings.

Steps are now: Welcome → Referral → Skills → Context Gathering.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 65813484-5eaa-4967-8af3-2a487ededc44

📥 Commits

Reviewing files that changed from the base of the PR and between 7a56de1 and 7d93407.

📒 Files selected for processing (2)
  • app/src/pages/onboarding/Onboarding.tsx
  • app/test/e2e/specs/login-flow.spec.ts
✅ Files skipped from review due to trivial changes (1)
  • app/test/e2e/specs/login-flow.spec.ts

📝 Walkthrough

Walkthrough

Removed the ScreenPermissions onboarding step and its tests, reindexed subsequent onboarding steps in Onboarding.tsx, adjusted step navigation and handlers to skip the removed step, and updated the e2e login flow to match the new step ordering.

Changes

Cohort / File(s) Summary
Onboarding core
app/src/pages/onboarding/Onboarding.tsx
Removed accessibilityPermissionGranted usage and handleAccessibilityNext; shifted step indices to skip the removed ScreenPermissions step, updated navigation bounds (logical < 3), remapped SkillsStep → case 2 and ContextGatheringStep → case 3, changed handleContextNext to accept optional connectedSourcesOverride, always set accessibilityPermissionGranted from snapshot/localState (default false), and adjusted handleSkillsNext to bypass Context when connectedSources is empty.
Removed step & tests
app/src/pages/onboarding/steps/ScreenPermissionsStep.tsx, app/src/pages/onboarding/steps/__tests__/ScreenPermissionsStep.test.tsx
Deleted the ScreenPermissions React step component (permission polling, request/refresh logic, focus-based auto-refresh) and its test suite.
E2E updates
app/test/e2e/specs/login-flow.spec.ts
Updated onboarding e2e flow to remove interactions with ScreenPermissions and other removed steps, renumbered comments and step markers, and adjusted step click logic to match the new 4-step flow.

Sequence Diagram(s)

(omitted — changes are removal/renumbering and do not introduce a new multi-component sequential flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • senamakel

Poem

🐰 I hopped along the onboarding trail,
One step dropped out — I left a tail.
I found my skills and gathered context,
A shorter hop, no more pretext.
🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: removing the Screen & Accessibility Permissions step from the onboarding flow, which is accurately reflected in all the file modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
app/test/e2e/specs/login-flow.spec.ts (2)

290-318: ⚠️ Potential issue | 🟠 Major

MnemonicStep does not exist in the actual onboarding flow — this test block will silently skip.

The test looks for 'Your Recovery Phrase' text to detect MnemonicStep, but this component doesn't exist in the codebase. The actual onboarding flow has only 4 steps: WelcomeStep → ReferralApplyStep (optional) → SkillsStep → ContextGatheringStep. The final step (ContextGatheringStep) handles LinkedIn enrichment, not recovery phrases. The "Your Recovery Phrase" text only appears in a separate Mnemonic.tsx page, not in the onboarding flow.

When the test runs, this block will silently skip without failure, leaving the actual final onboarding step untested.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/test/e2e/specs/login-flow.spec.ts` around lines 290 - 318, The test block
assumes a MnemonicStep by checking textExists('Your Recovery Phrase') but that
component isn't in the onboarding flow, so this block silently skips and leaves
the real final step untested; update the logic in this section (where textExists
and clickFirstMatch are used) to detect and exercise the actual final onboarding
step (ContextGatheringStep) by looking for an element/text unique to
ContextGatheringStep (e.g., the LinkedIn enrichment prompt or another stable
selector), replace references to MnemonicStep handling with ContextGatheringStep
actions, and add a failing assertion or explicit error when neither expected
step is present so the test fails fast instead of silently skipping.

266-288: ⚠️ Potential issue | 🔴 Critical

Update text detection patterns to match actual onboarding UI.

The test searches for 'Enable Tools' (line 268) and 'Install Skills' (line 280), but these strings are not rendered by any actual onboarding component. Verification found:

  • ToolsStep.tsx does not exist in the codebase
  • SkillsStep.tsx renders a heading "Connect Gmail" (line 103), not "Install Skills"
  • No components render the text "Enable Tools" or "Install Skills"

The test will fail when it cannot detect these steps. Update the text patterns to match the actual rendered headings in WelcomeStep.tsx, LocalAIStep.tsx, and SkillsStep.tsx to ensure the test can identify and navigate through the correct steps during onboarding.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/test/e2e/specs/login-flow.spec.ts` around lines 266 - 288, The onboarding
E2E checks look for non-existent texts ("Enable Tools" / "Install Skills") so
textExists/clickFirstMatch in the login-flow.spec.ts should be updated to match
actual headings rendered by the onboarding components; replace the checks for
'Enable Tools' and 'Install Skills' with the actual strings used in WelcomeStep,
LocalAIStep and SkillsStep (e.g., the WelcomeStep heading, LocalAIStep's
heading, and "Connect Gmail" from SkillsStep) so that textExists(...) and
subsequent clickFirstMatch([...], 10_000) calls can correctly detect and advance
those steps during the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/test/e2e/specs/login-flow.spec.ts`:
- Around line 12-17: The test's onboarding step comments and detection logic are
out of sync with the app; update the comments to reflect the real Onboarding.tsx
sequence (WelcomeStep → LocalAIStep → ReferralApplyStep → SkillsStep →
ContextGatheringStep) and replace the broken text checks that look for
non-existent UI strings ("Enable Tools", "Install Skills", "Your Recovery
Phrase") with selectors that target the actual onboarding components or their
real UI labels (e.g., assert presence of WelcomeStep, LocalAIStep,
ReferralApplyStep, SkillsStep, ContextGatheringStep by using component-specific
testids, heading text, or roles), and update any assertions that assumed a
ToolsStep or MnemonicStep to instead expect the
ReferralApplyStep/ContextGatheringStep behaviors; locate the checks in
app/test/e2e/specs/login-flow.spec.ts (the step-detection blocks around the
current checks) and change them to query real labels or testids exposed by those
components.

---

Outside diff comments:
In `@app/test/e2e/specs/login-flow.spec.ts`:
- Around line 290-318: The test block assumes a MnemonicStep by checking
textExists('Your Recovery Phrase') but that component isn't in the onboarding
flow, so this block silently skips and leaves the real final step untested;
update the logic in this section (where textExists and clickFirstMatch are used)
to detect and exercise the actual final onboarding step (ContextGatheringStep)
by looking for an element/text unique to ContextGatheringStep (e.g., the
LinkedIn enrichment prompt or another stable selector), replace references to
MnemonicStep handling with ContextGatheringStep actions, and add a failing
assertion or explicit error when neither expected step is present so the test
fails fast instead of silently skipping.
- Around line 266-288: The onboarding E2E checks look for non-existent texts
("Enable Tools" / "Install Skills") so textExists/clickFirstMatch in the
login-flow.spec.ts should be updated to match actual headings rendered by the
onboarding components; replace the checks for 'Enable Tools' and 'Install
Skills' with the actual strings used in WelcomeStep, LocalAIStep and SkillsStep
(e.g., the WelcomeStep heading, LocalAIStep's heading, and "Connect Gmail" from
SkillsStep) so that textExists(...) and subsequent clickFirstMatch([...],
10_000) calls can correctly detect and advance those steps during the test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f8a58081-b13b-4366-81f0-7f6a30c41f60

📥 Commits

Reviewing files that changed from the base of the PR and between 95ccf86 and 36b61a5.

📒 Files selected for processing (4)
  • app/src/pages/onboarding/Onboarding.tsx
  • app/src/pages/onboarding/steps/ScreenPermissionsStep.tsx
  • app/src/pages/onboarding/steps/__tests__/ScreenPermissionsStep.test.tsx
  • app/test/e2e/specs/login-flow.spec.ts
💤 Files with no reviewable changes (2)
  • app/src/pages/onboarding/steps/ScreenPermissionsStep.tsx
  • app/src/pages/onboarding/steps/tests/ScreenPermissionsStep.test.tsx

Comment thread app/test/e2e/specs/login-flow.spec.ts Outdated
When the user clicks "Skip for Now" on the Gmail step, complete
onboarding immediately instead of showing the context gathering step.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/src/pages/onboarding/Onboarding.tsx (1)

123-128: Skip the context step when Gmail is absent, not only when the array is empty.

ContextGatheringStep already short-circuits on !hasGmail (app/src/pages/onboarding/steps/ContextGatheringStep.tsx:94-114). With the current branch, users who connect only non-Gmail sources still get routed through a step that immediately marks everything skipped. If this screen is still Gmail-only, mirror that predicate here too.

Suggested diff
   const handleSkillsNext = async (connectedSources: string[]) => {
     console.debug('[onboarding:handleSkillsNext]', { connectedSources });
     setDraft(prev => ({ ...prev, connectedSources }));
-    if (connectedSources.length === 0) {
-      // No sources connected — skip context gathering and finish onboarding.
+    const hasGmailSource = connectedSources.some(source => source.includes('gmail'));
+    if (!hasGmailSource) {
+      // No Gmail source connected — skip context gathering and finish onboarding.
       await handleContextNext(connectedSources);
     } else {
       handleNext();
     }
   };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/pages/onboarding/Onboarding.tsx` around lines 123 - 128, The
onboarding flow should skip the context-gathering step not only when
connectedSources is empty but also when there is no Gmail source; change the
condition around handleContextNext/handleNext to check for a Gmail presence
(e.g., compute hasGmail = connectedSources.some(s => s.type === 'gmail') or
reuse the same predicate used by ContextGatheringStep) and call await
handleContextNext(connectedSources) only when hasGmail is true (and
connectedSources.length > 0), otherwise call handleNext(); update the branch
that currently uses connectedSources.length === 0 to use this hasGmail check and
reference the connectedSources array and handleContextNext/handleNext functions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/pages/onboarding/Onboarding.tsx`:
- Around line 134-140: When calling setOnboardingTasks in Onboarding.tsx,
preserve the existing accessibilityPermissionGranted value instead of
unconditionally setting it to false; read the current onboardingTasks (or the
source of truth used elsewhere) and pass accessibilityPermissionGranted:
onboardingTasks?.accessibilityPermissionGranted ?? false (or equivalent) so the
reset mirrors ToolsPanel.tsx’s defensive pattern, while still resetting other
fields like localModelConsentGiven, localModelDownloadStarted, enabledTools
(getDefaultEnabledTools()), connectedSources, and updatedAtMs.

---

Nitpick comments:
In `@app/src/pages/onboarding/Onboarding.tsx`:
- Around line 123-128: The onboarding flow should skip the context-gathering
step not only when connectedSources is empty but also when there is no Gmail
source; change the condition around handleContextNext/handleNext to check for a
Gmail presence (e.g., compute hasGmail = connectedSources.some(s => s.type ===
'gmail') or reuse the same predicate used by ContextGatheringStep) and call
await handleContextNext(connectedSources) only when hasGmail is true (and
connectedSources.length > 0), otherwise call handleNext(); update the branch
that currently uses connectedSources.length === 0 to use this hasGmail check and
reference the connectedSources array and handleContextNext/handleNext functions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f0ae3c63-8782-41be-8ead-d77af0bdf6b6

📥 Commits

Reviewing files that changed from the base of the PR and between 36b61a5 and 7a56de1.

📒 Files selected for processing (1)
  • app/src/pages/onboarding/Onboarding.tsx

Comment thread app/src/pages/onboarding/Onboarding.tsx
- Preserve accessibilityPermissionGranted from existing state instead
  of hardcoding false (matches ToolsPanel defensive pattern)
- Update E2E test step comments and detection logic to match the real
  onboarding flow (WelcomeStep → ReferralApplyStep → SkillsStep →
  ContextGatheringStep) and use actual UI text
@graycyrus
Copy link
Copy Markdown
Contributor Author

Addressed both CodeRabbit findings in 7d93407:

  1. E2E test stale comments/detection — Updated both comment blocks and step detection logic to match the actual onboarding flow (WelcomeStep → ReferralApplyStep → SkillsStep → ContextGatheringStep) with correct UI text (Referral code, Connect Gmail, Preparing Your Context). Removed references to non-existent LocalAIStep, ToolsStep, and MnemonicStep.

  2. Preserve accessibilityPermissionGranted — Now reads from snapshot.localState.onboardingTasks?.accessibilityPermissionGranted ?? false instead of hardcoding false, matching the ToolsPanel defensive pattern.

@graycyrus graycyrus merged commit 21e4a8b into tinyhumansai:main Apr 14, 2026
8 checks passed
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.

2 participants