Files
clide/lib/builtin/tickets/src/extension.dart
T
jpmschweitzerandClaude Opus 4.8 17d22b9571 refactor(i18n): route planning-pane labels through the catalog (T-467)
Migrate the user-facing strings in builtin.tickets, builtin.pql,
builtin.decisions, and builtin.problems (list/detail views, section headers,
filters, empty/loading/error states, type chips) to ClideSettings.i18n; extend
each extension's catalog. The detail/links tabs that had a bare title now wire
titleKey + i18nNamespace so the tab title resolves too. Context threaded into
the static label helpers. No en_US behaviour change (D-21).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 22:14:01 +02:00

62 lines
1.9 KiB
Dart

import 'dart:async';
import 'package:clide/builtin/tickets/src/ticket_detail_view.dart';
import 'package:clide/builtin/tickets/src/tickets_view.dart';
import 'package:clide/extension/extension.dart';
import 'package:clide/kernel/kernel.dart';
import 'package:clide/widgets/widgets.dart';
class TicketsExtension extends ClideExtension {
@override
String get id => 'builtin.tickets';
@override
String get title => 'Tickets';
@override
String get version => '0.6.0';
@override
List<String> get dependsOn => const [];
StreamSubscription<Message>? _sub;
@override
Future<void> activate(ClideExtensionContext ctx) async {
// Ensure the retained nav exists so it records selections + emits
// loads whether or not the detail view is mounted (T-199/D-81).
ctx.readerNav.navFor(id, dataKey: 'id');
// Reveal the static detail tab on selection — no per-click
// uncontribute/contribute churn (the T-188 anti-pattern). The nav
// owns load + history.
_sub = ctx.messages.subscribe(publisher: id, channel: 'selection').listen((msg) {
if (msg.data['id'] is! String) return;
ctx.arrangement.setVisible(Slots.contextPanel, true);
ctx.arrangement.setCollapsed(Slots.contextPanel, false);
ctx.panels.activateTab(Slots.contextPanel, 'tickets.detail');
});
}
@override
Future<void> deactivate() async => _sub?.cancel();
@override
List<ContributionPoint> get contributions => [
TabContribution(
id: 'tickets.panel',
slot: Slots.sidebar,
title: 'Tickets',
titleKey: 'tab.title',
i18nNamespace: id,
icon: PhosphorIcons.byName('ticket'),
build: (_) => const TicketsView(),
),
TabContribution(
id: 'tickets.detail',
slot: Slots.contextPanel,
title: 'Ticket',
titleKey: 'tab.detail.title',
i18nNamespace: id,
icon: PhosphorIcons.byName('ticket'),
build: (_) => const TicketDetailView(),
),
];
}