Skip to content

fix(staged): support missing commands in web dispatch - #848

Merged
matt2e merged 2 commits into
mainfrom
missing-command
Jul 2, 2026
Merged

fix(staged): support missing commands in web dispatch#848
matt2e merged 2 commits into
mainfrom
missing-command

Conversation

@matt2e

@matt2e matt2e commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add web dispatch handlers for branch git state, worktree, note follow-up, assistant-count, and PR poll scheduler commands.
  • Share synchronous command implementations between Tauri commands and web dispatch.
  • Add a parity test that fails when generated Tauri commands are missing web dispatch arms.

Testing

  • push hooks passed: crates-fmt, crates-test, crates-lint, differ-ci, staged-ci

matt2e added 2 commits July 2, 2026 21:02
In web mode the browser reaches the backend by POSTing to /api/invoke/{command}, which web_server::dispatch() routes through a hand-maintained match mirroring the Tauri generate_handler! list. Eight commands the web frontend actually invokes had no arm and fell through to the "Unknown command" catch-all (HTTP 400):

- build_note_followup_message
- count_assistant_messages_after
- refresh_branch_git_state
- list_parent_branch_commits
- pull_branch_ff_only
- reset_branch_to_remote
- get_worktree_changes_preview
- discard_worktree_changes

Add a dispatch arm for each. Rather than copy-pasting the command bodies (which invites drift, as with the existing ensure_repo_badges arm), extract the synchronous body of each Tauri command into a shared `_impl` helper that both the #[tauri::command] wrapper and the new arm call inside spawn_blocking. refresh_branch_git_state_impl also takes &AppHandle for its git-state-updated event; reset_branch_to_remote_impl already existed and is just made pub(crate).

start_or_queue_branch_session (listed in the plan) already had an arm, so this closes the remaining 8 Tier-1 gaps. The paths are latent today since web mode is stubbed, but this restores parity for when web mode is switched back on.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e requested review from baxen and wesbillman as code owners July 2, 2026 12:33
@matt2e
matt2e merged commit 0e31542 into main Jul 2, 2026
4 checks passed
@matt2e
matt2e deleted the missing-command branch July 2, 2026 12:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5eb98c00a7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +667 to +668
let _ = app.emit(
"git-state-updated",

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 Badge Use web broadcast for git refresh events

When refresh_branch_git_state is invoked through the new web dispatch arm, the HTTP response is just null and the frontend relies on the git-state-updated event to merge the refreshed state. This helper still calls app.emit, which only reaches the Tauri event bus; Axum WebSocket clients are fed from web_server::emit_to_all's broadcast channel, so browser clients never receive the update and can leave the git state/spinner stale after a web refresh.

Useful? React with 👍 / 👎.

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.

1 participant