refactor(org): drop legacy adapterLabels / claude_compat fallback; unify connector label resolution
OrgChart and AgentRoster both carried a `claude_compat`-prefix fallback chained against `adapterLabels[connectorId] ?? connectorId` to paper over the pre-pi-mono connector id space (claude_local / codex_local / gemini_local / claude_compat_2..10). The migration to pi-mono's catalog retired those ids months ago — the fallback is dead code that still runs `String.prototype.startsWith` on every render and forks the label resolution into two subtly different shapes in two files. Replaced with `formatConnectorLabel(connector, fallbackId)` in lib/formatters.ts, used by both OrgChart and AgentRoster. Also in this commit (typography polish bundled because touching the same render paths): - OrgChart connector label: 9px uppercase tracking-0.08em → 11px tracking-tight. The 9px chip was unreadable at default zoom. - OrgChart zoom controls: `+` / `−` / "Fit" mixed text + character ops replaced with Plus / Minus / CornersOut icons (imported from the existing icon barrel) + a focus-visible ring for keyboard users. No rendering changes for the non-cosmetic path (status dots, card layout, edges). The removed `adapterLabels` map was exported from orgTreeLayout.ts and had no other importers. Covers J1 / J3 / J4 / J6 from the team-page audit.
This commit is contained in:
1 parent
41132e2da4
commit
50a7196b3e
5 files changed
+29
-26
No files matched your search
@@ -46,6 +46,19 @@ export function getAgentInitials(name: string): string {
|
||||
.toUpperCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the user-visible label for a connector reference. The org chart
|
||||
* and agent roster share this so there is one definition of "what do I
|
||||
* show for `agent.connectorId`?" — prefer the registered label, fall
|
||||
* back to the raw id when a connector row is missing (e.g. pending sync).
|
||||
*/
|
||||
export function formatConnectorLabel(
|
||||
connector: { label?: string | null; id?: string | null } | null | undefined,
|
||||
fallbackConnectorId: string,
|
||||
): string {
|
||||
return connector?.label || connector?.id || fallbackConnectorId;
|
||||
}
|
||||
|
||||
export function formatDuration(seconds: number): string {
|
||||
if (seconds < 60) return `${seconds}s`;
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
|
||||
Reference in new issue
Block a user