fix(todo): the hours' time now no longer overlaps an hour, and run down to the bar
The hours' column labelled 22:00 and, in red, the time now 22:12 over each other. As Todoist's (its screenshots at 21:50, 21:51, 21:55, 22:05, 22:09 and 22:10): an hour's label gives way while the time now is within nine minutes of it, either side, wherever the line at the time now is drawn (Today's Calendar, Upcoming's 3-day, the Inbox's 3-day), so at 21:51 to 22:09 the time now stands alone and at 21:50 and 22:10 both do (`hourLabelShown`). The hours left a strip as high as the add button empty below midnight, above the floating navigation bar. They run on down to the bar now, the day's end just above it and the hours scrolling on under it before, as Todoist's; the add button slides away as they scroll down. Where a phone's Plan covers their foot, they still end above it. Whats-New: The calendar's hours no longer show an hour over the time now, and run on down to the navigation bar. Whats-New-De: Die Stunden des Kalenders zeigen keine Stunde mehr über der aktuellen Uhrzeit und reichen bis zur Navigationsleiste. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
71b5337d21
commit
6c095fab47
3 changed files with 140 additions and 16 deletions
|
|
@ -84,7 +84,6 @@ class const ProjectCalendarView({
|
|||
if (view.calendarLayout == CalendarLayout.threeDay &&
|
||||
(state.projectOf(projectId)?.inbox ?? false)) {
|
||||
return HourGrid(
|
||||
foot: 0,
|
||||
coloring: TaskColoring.priority,
|
||||
calendarFor: calendarFor,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,13 @@ const _hourHeight = 60.0;
|
|||
/// How wide the hours' column is.
|
||||
const _gutter = 56.0;
|
||||
|
||||
/// Whether the label of [hour] shows in the hours' column, the time [now]
|
||||
/// (minutes after midnight) labelled there too where given: within nine
|
||||
/// minutes of it, either side, the hour's label gives way to it, as
|
||||
/// Todoist's (the developer's review, 7 Nov 2026: the two overlapped).
|
||||
bool hourLabelShown(int hour, {int? now}) =>
|
||||
now == null || (now - hour * 60).abs() > 9;
|
||||
|
||||
/// Days of hours (ADR 0033, D17, D30, as Todoist's): Upcoming's 3-day
|
||||
/// layout, or Today's Calendar, one day ([days] 1). Several days stand side
|
||||
/// by side from [onStart]'s day on, never before today, swiped or stepped
|
||||
|
|
@ -48,9 +55,12 @@ class const HourGrid({
|
|||
/// The hour at the top of the hours at first.
|
||||
final int firstHour = 7,
|
||||
|
||||
/// The room below the last hour, clear of the add button (and of Today's
|
||||
/// Plan over a phone's foot), above the navigation bar's cover.
|
||||
final double foot = 88,
|
||||
/// The room below the last hour above the navigation bar's cover: none,
|
||||
/// the hours running on down to the bar as Todoist's (the developer's
|
||||
/// review, 7 Nov 2026: a strip as high as the add button was left empty
|
||||
/// at the day's end, the button sliding away as the hours scroll on);
|
||||
/// the Plan's height where it covers a phone's foot.
|
||||
final double foot = 0,
|
||||
final ValueChanged<Day>? onStart,
|
||||
super.key,
|
||||
}) extends StatefulWidget {
|
||||
|
|
@ -147,6 +157,7 @@ class _HourGridState() extends State<HourGrid> {
|
|||
if (!(day < start)) (day, layOutDay(entries)),
|
||||
];
|
||||
final nowColor = paletteText(context, PaletteColor.cerise);
|
||||
final nowShown = shown.any((shown) => shown.$1 == today);
|
||||
return Column(
|
||||
children: [
|
||||
if (several)
|
||||
|
|
@ -280,17 +291,21 @@ class _HourGridState() extends State<HourGrid> {
|
|||
child: Stack(
|
||||
children: [
|
||||
for (var hour = 1; hour < 24; hour++)
|
||||
Positioned(
|
||||
top: hour * _hourHeight - 8,
|
||||
left: 8,
|
||||
child: Text(
|
||||
timeText(context, hour * 60),
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
if (hourLabelShown(
|
||||
hour,
|
||||
now: nowShown ? _now : null,
|
||||
))
|
||||
Positioned(
|
||||
top: hour * _hourHeight - 8,
|
||||
left: 8,
|
||||
child: Text(
|
||||
timeText(context, hour * 60),
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (shown.any((shown) => shown.$1 == today))
|
||||
if (nowShown)
|
||||
Positioned(
|
||||
top: _now / 60 * _hourHeight - 9,
|
||||
left: 2,
|
||||
|
|
|
|||
|
|
@ -100,13 +100,13 @@ mixin PlanHost<T extends StatefulWidget> on State<T> {
|
|||
kind: SidePaneKind.plan,
|
||||
widths: PersonScope.of<TodoPerson>(context).paneWidths,
|
||||
fallback: 340,
|
||||
main: grid(_grid, 88),
|
||||
main: grid(_grid, 0),
|
||||
pane: PlanPanel(
|
||||
projectIds: _projects,
|
||||
onProjects: projects,
|
||||
),
|
||||
)
|
||||
: grid(_grid, 88);
|
||||
: grid(_grid, 0);
|
||||
}
|
||||
// A phone's Plan over the hours' foot, above the floating bar; held
|
||||
// rows lower it to its heading, the hours free behind it.
|
||||
|
|
@ -115,7 +115,7 @@ mixin PlanHost<T extends StatefulWidget> on State<T> {
|
|||
const heading = 56.0;
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned.fill(child: grid(_grid, _sheet ? height : 88)),
|
||||
Positioned.fill(child: grid(_grid, _sheet ? height : 0)),
|
||||
if (_sheet)
|
||||
Positioned(
|
||||
left: 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue