fix(todo): the + is not dragged over a day's hours, in Today's Calendar and Upcoming's 3-day
There a tap, a click or a stretch dragged says when (the developer's review, 10 Nov 2026); Upcoming's agenda and the lists keep dragging it. Whats-New: In Calendar and 3-day, the + button no longer drags; tap the hours instead. Whats-New-De: In Kalender und 3 Tage lässt sich der +-Knopf nicht mehr ziehen; tippe stattdessen auf die Stunden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
8b862b2c1b
commit
f9cd30dd5e
3 changed files with 65 additions and 12 deletions
|
|
@ -437,9 +437,14 @@ class const NewTaskDropArea({
|
|||
|
||||
/// The button adding a task, above the navigation bar (ADR 0033, D2); it
|
||||
/// can be dragged onto the list to add the task there (D16), its place
|
||||
/// meanwhile a larger × where dropping it gives up.
|
||||
class const AddTaskButton({required final VoidCallback onPressed, super.key})
|
||||
extends StatelessWidget {
|
||||
/// meanwhile a larger × where dropping it gives up. Not [draggable] over
|
||||
/// the hours of a day, where a tap or a stretch dragged says when instead
|
||||
/// (the developer's review, 10 Nov 2026).
|
||||
class const AddTaskButton({
|
||||
required final VoidCallback onPressed,
|
||||
final bool draggable = true,
|
||||
super.key,
|
||||
}) extends StatelessWidget {
|
||||
/// The key of the × left in the button's place while it is dragged.
|
||||
static const cancelKey = ValueKey('add-task-cancel');
|
||||
|
||||
|
|
@ -447,6 +452,16 @@ class const AddTaskButton({required final VoidCallback onPressed, super.key})
|
|||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context);
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final button = FloatingActionButton(
|
||||
// Every tab keeps its own, alive beside the others: no hero flies.
|
||||
heroTag: null,
|
||||
tooltip: l10n.taskAddTitle,
|
||||
onPressed: onPressed,
|
||||
child: const Icon(LucideIcons.plus),
|
||||
);
|
||||
if (!draggable) {
|
||||
return button;
|
||||
}
|
||||
return Draggable<NewTaskDrag>(
|
||||
data: const NewTaskDrag(),
|
||||
dragAnchorStrategy: pointerDragAnchorStrategy,
|
||||
|
|
@ -487,13 +502,7 @@ class const AddTaskButton({required final VoidCallback onPressed, super.key})
|
|||
),
|
||||
),
|
||||
),
|
||||
child: FloatingActionButton(
|
||||
// Every tab keeps its own, alive beside the others: no hero flies.
|
||||
heroTag: null,
|
||||
tooltip: l10n.taskAddTitle,
|
||||
onPressed: onPressed,
|
||||
child: const Icon(LucideIcons.plus),
|
||||
),
|
||||
child: button,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,10 @@ class _TodayTabState() extends State<TodayTab> with PlanHost<TodayTab> {
|
|||
],
|
||||
floatingActionButton: calendar && planSheetOpen
|
||||
? null
|
||||
: AddTaskButton(onPressed: () => showQuickAdd(context, day: today)),
|
||||
: AddTaskButton(
|
||||
draggable: !calendar,
|
||||
onPressed: () => showQuickAdd(context, day: today),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
const KeysResetBanner(),
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ class _UpcomingTabState()
|
|||
floatingActionButton: planSheetOpen
|
||||
? null
|
||||
: AddTaskButton(
|
||||
draggable: upcoming.layout != UpcomingLayout.threeDay,
|
||||
onPressed: () => showQuickAdd(
|
||||
context,
|
||||
day: switch (_selected) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue