Skip to content

Space albums toolbar still shows the grouping label after that grouping is disabled by the current sort #974

Description

@Deeds67

Found during review of PR #971.

spaceGroupOptionsMetadata's Year entry is disabled while the active sort is Date created or Date modified (web/src/lib/utils/space-album-grouping.ts). When that happens:

  • the menu option is correctly disabled (space-albums-controls.svelte:182), so it cannot be selected
  • buildSpaceAlbumGroups / getSelectedSpaceAlbumGroupOption correctly fall back to None, so the list renders flat
  • but the toolbar trigger still reads "Group by year", because selectedGroupOption (space-albums-controls.svelte:88) resolves the stored groupBy via findSpaceGroupOptionMetadata without consulting isDisabled()

Repro: group a space's albums by Year, then switch the sort to Date created. The list becomes ungrouped while the button still claims Year.

Display-only — no data or ordering bug. Pre-existing; #971 did not introduce it and deliberately left it alone (Year stayed enabled for the new Recently linked sort precisely so this would not be reachable from the default).

Likely fix is one line: resolve the label through getSelectedSpaceAlbumGroupOption($spaceAlbumViewSettings) rather than the raw stored groupBy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions