Where
- `ttymap-tui/src/lua/api/imperative.rs:55-87` (`card.open`)
- `ttymap-tui/src/lua/api/imperative.rs:89-119` (`palette.open`)
What
Both `open` paths follow: `Id::next()` → `from_spec(lua.clone(), spec, "lua")` → push `Op::Push` to `ops` → return handle. Differ only in the `Component` type built (`LuaCardComponent` vs `LuaPaletteProvider`).
Proposal
`fn install_open_for<C: Component>(lua, ops, build: impl Fn(Lua, Table) -> mlua::Result) -> mlua::Function`. Both surfaces register through it.
Where
What
Both `open` paths follow: `Id::next()` → `from_spec(lua.clone(), spec, "lua")` → push `Op::Push` to `ops` → return handle. Differ only in the `Component` type built (`LuaCardComponent` vs `LuaPaletteProvider`).
Proposal
`fn install_open_for<C: Component>(lua, ops, build: impl Fn(Lua, Table) -> mlua::Result) -> mlua::Function`. Both surfaces register through it.