focus-flow/apps/focus_flow_flutter/lib/app/scheduler_app_composition.dart
pyr0ball c357b7d97d
Some checks failed
CI / test (macos-latest) (push) Has been cancelled
CI / test (ubuntu-latest) (push) Has been cancelled
CI / test (windows-latest) (push) Has been cancelled
CI / package (macos-latest, macos) (push) Has been cancelled
CI / package (ubuntu-latest, linux) (push) Has been cancelled
CI / package (windows-latest, windows) (push) Has been cancelled
CI / test (macos-latest) (pull_request) Has been cancelled
CI / test (ubuntu-latest) (pull_request) Has been cancelled
CI / test (windows-latest) (pull_request) Has been cancelled
CI / package (macos-latest, macos) (pull_request) Has been cancelled
CI / package (ubuntu-latest, linux) (pull_request) Has been cancelled
CI / package (windows-latest, windows) (pull_request) Has been cancelled
feat(ui): wire sidebar Backlog nav and modal Move-to-Backlog/Break-up actions
Backend was already V1-complete for these paths (moveFlexibleToBacklog,
breakUpTask); this closes the UI-wiring gap identified in the V1
feature-complete audit.

- Add createBacklogController() to SchedulerAppComposition and implement it
  in PersistentSchedulerComposition (only the demo composition had one).
- Sidebar now switches the main content area between Today and Backlog via
  a real SidebarScreen enum instead of hardcoded onTap: () {} stubs.
- Task modal's "Backlog" quick-action reuses the existing onPushToBacklog
  wiring (same backend command as the Push menu's "Push to backlog").
- Add a break-up dialog (row-level title/priority/reward/duration per
  MVP-AC-11) and SchedulerCommandController.breakUpTask(), wired to the
  modal's "Break up" button.
- Fix a latent bug where the active sidebar nav item's key was hardcoded
  to nav-today-active regardless of which item was active.

Closes: Circuit-Forge/focus-flow#9
Closes: Circuit-Forge/focus-flow#12
Closes: Circuit-Forge/focus-flow#13
2026-07-06 01:46:59 -07:00

47 lines
1.6 KiB
Dart

// SPDX-FileCopyrightText: 2026 FocusFlow contributors
// SPDX-License-Identifier: AGPL-3.0-only
/// Defines the app composition protocol used by FocusFlow widgets.
library;
import 'package:scheduler_core/scheduler_core.dart';
import '../controllers/scheduler_command_controller.dart';
import '../controllers/scheduler_read_controller.dart';
import '../controllers/selected_date_controller.dart';
import '../controllers/today_screen_controller.dart';
/// Runtime-independent composition surface consumed by the app shell.
abstract interface class SchedulerAppComposition {
/// Human-readable label for the selected local date.
String get dateLabel;
/// Initial selected owner-local planning date.
CivilDate get initialDate;
/// Default project id used by quick-capture commands.
String get defaultProjectId;
/// Formats [date] for compact UI date labels.
String dateLabelFor(CivilDate date);
/// Creates the controller that owns the visible planning date.
SelectedDateController createSelectedDateController();
/// Creates the controller used by the compact Today screen.
TodayScreenController createTodayScreenController({
required SelectedDateController selectedDates,
});
/// Creates a read controller for the backlog screen.
UiReadController<BacklogQueryResult> createBacklogController();
/// Creates the command controller used by interactive scheduler controls.
SchedulerCommandController createCommandController({
required ReadRefresh refreshReads,
required SelectedDateReader selectedDate,
});
/// Releases resources owned by the composition.
Future<void> dispose();
}