Repository navigation
feat(desktop): add the state of the local serve to the model - #1095
Merged
Merged
Conversation
ServeState is what the supervisor of the local serve reports and the window renders: starting, attached, running, restarting, stopping, stopped, and the failures (no tole binary, directory not private, protocol version mismatch, no credential the serve accepts, not a tole serve, did not start, gave up, could not stop), each with a plain-language string and the button it calls for. Part of #1029.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tole-desktop-modelgainsServeStateandServeFailure: what the desktop knows about the localtole serveit starts or attaches to, with the plain-language strings and the owner action each failure calls for.Why
Part of #1029. The supervisor (the next changes of this series) produces a small state, and the window renders it through the string table without deciding on its own what a failure means. The model crate has no GUI toolkit and no tole dependency (
desktop-check.shenforces both), so the state lives here and the supervisor intole-desktoponly produces values of it. Nothing shows the state yet.Changes
serve_state.rs(new):ServeState(Starting,Attached,Running,Restarting,Stopping,Stopped,Failed) andServeFailure(no local socket transport on this platform, notolebinary, a socket directory that is not the owner's, a serve of another protocol version, no credential the serve accepts, something on the socket that is not atole serve, a serve that did not start, one that gave up after repeated stops, one that could not be stopped).is_ready,version,owner_action(restart the serve, or retry) andconnection_status(the shell's status for a state).AttachedandRunningare ready and connected; every other state, every failure included, is unreachable, and a failure that needs a change of environment (a missing binary, a directory that is not private, an unsupported platform) calls for no button.strings.rs: plain-language wording for each state and failure, and for each owner action.CHANGELOG.md.Callers checked with grep:
ServeState,ServeFailureandOwnerActionare new, and nothing outside this crate uses them yet; the only change to existing code is additions to the string table.Testing
cargo test -p tole-desktop-model -p tole-desktop: 44 and 1 tests pass (the state and its strings are tested without a window).cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo clippy -p tole-cli --no-default-features --all-targets -- -D warnings: pass.bash scripts/test-desktop-check.sh(all cases) andbash scripts/desktop-check.sh all: pass.cargo check -p tole-desktop --features gpui: pass.cora review --no-llm --base origin/developaftercora index: no issues.scripts/review-local.shnot run (no LLM key); the CI Cora Review is the gate.cargo test --workspace.Part of #1029.