open the decision reader without re-contributing its tab

The decisions extension tore down and re-contributed the decisions.detail
context-panel tab on every selection, racing the view's own subscription and
leaving the panel unrevealed — so clicking a decision often did nothing. Match
the working ticket panel: contribute the tab once (static), and on selection
just reveal the context panel and activateTab; DecisionDetailView loads via its
existing subscription.

T-188.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-31 16:16:55 +02:00
co-authored by Claude
parent c56b60622b
commit d0e169eba2
3 changed files with 325 additions and 10 deletions
+1 -10
View File
@@ -21,16 +21,7 @@ class DecisionsExtension extends ClideExtension {
@override
Future<void> activate(ClideExtensionContext ctx) async {
_sub = ctx.messages.subscribe(publisher: id, channel: 'selection').listen((msg) {
final selectedId = msg.data['id'] as String?;
if (selectedId == null) return;
ctx.panels.uncontribute('decisions.detail');
ctx.panels.contribute(TabContribution(
id: 'decisions.detail',
slot: Slots.contextPanel,
title: 'Decision',
icon: PhosphorIcons.lightbulb,
build: (_) => DecisionDetailView(initialId: selectedId),
));
if (msg.data['id'] is! String) return;
ctx.arrangement.setVisible(Slots.contextPanel, true);
ctx.arrangement.setCollapsed(Slots.contextPanel, false);
ctx.panels.activateTab(Slots.contextPanel, 'decisions.detail');