Skip to content

[CTX-0257] Workspace ops entry: keys/ctl/tabline per DEC-0034 - #433

Merged
Xuepoo merged 4 commits into
mainfrom
ctx-0257/feat-workspace-ops-entry
Sep 8, 2026
Merged

Xuepoo merged 4 commits into
mainfrom
ctx-0257/feat-workspace-ops-entry

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: ux | Labels: feat,area:ux,P1 | Milestone: v0.1.0 | RFC: DEC-0034 | Task: CTX-0257

Closes #432

Entry-only workspace ops (tiling-first, no float; move/resize/mouse/drag are follow-ups):

Keys (39-chord table: 35 identities preserved, alt+n/-/=/tab new):

  • Alt+N new, Alt+1..9 jump, Alt+-/= prev/next, Alt+Tab last-used (MRU),
    Alt+W close with kill-confirm (pending + repeat-to-confirm, Esc cancels;
    idle closes immediately; never silent kill).
  • close_view/focus: stay parseable + user-bindable (no longer default-bound).

State: Runtime-owned slots (stash/load, seq MRU, >=1 invariant),
pure workspaceline_text (names/indices/marker/count), present overlay
banner for the close arm, Esc cancels via the runtime key path.

ctl: workspace list/new/close/focus (scopes view.inspect / view.manage /
terminal.manage+elevation; exits 2/7/8 per convention); help updated.

Evidence: full cargo test --workspace --all-targets --locked 99 suites
green; windows-gnu check green; clippy/fmt/actionlint/markdownlint green.
Headless proofs incl. real pane-session kill. Window-live owed
(recording/ctx-0257/owed-live-note.md, uncommitted captures in
recording/ctx-0257/). Pre-existing flakes noted (poll_and_tick fails on
pristine main; socketpair parallel-load flake).

…tl/tabline per DEC-0034

Alt+N new, Alt+1..9 workspace jump, Alt+-/= prev/next, Alt+Tab
last-used, Alt+W close with kill-confirm (pending-confirm + repeat to
confirm, Esc cancels, idle closes immediately; never silent kill).
Runtime-owned slots with MRU, pure workspaceline render, present overlay
banner, ctl workspace list/new/close/focus with scope-gated exits.
@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 8, 2026
@Xuepoo Xuepoo added feat Feature P1 Priority: high area:ux labels Sep 8, 2026
@Xuepoo

Xuepoo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Fix: CI flake root cause (Linux Wayland, run 34268111868)

Not stale workspace/mod_key assertions — outputs were never reached. Both failures are the same wall-clock flake in bitty-lua:

  • tests::cli_flag_wins_over_file_wins_over_default (main.rs:6140): parse_lua_config('return { theme = "dark" }') -> InvalidInput: config exceeded Lua budgets (suspended: WallClockExceeded { elapsed_ms: 50, budget_ms: 50 })
  • tests::config_check_subcommand_good_and_broken_files (main.rs:7567): same budget error on the good file -> config check returned 2, expected 0.

Root cause: LuaVm::drive_chunk started the 50 ms RC-1 wall timer before Closure::load. A trivial chunk executes in microseconds, but under full-suite parallel load (252 tests) the thread can sit descheduled around compile for the whole budget and suspend before stepping once. PR #433 only exposed it (bigger suite = more contention); it touches no Lua/config-output code.

Fix (8ee5b70, crates/bitty-lua/src/lib.rs): start the execution wall-clock after chunk load succeeds. The 50 ms budget still bounds VM execution (same as the fuel budget); compile inputs stay bounded at call sites (config 64 KiB/2048 lines; plugin events 8 KiB), so no unbounded work is hidden. Infinite-loop suspension tests still pass — execution enforcement unchanged.

Verification: bitty-app bin 252/252 (10+ consecutive runs), bitty-lua 31+17, bitty-config 155, bitty-plugin-host all green; cargo fmt --check, clippy -D warnings clean.

Observed, out of scope: ctl::tests::control_socketpair_roundtrip_headless_live_instance flaked once locally (~1/12 runs); that path never touches the Lua VM (no Lua calls in ctl.rs) — pre-existing socket/queue timing race, suggested follow-up. Windows job failure is the known ConPTY-unsupported platform gate, also unrelated.

@Xuepoo

Xuepoo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Windows CI fix (run 34270129363): gated POSIX-only test chrome_workspace_close_live_pends_esc_cancels_repeat_kills + its esc_press helper behind #[cfg(unix)] — it spawns /bin/sh, absent on windows-latest (same class as CTX-0227). Chose the gate over a cmd /C equivalent (not one line). Verified: cargo test -p bitty-app --bin bitty chrome_keys 20 passed on Linux; cargo check --target x86_64-pc-windows-gnu -p bitty-app --all-targets clean (only pre-existing escaped-newline warning in main.rs); fmt clean. Commit 23c5378. No merge — awaiting review + CI.

…to unix (Windows CI)

live_close_needs_repeat_confirm_and_kills and
pending_arm_survives_switch_and_dies_with_workspace spawn a real
/bin/sh pane; the Windows ConPTY backend is unimplemented so spawn
fails and expect() panics. Same class as the chrome_keys.rs POSIX
test already gated on this branch.
@Xuepoo

Xuepoo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Windows CI fix (run 34271753601 follow-up): live_close_needs_repeat_confirm_and_kills and pending_arm_survives_switch_and_dies_with_workspace spawn a real /bin/sh pane, but the Windows ConPTY backend is unimplemented so spawn fails and expect() panics. Gated both tests #[cfg(unix)] (commit 4e8283b), same class as the chrome_keys.rs POSIX test already gated on this branch. No helper needed gating (fresh() is shared by all tests). Swept the rest of the branch's new workspace/ctl test code — no other unconditional live-spawns (new ctl tests are pure arg-parsing).

Verification: cargo test -p bitty-runtime --lib 196 passed / 0 failed on Linux; cargo check --target x86_64-pc-windows-gnu -p bitty-runtime --all-targets no errors (one pre-existing unused_imports warning in tests/panel_live_framehash.rs, untouched by this change); cargo fmt --check clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ux feat Feature P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workspace ops entry: keys/ctl/tabline (Alt+N/Number/-/+/Tab/W per DEC)

1 participant