super-productivity/docs
Het Savani baaafbab44
feat:Add a keyboard shortcut to collapse/expand groups (#7370)
* feat:Add a keyboard shortcut to collapse/expand groups

* fix(collapsible): scope group behavior to isGroup and address review feedback

* fix(collapsible): scope group behavior, fix a11y focus, clean CSS, and update docs

* feat(work-view): apply isGroup to Overdue/Later/Done/Recurring sections

Aligns implementation with the wiki keyboard-shortcuts docs added in this
PR — those sections are described as participating in the expand/collapse-all
group shortcuts but were missing the [isGroup]="true" input.

* feat(tasks): ArrowLeft on top-level task collapses parent group

When a top-level task (no parent) is focused and the existing arrow
handling would otherwise call focusPrevious, hand off to the closest
ancestor collapsible group instead: collapse it and move focus to the
group header. Makes the new group shortcuts reachable from the normal
task-driven keyboard flow rather than requiring a Tab to the header.

Sub-tasks and selected-task hide-detail behavior are unchanged.

* feat(collapsible): ArrowUp/Down on group header focuses adjacent task

When a group header is focused, ArrowDown moves focus into the next
<task> element in document order (the first task of the group when
expanded; the next group's first task when collapsed). ArrowUp moves
focus to the previous task. Pairs with the ArrowLeft hand-off so the
group shortcut and task navigation form a single continuous keyboard
flow.

* feat(tasks): ArrowUp/Down on group-edge task focuses the header

ArrowUp on the first task of a group focuses the current group's
header; ArrowDown on the last task focuses the next group's header.
Routed through new handleArrowUp/handleArrowDown methods so other
focusPrevious/focusNext callsites (move-to-backlog, etc.) keep their
existing semantics.

* refactor(util): extract findAdjacentFocusable for arrow nav

Three places had near-identical DOM-walking logic for "find the next/prev
focusable element across tasks and group headers". Consolidates them
into a single utility with 9 unit tests, plus a shared GROUP_NAV_SELECTOR
constant exported from collapsible.component.

Behavior change: ArrowUp/Down on a group header now considers other
collapsed group headers as next-focusable (previously walked only across
<task> elements). For an all-collapsed list, ArrowDown on a header now
moves to the next header instead of skipping to a far-away task.

* refactor: trim findAdjacentFocusable + tighten collapsible API surface

Multi-agent review consensus:
- Drop the compareDocumentPosition fallback in findAdjacentFocusable.
  Both real callers pass an element matching the selector; the fallback
  branch only existed to satisfy a synthetic test. Util shrinks to ~10
  lines of obvious code.
- Re-privatize setAllGroupExpanded and expandIfCollapsed — neither is
  called from outside CollapsibleComponent.
- Scope focusHeader's selector to ':scope > .collapsible-header' so a
  nested collapsible projected through ng-content can't steal focus.

---------

Co-authored-by: Johannes Millan <johannes.millan@gmail.com>
2026-04-27 14:38:44 +02:00
..
long-term-plans refactor(backup): unify backup filename format (#7141) 2026-04-21 14:09:09 +02:00
plans feat(schedule): add week number and date range to nav header 2026-04-21 21:50:52 +02:00
promotion build: better organize stuff 2025-06-27 09:03:16 +02:00
research docs(research): §18.7 — source-level mechanism for appendSwitch vs argv divergence 2026-04-21 15:03:42 +02:00
screens docs/wiki content v0.8 (#7068) 2026-04-01 12:40:28 +02:00
sync-and-op-log docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
wiki feat:Add a keyboard shortcut to collapse/expand groups (#7370) 2026-04-27 14:38:44 +02:00
add-new-integration.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
build-and-publish-notes.md fix(ci): prevent duplicate unsigned exe files in GitHub Releases 2026-03-19 18:58:52 +01:00
ENV_SETUP.md build: final approach 2025-07-14 20:52:51 +02:00
github-access-token-instructions.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
gitlab-access-token-instructions.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
how-to-rate.md Reworked the How to Rate Super Productivity page (#6609) 2026-02-23 11:34:54 +01:00
howto-refresh-snap-credentials.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
i18n-script-usage.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
legacy-webview-analysis.md 16.2.1 2025-11-01 13:22:58 +01:00
mac-app-store-code-signing-guide.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
performance-project-tag-report.md docs: add performance report 2025-11-13 18:23:50 +01:00
plugin-development.md Feat/plugin UI kit (#6362) 2026-02-04 18:18:22 +01:00
styling-guide.md fix(styles): drop dead body-level transition-duration overrides 2026-04-20 17:14:38 +02:00
TRANSLATING.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
unused-translations-analysis.md chore(i18n): remove additional 86 orphan translation keys 2026-01-09 14:59:05 +01:00
update-android-app.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00
update-mac-certificates.md docs: clean up and organize project documentation 2026-03-10 10:22:56 +01:00