apache / apache/maka

refactor(desktop): register Workbar tab surface descriptors

Open
#4,744 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
715

Description

Parent tracker: #4331

## Problem

`WorkbarSurface` currently repeats the tab-kind authority across separate conditionals for labels, icons, launcher entries, and panel rendering. Adding another first-party surface requires editing several parallel branches, and the fallback branch implicitly assumes every remaining kind is `side-chat`.

This is the remaining surface switch called out by #4331. It makes the current first-party tab set harder to audit and is the wrong boundary for future panel registration.

## Desired outcome

Introduce one typed registry of first-party Workbar tab surface descriptors and use it for the existing label, icon, launcher, and panel-rendering decisions.

The registry must remain exhaustive over `SessionWorkbarTabKind`; an added kind should fail typecheck or focused tests until its descriptor is supplied. Dynamic Side Conversation and Terminal instances may keep their existing resource-specific state, but their presentation and rendering entry points should be registered through the same typed model.

## Scope

- Replace the repeated label/icon/launcher/render branching in the Workbar surface with typed descriptors.
- Preserve current lazy loading, tab IDs, ordinals, placement, preview/pin behavior, focus, close/reorder actions, and localized copy.
- Add focused tests proving descriptor completeness and unchanged rendering for singleton and dynamic tabs.
- Reduce the corresponding renderer architecture or duplication debt where the repository ratchets track it.

## Non-goals

- A public plugin API or third-party panel loading.
- Changing Side Conversation lifecycle, durability, or permissions.
- Changing Terminal creation/restoration.
- Redesigning the Workbar UI.

## Verification

Run the focused Desktop Workbar tests, Desktop typecheck, renderer architecture checks, and provide before/after UI evidence if the rendered markup changes.

_Issue drafted with OpenAI Codex assistance on behalf of @testikun._

Contributor guide

Open the contributing guide

Research direction

Start at the WorkbarSurface entry point and trace SessionWorkbarTabKind through the existing label, icon, launcher, and panel-rendering decisions. Run the focused Desktop Workbar tests, Desktop typecheck, and renderer architecture checks. Done means descriptors are exhaustive and singleton and dynamic tabs retain their current rendering and behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
desktop
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.