Skip to content

refactor(lua): extract install_open_for helper for ttymap.api.{card,palette}.open #325

Description

@Kohei-Wada

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumLong-term maintenancerefactorCode refactoring without behavior change

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions