fix(todo): the table's columns keep apart (ADR 0033, D36)

Narrower columns, each with a margin, so that a task keeps its room beside
the task pane and no cell runs into the next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-06 20:00:32 +01:00
commit 7c5cfc6021
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -18,10 +18,11 @@ const projectTableMinWidth = 720.0;
/// section, and its tasks.
typedef TableGroup = ({Widget? heading, List<OpenTask> tasks});
const _dateWidth = 148.0;
const _deadlineWidth = 120.0;
const _priorityWidth = 112.0;
const _labelsWidth = 180.0;
const _dateWidth = 130.0;
const _deadlineWidth = 110.0;
const _priorityWidth = 100.0;
const _labelsWidth = 140.0;
const _cellEnd = EdgeInsetsDirectional.only(end: 8);
const _rowPadding = EdgeInsets.symmetric(horizontal: 12);
/// A project's tasks as a table (ADR 0033, D36), for wide windows: their
@ -53,12 +54,12 @@ class const ProjectTable({required final List<TableGroup> groups, super.key})
task: Padding(
// Past the check, under the tasks' titles.
padding: const EdgeInsetsDirectional.only(start: 48),
child: Text(l10n.taskColumnTask, style: style),
child: _heading(l10n.taskColumnTask, style),
),
date: Text(l10n.taskColumnDate, style: style),
deadline: Text(l10n.taskColumnDeadline, style: style),
priority: Text(l10n.priorityTitle, style: style),
labels: Text(l10n.labelsTitle, style: style),
date: _heading(l10n.taskColumnDate, style),
deadline: _heading(l10n.taskColumnDeadline, style),
priority: _heading(l10n.priorityTitle, style),
labels: _heading(l10n.labelsTitle, style),
),
),
),
@ -86,6 +87,9 @@ class const ProjectTable({required final List<TableGroup> groups, super.key})
}
}
Widget _heading(String text, TextStyle? style) =>
Text(text, maxLines: 1, overflow: TextOverflow.ellipsis, style: style);
/// A row's cells at the table's widths, the task's taking what is left.
class const _Columns({
required final Widget task,
@ -97,10 +101,21 @@ class const _Columns({
@override
Widget build(BuildContext context) => Row(
children: [
Expanded(child: task),
SizedBox(width: _dateWidth, child: date),
SizedBox(width: _deadlineWidth, child: deadline),
SizedBox(width: _priorityWidth, child: priority),
Expanded(
child: Padding(padding: _cellEnd, child: task),
),
SizedBox(
width: _dateWidth,
child: Padding(padding: _cellEnd, child: date),
),
SizedBox(
width: _deadlineWidth,
child: Padding(padding: _cellEnd, child: deadline),
),
SizedBox(
width: _priorityWidth,
child: Padding(padding: _cellEnd, child: priority),
),
SizedBox(width: _labelsWidth, child: labels),
],
);