Task manager panel module and Alt+Tab window switcher
CI / test (push) Failing after 18s

- components/tasks: the 'tasks' module the panel and components.txt already named but whose source
  was missing. One pill per window in opening order (stable, not stacking order), focused lit,
  minimized dimmed, hover, titles shortened, pills shrink to fit; click focuses/restores.
  Tests that loaded it (task list, title-bar minimize/restore) pass again.
- compositor/host/switcher.mbt: hold Alt, press Tab: most-recently-used window list with the
  previous window selected; Tab/Shift+Tab/arrows move, releasing Alt switches (restoring a
  minimized window), Escape cancels. Tab is not forwarded to clients.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 03:39:19 -08:00
1 parent 095bbc5906
commit 70ad87f2d2
18 files changed
+1094 -3

No files matched your search

@@ -0,0 +1 @@
The window list, as shown by a task bar. `id` is an opaque host handle.
@@ -0,0 +1,44 @@
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
fn wasmImportListWindows(p0 : Int) = "moonplasma:desktop/windows@0.1.0" "list-windows"
///|
fn wasmImportFocusWindow(p0 : Int) = "moonplasma:desktop/windows@0.1.0" "focus-window"
///|
fn wasmImportAll(p0 : Int) = "moonplasma:desktop/windows@0.1.0" "all"
///|
fn wasmImportFocus(p0 : Int64) = "moonplasma:desktop/windows@0.1.0" "focus"
///|
extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int =
#|(func (param i32) (result i32) local.get 0 i32.load8_u)
///|
extern "wasm" fn mbt_ffi_ptr2str(ptr : Int, len : Int) -> String =
#|(func (param i32) (param i32) (result i32)
#| local.get 0
#| local.get 1 call $moonbit.init_array16
#| local.get 0)
///|
extern "wasm" fn mbt_ffi_free(position : Int) =
#|(func (param i32) local.get 0 call $moonbit.decref)
///|
extern "wasm" fn mbt_ffi_load64(offset : Int) -> Int64 =
#|(func (param i32) (result i64) local.get 0 i64.load)
///|
extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int =
#|(func (param i32) (result i32) (local i32)
#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc
#| local.tee 1 i32.const 0 call $moonbit.init_array8
#| local.get 1)
///|
extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int =
#|(func (param i32) (result i32) local.get 0 i32.load)
@@ -0,0 +1 @@
warnings = "-44"
@@ -0,0 +1,67 @@
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
pub(all) struct WindowInfo {
id : UInt; title : String; focused : UInt; minimized : UInt
}
///|
/// Richer, id-stable view for widgets that show more than a task bar (the Pulse widget).
pub(all) struct WindowDetail {
id : UInt64; title : String; app_id : String; focused : Bool
}
///|
pub fn list_windows() -> Array[WindowInfo] {
let return_area = mbt_ffi_malloc(8)
wasmImportListWindows(return_area);
let array : Array[WindowInfo] = [];
for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 {
let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 20)
let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 4), mbt_ffi_load32((iter_base) + 8))
array.push(WindowInfo::{id : (mbt_ffi_load32((iter_base) + 0)).reinterpret_as_uint(), title : result, focused : (mbt_ffi_load32((iter_base) + 12)).reinterpret_as_uint(), minimized : (mbt_ffi_load32((iter_base) + 16)).reinterpret_as_uint()})
}
mbt_ffi_free(mbt_ffi_load32((return_area) + 0))
let ret = array
mbt_ffi_free(return_area)
return ret
}
///|
/// Focus, raise (and un-minimize) a window.
pub fn focus_window(id : UInt) -> Unit {
wasmImportFocusWindow((id).reinterpret_as_int());
}
///|
pub fn all() -> Array[WindowDetail] {
let return_area = mbt_ffi_malloc(8)
wasmImportAll(return_area);
let array : Array[WindowDetail] = [];
for index = 0; index < (mbt_ffi_load32((return_area) + 4)); index = index + 1 {
let iter_base = (mbt_ffi_load32((return_area) + 0)) + (index * 32)
let result = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 8), mbt_ffi_load32((iter_base) + 12))
let result0 = mbt_ffi_ptr2str(mbt_ffi_load32((iter_base) + 16), mbt_ffi_load32((iter_base) + 20))
array.push(WindowDetail::{id : (mbt_ffi_load64((iter_base) + 0)).reinterpret_as_uint64(), title : result, app_id : result0, focused : (mbt_ffi_load8_u((iter_base) + 24) != 0)})
}
mbt_ffi_free(mbt_ffi_load32((return_area) + 0))
let ret = array
mbt_ffi_free(return_area)
return ret
}
///|
/// Raise and focus a window (restoring it if minimized).
pub fn focus(id : UInt64) -> Unit {
wasmImportFocus((id).reinterpret_as_int64());
}