Skip to content

Settings: the worktree switch flips before a folder exists, and the engine's own words are shown - #1493

Open
syntony666 wants to merge 2 commits into
zeronsh:mainfrom
syntony666:fix/worktree-custom-location
Open

syntony666 wants to merge 2 commits into
zeronsh:mainfrom
syntony666:fix/worktree-custom-location

Conversation

@syntony666

@syntony666 syntony666 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The Custom worktree location switch now flips locally before a folder exists, revealing the folder field immediately. SetWorktreeSettings goes to the engine only once a folder is known (typed and committed, or remembered) or when turning off — so a fresh install's "Choose a worktree folder" rejection can no longer dead-end the feature.
  • Ordinary engine errors reach the UI as the engine wrote them ("Choose a worktree folder", "Worktrees for zeron would be created inside the repository…") instead of "Something went wrong". The unknown method → outdated and offline/signed-out mappings are unchanged.
  • Mirrors the gpui settings behavior in crates/ui.

Fixes #1395

Test plan

  • New UI test a worktree folder is asked for before the engine is, and a refusal is said in the engine's words — verified it fails without the fix: toggle on with no folder → field appears, zero SetWorktreeSettings calls; folder + Enter → one call and the description updates; toggle off → second call, field hidden, folder kept; an engine rejection is shown in its own words
  • zgx test ui — 1425 passed, 0 failed
  • cargo test --locked --bin zeron-zgx — 718 passed, 1 failed: plugins::preview::tests::every_action_the_code_refuses_is_blocked, which fails on main too (agents.cloud_key is refused in agents.rs but missing from the BLOCKED list; unrelated to this change)
  • Manual: drove a live shell_fixture window with zgx inspect — screenshots below

Screenshots

before after
switch bounces back off, folder field unreachable, "出错了。" swallows the engine's "Choose a worktree folder" switch flips on, folder field appears before the engine is asked
  • before/after images attached below
zeron-1395-before-light zeron-1395-after-error
  • engine's own words in the refusal toast (light)
zeron-1395-after-light

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A wait pumps frames as fast as the host draws, so on a fast runner the
whole ease can pass between two of a test's reads: every sample landed
at the end state, and no mid-ease state was ever seen. Sampling per
delivered frame steps the animation's own clock, so the states between
are always there to read.

This branch has not been deployed

No deployments
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]: zgx Settings — Worktree location toggle is a dead end, and engine errors show as "something went wrong"

1 participant