Skip to content

feat(medications): add list grouping, filters, and category ordering - #1425

Merged
6 commits merged into
MBombeck:mainfrom
ferges123:feature/medications-grouping-split
Nov 23, 2026
Merged

6 commits merged into
MBombeck:mainfrom
ferges123:feature/medications-grouping-split

Conversation

@ferges123

Copy link
Copy Markdown
Contributor

This PR adds the following to the /medications page:

  • Medication grouping by category in both card and table views.
  • Search by name and a treatment date range filter alongside the existing category filter.
  • A setting to reorder categories and save the new order.

ferges123 and others added 5 commits November 20, 2026 17:56
Extend the /medications layout blob and its PUT route with groupBy,
groupsOpen and categoryOrder. Each field is optional and preserved when
absent, like view and order.

Reuse the Labs applyCategoryOrder for category ordering instead of a
copy. It takes the catch-all key as a parameter, so medications can
keep OTHER last.
…riod

Add a search field (with / as a shortcut), a treatment-period range and
the category select in one filter rail above the list. A filter with no
match shows an empty state with a reset action. A reversed period shows
an alert in the rail.

Drop filterMedicationsByCategory: filterMedications covers the category
filter, so the old helper and its test went with it. The rail uses the
existing ALL_MEDICATION_CATEGORIES sentinel instead of a second copy.
Group the cards and the table by category, each group with its own
disclosure. Settings gets a switch for grouping and the default open
mode: expanded, flagged (only groups with a dose due) or collapsed. While
a filter is active, every group with a match opens.

The grouped and flat card lists share one card renderer. The table's
two row loops share one helper. Dose status comes from one helper
(buildDoseStatusById) instead of two copies of the same map.
Add a category order card to the medications settings. It shows when
grouping is on. Built-in and custom categories can be dragged or moved
with arrows, then saved explicitly. Save sends the new order merged with
any saved categories that are not on screen.

Reuse the Labs applyCategoryOrder and mergeCategoryOrder for ordering
rather than copies. Settings tests keep only behaviour they can render:
the overlapping-save test re-implemented the state machine instead of
calling the component, so it went.
@ferges123 ferges123 changed the title feat(medications): grupowanie, filtry i kolejność kategorii na liście leków feat(medications): add list grouping, filters, and category ordering Nov 20, 2026
@ferges123
ferges123 marked this pull request as ready for review November 20, 2026 21:55
@MBombeck

Copy link
Copy Markdown
Owner

Thank you @ferges123, this is thoughtful work. Grouping, search and the treatment period filter feel native, and reusing the Labs model kept it consistent.

It is merged into release/v1.49.0 with a merge commit, so your commits keep your authorship. On the way in I adjusted a few things:

  • "Due only" now reads the live dose state, like the card does.
  • Ongoing medications without dates count from the day they were added, so they no longer drop out of every date range.
  • The grouped table labels its inactive block.
  • The category order survives a backup restore.
  • The category order accepts only known category keys.

It ships in 1.49.0. This PR will show as merged once the release reaches main.

@MBombeck MBombeck mentioned this pull request Nov 21, 2026
@MBombeck MBombeck closed this pull request by merging all changes into MBombeck:main in 0fd0ef7 Nov 23, 2026
ferges123 pushed a commit to ferges123/HealthLog that referenced this pull request Nov 27, 2026
…ping

feat(medications): add list grouping, filters, and category ordering
@ferges123
ferges123 deleted the feature/medications-grouping-split branch December 1, 2026 09:05
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