Skip to content

refactor(detail): modularize the task detail page and fix its save flow - #4

Closed
BrawlerXull wants to merge 4 commits into
mainfrom
refactor/detail-route-modular
Closed

BrawlerXull wants to merge 4 commits into
mainfrom
refactor/detail-route-modular

Conversation

@BrawlerXull

Copy link
Copy Markdown
Owner

Split DetailRouteView into page components (app bar, body, save button, dialogs) matching the settings/about modules, and moved the page logic into DetailRouteController. All widgets in the module are now stateless; the tag editor's state lives in the controller.

Bug fixes:

  • The save button now appears as soon as an edit is made (it was only evaluated on a full page rebuild).
  • Submit in the review dialog now saves and closes the page. Get.back() after Get.snackbar only dismissed the snackbar, leaving the dialog open.
  • Save/"task not found" messages use ScaffoldMessenger: Get.snackbar throws "No Overlay widget found" on current Flutter versions.
  • Editing an existing due/wait/until date works again; the picker parsed the display string with a mismatched format and threw FormatException.
  • Opening the page with bad arguments or an unknown task closes it with a message instead of crashing.
  • Saving is wrapped in error handling and reports failures.

Cleanup:

  • Shared AttributeCard replaces the per-widget card boilerplate; each editor has its own file (dateTimePicker.dart -> date_time_widget.dart, start/project/tags route split out). Dead code and StatusWidgetData removed.
  • TaskAttribute enum replaces raw attribute-name strings.
  • WillPopScope -> PopScope; the tour starts once instead of every build.
  • New AppLogger (tagged, levelled, persisted via debugPrint) replaces the mix of print/debugPrint/loggy on this page.
  • Hardcoded strings localized; adds taskUpdateFailed, taskNotFound and pleaseEnterATag in all 8 languages.
  • Text controllers for project/tag editing are owned and disposed by the controller.

Adds 26 controller and widget tests under test/modules/detail_route.

Description

Please include a summary of the change and which issue is fixed. List any dependencies that are required for this change.

Fixes #(issue_no)

Replace issue_no with the issue number which is fixed in this PR

Screenshots

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

BrawlerXull and others added 4 commits October 1, 2026 01:10
Split DetailRouteView into page components (app bar, body, save button,
dialogs) matching the settings/about modules, and moved the page logic
into DetailRouteController. All widgets in the module are now stateless;
the tag editor's state lives in the controller.

Bug fixes:
- The save button now appears as soon as an edit is made (it was only
  evaluated on a full page rebuild).
- Submit in the review dialog now saves and closes the page. Get.back()
  after Get.snackbar only dismissed the snackbar, leaving the dialog open.
- Save/"task not found" messages use ScaffoldMessenger: Get.snackbar
  throws "No Overlay widget found" on current Flutter versions.
- Editing an existing due/wait/until date works again; the picker parsed
  the display string with a mismatched format and threw FormatException.
- Opening the page with bad arguments or an unknown task closes it with
  a message instead of crashing.
- Saving is wrapped in error handling and reports failures.

Cleanup:
- Shared AttributeCard replaces the per-widget card boilerplate; each
  editor has its own file (dateTimePicker.dart -> date_time_widget.dart,
  start/project/tags route split out). Dead code and StatusWidgetData
  removed.
- TaskAttribute enum replaces raw attribute-name strings.
- WillPopScope -> PopScope; the tour starts once instead of every build.
- New AppLogger (tagged, levelled, persisted via debugPrint) replaces the
  mix of print/debugPrint/loggy on this page.
- Hardcoded strings localized; adds taskUpdateFailed, taskNotFound and
  pleaseEnterATag in all 8 languages.
- Text controllers for project/tag editing are owned and disposed by the
  controller.

Adds 26 controller and widget tests under test/modules/detail_route.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Found while testing the refactored detail page on a device:

- The review dialog's Submit button was drawn in primaryBackgroundColor
  (carried over from the old view), making it nearly invisible on the
  dialog. It now uses primaryTextColor, and the dialog uses
  dialogBackgroundColor like the unsaved-changes dialog.
- The tags card used a different card/tile colour from every other card,
  showing square corners and a mismatched background. All cards now
  share the same style.
- The review dialog printed raw values ("null", "2026-10-20
  21:14:00.000"). Values are now formatted exactly like the cards via a
  shared formatAttributeValue helper.

Adds regression tests for dialog button colours, card styling and the
summary formatting.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@BrawlerXull BrawlerXull closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant