Skip to content

fix(code): suppress space switcher during tour and on cmd+shift#1879

Merged
adamleithp merged 1 commit into
mainfrom
fix/space-switcher-suppress-during-tour-and-shift
Apr 24, 2026
Merged

fix(code): suppress space switcher during tour and on cmd+shift#1879
adamleithp merged 1 commit into
mainfrom
fix/space-switcher-suppress-during-tour-and-shift

Conversation

@adamleithp
Copy link
Copy Markdown
Contributor

@adamleithp adamleithp commented Apr 24, 2026

Summary

  • Tour overlay now toggles a tour-active body class while a tour is active so the SpaceSwitcher minimap does not pop in over onboarding spotlights.
  • SpaceSwitcher bails its 500ms Cmd-hold show when the body has tour-active or when Shift is held (Cmd+Shift+3/4/5 screenshot shortcuts).
  • If Shift is pressed mid-hold while the minimap is already shown, it hides immediately.
2026-04-24 13 02 30 2026-04-24 13 03 20

Test plan

  • Trigger the first-task tour: hold Cmd for >500ms, confirm minimap does NOT appear; complete or dismiss the tour and confirm minimap re-enables.
  • With no tour active, press Cmd+Shift+4 (or Cmd+Shift+3): confirm minimap does NOT appear and screenshot tool launches normally.
  • Hold Cmd alone for >500ms, then press Shift: confirm minimap hides.
  • Hold Cmd alone for >500ms with no other keys: confirm minimap still shows.

🤖 Generated with Claude Code

Tour overlay sets a `tour-active` body class so the space switcher
minimap won't trigger from a Cmd hold while onboarding is running.
Also bails when Shift is held with Cmd (screenshot shortcut), and
hides if Shift is pressed mid-hold.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Comments Outside Diff (1)

  1. apps/code/src/renderer/components/SpaceSwitcher.tsx, line 317-321 (link)

    P2 tour-active not re-checked at timer fire time

    The tour-active guard runs only at keydown, but the minimap is actually shown 500 ms later inside the setTimeout callback. If a tour starts in that window (e.g. the user holds Cmd just as onboarding kicks off), the callback fires without knowing the tour is now active and show() is called anyway.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/code/src/renderer/components/SpaceSwitcher.tsx
    Line: 317-321
    
    Comment:
    **`tour-active` not re-checked at timer fire time**
    
    The `tour-active` guard runs only at `keydown`, but the minimap is actually shown 500 ms later inside the `setTimeout` callback. If a tour starts in that window (e.g. the user holds Cmd just as onboarding kicks off), the callback fires without knowing the tour is now active and `show()` is called anyway.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/components/SpaceSwitcher.tsx
Line: 317-321

Comment:
**`tour-active` not re-checked at timer fire time**

The `tour-active` guard runs only at `keydown`, but the minimap is actually shown 500 ms later inside the `setTimeout` callback. If a tour starts in that window (e.g. the user holds Cmd just as onboarding kicks off), the callback fires without knowing the tour is now active and `show()` is called anyway.

```suggestion
        showTimerRef.current = window.setTimeout(() => {
          if (metaHeldRef.current && !otherKeyRef.current && !document.body.classList.contains("tour-active")) {
            show();
          }
        }, 500);
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(code): suppress space switcher durin..." | Re-trigger Greptile

@adamleithp adamleithp requested a review from a team April 24, 2026 12:04
@adamleithp adamleithp merged commit ac3eee2 into main Apr 24, 2026
15 checks passed
@adamleithp adamleithp deleted the fix/space-switcher-suppress-during-tour-and-shift branch April 24, 2026 12:29
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