remove decisions/tickets tabs from pql panel
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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<void> 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<void> 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<void> loadPlanStatus() async {
|
||||
final r = await ipc.request('pql.plan.status');
|
||||
if (r.ok) {
|
||||
|
||||
@@ -90,10 +90,6 @@ class _PqlPanelViewState extends State<PqlPanelView> {
|
||||
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<String, Object?> 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<String, Object?> 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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user