From d811a702d6c09361a04ef4bd53aa045e0ba43178 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Thu, 23 Apr 2026 11:32:19 +0200 Subject: [PATCH] remove decisions/tickets tabs from pql panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Decisions and tickets are now top-level sidebar sections with their own extensions and filter boxes. The pql panel keeps only Files and Query — its own surfaces. Removed loadDecisions, loadTickets, _DecisionRow, _TicketColumn from pql controller and view. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/builtin/pql/src/pql_controller.dart | 41 +-------- lib/builtin/pql/src/pql_panel_view.dart | 106 ------------------------ 2 files changed, 1 insertion(+), 146 deletions(-) diff --git a/lib/builtin/pql/src/pql_controller.dart b/lib/builtin/pql/src/pql_controller.dart index 48b6fdbf..1ce1056f 100644 --- a/lib/builtin/pql/src/pql_controller.dart +++ b/lib/builtin/pql/src/pql_controller.dart @@ -9,7 +9,7 @@ import 'dart:async'; import 'package:clide/kernel/kernel.dart'; import 'package:flutter/foundation.dart'; -enum PqlView { files, query, decisions, tickets } +enum PqlView { files, query } class PqlController extends ChangeNotifier { PqlController({required this.ipc}); @@ -40,10 +40,6 @@ class PqlController extends ChangeNotifier { switch (v) { case PqlView.files: unawaited(loadFiles()); - case PqlView.decisions: - unawaited(loadDecisions()); - case PqlView.tickets: - unawaited(loadTickets()); case PqlView.query: break; } @@ -91,41 +87,6 @@ class PqlController extends ChangeNotifier { notifyListeners(); } - Future loadDecisions() async { - _loading = true; - notifyListeners(); - - await ipc.request('pql.decisions.sync'); - final r = await ipc.request('pql.decisions.list'); - - _loading = false; - if (!r.ok) { - _error = r.error?.message; - notifyListeners(); - return; - } - _error = null; - _results = _castList(r.data['decisions']); - notifyListeners(); - } - - Future loadTickets() async { - _loading = true; - notifyListeners(); - - final r = await ipc.request('pql.tickets.board'); - - _loading = false; - if (!r.ok) { - _error = r.error?.message; - notifyListeners(); - return; - } - _error = null; - _results = _castList(r.data['columns']); - notifyListeners(); - } - Future loadPlanStatus() async { final r = await ipc.request('pql.plan.status'); if (r.ok) { diff --git a/lib/builtin/pql/src/pql_panel_view.dart b/lib/builtin/pql/src/pql_panel_view.dart index f60381f7..38c32dc5 100644 --- a/lib/builtin/pql/src/pql_panel_view.dart +++ b/lib/builtin/pql/src/pql_panel_view.dart @@ -90,10 +90,6 @@ class _PqlPanelViewState extends State { for (final f in c.results) _FileRow(entry: f), if (c.view == PqlView.query) for (final r in c.results) _QueryResultRow(entry: r), - if (c.view == PqlView.decisions) - for (final d in c.results) _DecisionRow(entry: d), - if (c.view == PqlView.tickets) - for (final col in c.results) _TicketColumn(column: col), ], ), ), @@ -150,8 +146,6 @@ class _ViewTabs extends StatelessWidget { static String _tabLabel(PqlView v) => switch (v) { PqlView.files => 'Files', PqlView.query => 'Query', - PqlView.decisions => 'Decisions', - PqlView.tickets => 'Tickets', }; } @@ -214,103 +208,3 @@ class _QueryResultRow extends StatelessWidget { ); } } - -class _DecisionRow extends StatelessWidget { - const _DecisionRow({required this.entry}); - final Map entry; - - @override - Widget build(BuildContext context) { - final tokens = ClideTheme.of(context).surface; - final id = entry['id'] as String? ?? ''; - final title = entry['title'] as String? ?? ''; - final type = entry['type'] as String? ?? ''; - final domain = entry['domain'] as String? ?? ''; - - final Color idColor = switch (type) { - 'confirmed' => tokens.statusSuccess, - 'question' => tokens.statusWarning, - 'rejected' => tokens.statusError, - _ => tokens.sidebarForeground, - }; - - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 2), - child: Row( - children: [ - SizedBox( - width: 44, - child: ClideText(id, fontSize: clideFontMono, color: idColor, - fontFamily: clideMonoFamily), - ), - const SizedBox(width: 4), - Expanded( - child: ClideText( - title, - maxLines: 1, - overflow: TextOverflow.ellipsis, - color: tokens.sidebarForeground, - ), - ), - ClideText(domain, fontSize: clideFontCaption, muted: true), - ], - ), - ); - } -} - -class _TicketColumn extends StatelessWidget { - const _TicketColumn({required this.column}); - final Map column; - - @override - Widget build(BuildContext context) { - final tokens = ClideTheme.of(context).surface; - final status = column['status'] as String? ?? ''; - final tickets = (column['tickets'] as List?) ?? const []; - if (tickets.isEmpty) return const SizedBox.shrink(); - - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: - const EdgeInsets.only(left: 12, right: 8, top: 8, bottom: 2), - child: ClideText( - '$status (${tickets.length})', - fontSize: clideFontCaption, - muted: true, - ), - ), - for (final t in tickets) - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 20, vertical: 2), - child: Row( - children: [ - SizedBox( - width: 44, - child: ClideText( - (t as Map)['id'] as String? ?? '', - fontSize: clideFontMono, - fontFamily: clideMonoFamily, - color: tokens.statusInfo, - ), - ), - const SizedBox(width: 4), - Expanded( - child: ClideText( - t['title'] as String? ?? '', - maxLines: 1, - overflow: TextOverflow.ellipsis, - color: tokens.sidebarForeground, - ), - ), - ], - ), - ), - ], - ); - } -}