Skip to content

feat(studio): workspace settings overlay#90

Merged
pbertsch merged 1 commit intomainfrom
feat/studio-workspace-settings
May 3, 2026
Merged

feat(studio): workspace settings overlay#90
pbertsch merged 1 commit intomainfrom
feat/studio-workspace-settings

Conversation

@pbertsch
Copy link
Copy Markdown
Contributor

@pbertsch pbertsch commented May 3, 2026

Summary

Adds a ⚙ toolbar button that opens a form for the four probe.yaml fields users actually touch. Saves write back to `probe.yaml` in the active workspace, preserving all other keys.

v0.7.1 PR 2 of 3.

Fields exposed

Form label YAML path Why this one
Agent port `agent.port` Default 48686; users only change for parallel runs or port conflicts
Default step timeout `defaults.timeout` Slow CI environments / heavy animations need longer than 30s
Preferred iOS UDID `device.ios_device_id` Avoid `--device` on every run when you have multiple sims
Preferred Android serial `device.android_device_id` Same as above for emulators

Deliberately tight — extending the field set is cheap once the plumbing exists, but landing a small form first beats arguing about which 20 fields to expose.

Implementation notes

  • Preserve unknown keys on save. `SaveWorkspaceSettings` reads the existing file as a raw `map[string]any` rather than as a `Config` struct, mutates only the four managed keys, and writes back. So a power user with `recipes_folder`, `cloud`, `plugins`, etc. keeps everything they had.
  • Empty fields are dropped, not zero-written. Clearing a field in the UI removes the key from `probe.yaml` (and removes the parent map if it goes empty), maintaining the convention that `probe.yaml` only lists fields the user explicitly set.
  • Validation runs before disk touch. `agent.port` is range-checked (0–65535); `defaults.timeout` is parsed as a Go duration. Invalid input → clear error, no half-written file.
  • No-workspace state. If the user opens settings before picking a workspace, the form is hidden and a hint shows to use 📂 first.

Test plan

  • `go build ./...` clean
  • `go test ./...` — full suite green
  • `cd studio && go vet ./...` clean
  • `tsc --noEmit` clean
  • Manual: empty workspace — settings on a workspace with no `probe.yaml`, save → file created with only the fields filled in.
  • Manual: existing workspace — settings on a workspace with rich `probe.yaml` (e.g. `tests/recipes`, custom `reports_folder`, etc.), save → those keys still present, only the four managed fields updated.
  • Manual: invalid input — port `70000` or timeout `5 weeks` → save fails with toast, no file write.

Adds a ⚙ toolbar button that opens a form for the four probe.yaml
fields users actually touch: agent.port, defaults.timeout,
device.ios_device_id, device.android_device_id.

Backend (studio/workspace_settings.go):
  LoadWorkspaceSettings reads probe.yaml via internal/config and
  surfaces the four managed fields. SaveWorkspaceSettings rereads
  the file as a raw map[string]any, mutates only the keys we manage,
  and writes back — so a power user with complex probe.yaml (cloud
  config, plugins, recipes_folder, etc.) doesn't lose anything by
  using the UI. Empty/zero fields are dropped from the YAML so we
  don't litter probe.yaml with `agent: {}` after the user clears a
  field.

Validation: agent.port range-checked, defaults.timeout parsed as a
Go duration before any disk write — invalid input fails fast with a
clear error.

Frontend: settings overlay matches the help/wifi modal shape;
Escape closes all three.

Deliberately scoped tight — extending the field set is cheap once
the plumbing exists, but landing a small form first beats arguing
about which 20 fields to expose.
@pbertsch pbertsch requested a review from a team as a code owner May 3, 2026 00:07
@pbertsch pbertsch merged commit 96fd2e2 into main May 3, 2026
14 checks passed
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