Skip to content

Add configurable widget display settings#22

Merged
tintinweb merged 11 commits into
tintinweb:masterfrom
jvortmann:tasks-list-improvements
May 30, 2026
Merged

Add configurable widget display settings#22
tintinweb merged 11 commits into
tintinweb:masterfrom
jvortmann:tasks-list-improvements

Conversation

@jvortmann

@jvortmann jvortmann commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The widget hardcodes a 10-task cap and always sorts by ID, which hides newer tasks and offers no way to customize the display. This PR adds five new settings to control how tasks are shown in the widget, all accessible from the /tasks → Settings menu.

This is based on top of #21 .

New Settings

showAll (default: false)

When true, every task is shown regardless of the visible limit.

{ "showAll": true }
CleanShot 2026-05-13 at 16 21 27@2x

maxVisible (default: 10)

Caps how many task lines the widget shows. Only applies when showAll is false. Configurable via menu: 5, 10, 15, 20, 30, 50, 100.

{ "showAll": false, "maxVisible": 20 }
CleanShot 2026-05-13 at 16 21 51@2x

sortOrder (default: "id")

Controls task sort order in the widget:

  • "id" — creation order (existing behaviour)
  • "status" — groups by completed → in-progress → pending
  • "recent" — most recently updated first
  • "oldest" — least recently updated first
{ "sortOrder": "status" }
CleanShot 2026-05-13 at 16 22 07@2x CleanShot 2026-05-13 at 16 22 15@2x CleanShot 2026-05-13 at 16 22 22@2x CleanShot 2026-05-13 at 16 22 30@2x

hiddenAt (default: "bottom")

When tasks exceed maxVisible, controls where hidden tasks collapse:

  • "bottom" — hides from the end of the list (existing behaviour)
  • "top" — hides from the start (useful with "status" sort to collapse completed tasks while keeping active work visible)
{ "sortOrder": "status", "hiddenAt": "top", "maxVisible": 10 }
CleanShot 2026-05-13 at 16 21 51@2x

Combined example

Show up to 15 tasks, sorted by status, with completed tasks collapsing at the top:

{
  "sortOrder": "status",
  "hiddenAt": "top",
  "maxVisible": 15
}

Details

  • Sort logic lives in TaskStore.list(sortOrder) with extracted comparator functions, keeping the widget thin
  • All settings are persisted in .pi/tasks-config.json alongside existing settings
  • Config is injected into the widget via constructor (mutable reference, no setter needed)
  • All defaults preserve existing behaviour — no breaking changes
  • All checks pass locally (lint, typecheck, 159 tests)

@jvortmann
jvortmann force-pushed the tasks-list-improvements branch from b2aa594 to d67d0e1 Compare May 13, 2026 19:47
pe200012 added a commit to pe200012/pi-tasks that referenced this pull request May 16, 2026
jvortmann added 11 commits May 30, 2026 22:15
The widget hardcodes a 10-task cap which hides newer tasks.
A new showAll boolean in TasksConfig lets users display
every task when set to true. Default remains false to preserve
existing behavior.

Change-type: feature
The widget needs the live config object to honor settings
like showAll. Inject it at construction time instead of
using a setter since cfg is available when the widget is
created.

Change-type: refactor
Replaces the hardcoded task limit with a user-configurable
maxVisible setting. Defaults to 10 to preserve existing
behavior. Ignored when showAll is true.

Change-type: feature
Cycles through 5, 10, 15, 20, 30, 50, 100. Only applies
when showAll is off.

Change-type: feature
When set to "status", tasks are grouped as completed,
in-progress, then pending — each sub-group ordered by ID.
Defaults to "id" to preserve existing behaviour.

Change-type: feature
The store is the natural place for sort order. Extract
sortById and sortByStatus functions and let list() accept
a sortOrder parameter. The widget delegates sorting to
the store instead of sorting after the fact.

Change-type: refactor
Sort tasks by updatedAt timestamp: "recent" shows most
recently updated first, "oldest" shows least recently
updated first. Available in the settings menu alongside
the existing "id" and "status" options.

Change-type: feature
When the task list exceeds maxVisible, "bottom" hides
tasks from the end (default, existing behaviour) while
"top" hides from the start — useful with status sort to
collapse completed tasks while keeping active work visible.

Change-type: feature
@tintinweb
tintinweb force-pushed the tasks-list-improvements branch from d67d0e1 to 8acfe4b Compare May 30, 2026 20:21
@tintinweb
tintinweb merged commit 5cdc783 into tintinweb:master May 30, 2026
1 check passed
@tintinweb

Copy link
Copy Markdown
Owner

thx 🙏

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.

2 participants