Skip to content

fix: add back shift-tab support#1805

Merged
charlesvien merged 1 commit intomainfrom
04-22-fix_add_back_shift-tab_support
Apr 22, 2026
Merged

fix: add back shift-tab support#1805
charlesvien merged 1 commit intomainfrom
04-22-fix_add_back_shift-tab_support

Conversation

@jonathanlab
Copy link
Copy Markdown
Contributor

@jonathanlab jonathanlab commented Apr 22, 2026

Closes #1773

@jonathanlab jonathanlab marked this pull request as ready for review April 22, 2026 10:04
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 22, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sessions/stores/sessionStore.test.ts
Line: 26-65

Comment:
**Missing edge case: current value is filtered out**

The test suite doesn't cover the case where `currentValue` is itself a restricted mode (e.g. `"bypassPermissions"`) while `allowBypassPermissions` is `false`. In that scenario `findIndex` returns `-1` and `filtered[0]` is returned — falling back to the first mode. This may or may not be the intended UX, but it's worth having an explicit test case to document the expected behavior, particularly if a user's permissions are revoked mid-session.

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

Reviews (1): Last reviewed commit: "fix: add back shift-tab support" | Re-trigger Greptile

Comment on lines +26 to +65
it.each([
{
name: "claude: advances to next mode when bypass allowed",
values: CLAUDE_MODES,
currentValue: "plan",
allowBypassPermissions: true,
expected: "bypassPermissions",
},
{
name: "codex: advances to next mode when bypass allowed",
values: CODEX_MODES,
currentValue: "auto",
allowBypassPermissions: true,
expected: "full-access",
},
{
name: "claude: skips bypassPermissions when not allowed",
values: CLAUDE_MODES,
currentValue: "acceptEdits",
allowBypassPermissions: false,
expected: "plan",
},
{
name: "claude: wraps past bypassPermissions back to default",
values: CLAUDE_MODES,
currentValue: "plan",
allowBypassPermissions: false,
expected: "default",
},
{
name: "codex: skips full-access when not allowed",
values: CODEX_MODES,
currentValue: "auto",
allowBypassPermissions: false,
expected: "read-only",
},
])("$name", ({ values, currentValue, allowBypassPermissions, expected }) => {
const option = createModeOption(currentValue, values);

expect(cycleModeOption(option)).toBe("full-access");
expect(cycleModeOption(option, { allowBypassPermissions })).toBe(expected);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Missing edge case: current value is filtered out

The test suite doesn't cover the case where currentValue is itself a restricted mode (e.g. "bypassPermissions") while allowBypassPermissions is false. In that scenario findIndex returns -1 and filtered[0] is returned — falling back to the first mode. This may or may not be the intended UX, but it's worth having an explicit test case to document the expected behavior, particularly if a user's permissions are revoked mid-session.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sessions/stores/sessionStore.test.ts
Line: 26-65

Comment:
**Missing edge case: current value is filtered out**

The test suite doesn't cover the case where `currentValue` is itself a restricted mode (e.g. `"bypassPermissions"`) while `allowBypassPermissions` is `false`. In that scenario `findIndex` returns `-1` and `filtered[0]` is returned — falling back to the first mode. This may or may not be the intended UX, but it's worth having an explicit test case to document the expected behavior, particularly if a user's permissions are revoked mid-session.

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

Copy link
Copy Markdown
Member

charlesvien commented Apr 22, 2026

Merge activity

  • Apr 22, 3:24 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 22, 3:26 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 22, 3:35 PM UTC: @charlesvien merged this pull request with Graphite.

@charlesvien charlesvien changed the base branch from 04-22-fix_handle_git-lfs_with_git_lfs_skip_smudge to graphite-base/1805 April 22, 2026 15:24
@charlesvien charlesvien changed the base branch from graphite-base/1805 to main April 22, 2026 15:24
@charlesvien charlesvien force-pushed the 04-22-fix_add_back_shift-tab_support branch from fdbba1e to d3cf85e Compare April 22, 2026 15:25
@charlesvien charlesvien merged commit 8bff776 into main Apr 22, 2026
16 checks passed
@charlesvien charlesvien deleted the 04-22-fix_add_back_shift-tab_support branch April 22, 2026 15:35
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.

Add back shift+tab to cycle through agent permission modes

3 participants