Skip to content

fix(app): resolve workspace reload crash and fix non-git status and UI changes - #39314

Open
DhruvNimavat78 wants to merge 12 commits into
anomalyco:devfrom
DhruvNimavat78:nongit-undo-revert
Open

fix(app): resolve workspace reload crash and fix non-git status and UI changes#39314
DhruvNimavat78 wants to merge 12 commits into
anomalyco:devfrom
DhruvNimavat78:nongit-undo-revert

Conversation

@DhruvNimavat78

@DhruvNimavat78 DhruvNimavat78 commented Jul 28, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #38672

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  1. Fixes Workspace Reload Crash:

    • Problem: When switching or reloading workspaces, loadCommands and loadProvidersQuery threw TypeError: Cannot read properties of undefined (reading 'list') when reading singular API properties (command, provider, model) that were undefined on the generated client. This showed a runtime error toast: "Failed to reload ".
    • Solution: Added optional chaining and safe fallback checks (api.command ?? api.commands, providerList ? providerList(...) : Promise.resolve(...)) in bootstrap.ts and server-sync.tsx. Expanded server-compat.ts to map both singular and plural endpoint aliases (command/commands, provider/providers, model/models, agent/agents, reference/references).
  2. UI Improvements & Non-Git Status Badge:

    • Problem: Non-Git tracked folders previously inherited stale branch names (e.g., / 🌿 master) from previously opened repositories or didn't indicate Git status.
    • Solution: Updated PromptGitStatus in prompt-workspace-selector.tsx to display / 🌿 non git (with a tooltip reading "Not a git repository") for non-Git directories, and removed cross-worktree branch fallbacks in new-session.tsx.
    • Session & File Preview UI: Refined file preview and turn UI components (session-turn.tsx, session-review-file-preview-v2.tsx, session-new-design-view.tsx) for smoother file interaction and visual consistency.
  3. Type Definition Fixes:

    • Updated CompatiblePermissionApi reply signature in server-compat.ts to support { sessionID, requestID, permissionID, reply, response, location }.

How did you verify your code works?

  • Tested locally by creating and switching between Git-tracked and non-Git tracked folders (test, color, New folder (2)).
  • Verified zero reload error toasts upon workspace switch.
  • Verified type checking with bun typecheck in packages/app.

Screen Recording

UI & Non-Git Status Demo

Revert Changes & File Preview Demo

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
demo.mp4

@DhruvNimavat78 DhruvNimavat78 changed the title fix(app): resolve workspace reload crash and improve non-git status UI fix(app): resolve workspace reload crash and improve non-git status and UI changes Jul 28, 2026
@DhruvNimavat78 DhruvNimavat78 changed the title fix(app): resolve workspace reload crash and improve non-git status and UI changes fix(app): resolve workspace reload crash and fix non-git status and UI changes Jul 28, 2026
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: /undo reports success but does not revert files in non-Git projects

1 participant