8000 feat(tasks): add Kanban board view mode by ahmet-cetinkaya · Pull Request #284 · ahmet-cetinkaya/whph · GitHub
[go: up one dir, main page]

Skip to content

feat(tasks): add Kanban board view mode - #284

Merged
ahmet-cetinkaya merged 5 commits into
mainfrom
feat/kanban-board-view
Jun 5, 2026
Merged

ahmet-cetinkaya merged 5 commits into
mainfrom
feat/kanban-board-view

Conversation

@ahmet-cetinkaya
@ahmet-cetinkaya ahmet-cetinkaya commented Jun 5, 2026 •
Copy link
Copy Markdown
Owner

🚀 Motivation and Context

This PR introduces a new horizontal Kanban board view for tasks, allowing users to switch between the existing list layout and a new visual board layout. The board view supports grouping tasks by any of the available sort fields (priority, status, planned date, deadline, tags, etc.) and renders each group as a vertical column with draggable task cards.

⚙️ Implementation Details

New Components:

  • TaskBoardView — horizontal scrolling board with per-group columns, using custom drag-and-drop (no external kanban package due to dependency conflicts with the existing widget tree).
  • TaskViewMode enum (list, board) for toggling between layouts.

Modified Components:

  • TaskList now accepts a viewMode parameter; renders the board widget when board mode is selected.
  • TaskListOptions adds a view-mode toggle button (icons: view_kanban_outlined / view_list_outlined) with translated tooltips.
  • TaskListOptionSettings persists the user's preferred view mode across sessions.
  • TasksPage, TaskDetailsPage thread the view mode through state and pass an onAddToGroup callback that pre-fills the correct task properties (priority, dates, estimated time, tag) when adding to a specific column.

Task Grouping Helpers:

  • Added reverse-mapping helpers in TaskGroupingHelper (priorityFromGroupKey, isCompletedFromGroupKey, tagNameFromGroupKey, dateFromGroupKey, durationFromGroupKey) so the add-to-group dialog can derive initial task values from the column key.
  • Async tag-id resolution for tag-grouped columns (_resolveTagIdByName).

Cross-Column Drag-and-Drop:

  • Cross-column moves are persistable for Status (via CompleteTaskCommand) and Priority (via SaveTaskCommand).
  • Non-persistable groupings (dates, tags, title) snap back after cross-column drops.
  • Within-column reordering works for all groupings when useCustomOrder is enabled.

Localization:

  • Added boardViewTooltip, listViewTooltip, addToColumnTooltip translation keys.

Test Fix:

  • Added a testMode parameter to TaskCard to bypass the PlatformUtils.isMobile check in widget tests, restoring 14 previously-failing swipe-to-complete tests.

📋 Checklist for Reviewer

  • Tests passed locally.
  • Commit history is clean and descriptive.
  • Documentation updated (if applicable).
  • Code quality standards were met (e.g., linter passed).

🔗 Related

  • Closes the kanban 8000 board view feature request.

Introduces a new horizontal Kanban board view for tasks, allowing users to
switch between list and board layouts.

- Add `TaskBoardView` component using `boardview` package.
- Implement `TaskViewMode` enum (list, board).
- Update `TaskList` and `TaskListOptions` to support view mode switching.
- Integrate view mode persistence in `TaskListOptionSettings`.
- Add localization support for board view and tooltips.
- Update `TasksPage`, `MarathonPage`, and `TaskDetailsPage` to support the new view.
- Add helper logic for task grouping and column mapping in `TaskGroupingHelper`.
@ahmet-cetinkaya ahmet-cetinkaya added the enhancement New feature or request label Jun 5, 2026
@ahmet-cetinkaya ahmet-cetinkaya self-assigned this Jun 5, 2026
@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a Kanban board view (TaskBoardView) for tasks, allowing users to toggle between list and board layouts across several pages, including TodayPage, TasksPage, TaskDetailsPage, and MarathonPage. It also adds support for drag-and-drop task updates across columns with reverse-mapping helpers. Feedback on these changes highlights a potential runtime crash in TaskBoardView due to unsafe null assertions (!), code duplication of the _resolveTagIdByName helper across multiple files, and a layout regression on the TodayPage caused by replacing CustomScrollView with a SingleChildScrollView containing hardcoded list heights.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

_onDropItem was validating the destination item index against the target
column's length. A cross-column drop into an empty or shorter column
produces a drop index >= that column's length — a valid insertion point
that was being rejected, silently preventing the property change from
being persisted.

Split the single bounds check into _isSourceInBounds (source must be an
existing card) and _isColumnInBounds (destination only needs a valid
column index). Also clamped the within-column reorder index after the
removeAt to account for the narrowed bounds.
The boardview package renders its live drag preview by mutating the
BoardList/BoardItem instances in place. build() regenerated those
instances on every rebuild, so any rebuild mid-drag (incoming task-update
event, timer tick, parent rebuild) handed the package fresh lists and
discarded its in-progress preview — snapping the dragged card back to its
origin.

Cache the built lists and reuse the same instances while a drag is active:
onStartDragItem sets _isDragging, build() returns the cached lists instead
of rebuilding, didUpdateWidget preserves the cache mid-drag, and onDropItem
clears it so the next rebuild reflects fresh data. Verified against the
package that onPointerUp always fires onDropItem, so the flag never sticks.
Restores CustomScrollView with SliverList for today_page list mode,
removing the regression introduced by the kanban PR that replaced it
with SingleChildScrollView and hardcoded SizedBox heights (300/400).

Board mode still requires a bounded height for the horizontal-scroll
BoardView widget; replaced the magic numbers with 60% of screen height
via MediaQuery so it adapts across device sizes.
@ahmet-cetinkaya
ahmet-cetinkaya marked this pull request as ready for review June 5, 2026 16:25
The translation analysis CI test flagged 21 untranslated strings — all
were the new board.cross_column_move_not_supported key left as English
copy in every non-English locale file.
@ahmet-cetinkaya
ahmet-cetinkaya merged commit e65fe8e into main Jun 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0