Skip to content

Offer the Home dashboard as a default tag option - #1595

Merged
KodeStar merged 4 commits into
2.xfrom
feat/default-tag-home-dashboard
Aug 28, 2026
Merged

Offer the Home dashboard as a default tag option#1595
KodeStar merged 4 commits into
2.xfrom
feat/default-tag-home-dashboard

Conversation

@KodeStar

Copy link
Copy Markdown
Member

Fixes #1589

What

With "treat tags as" = tags, the taglist already renders the root tag (id 0) as a Home Dashboard chip under the 0-dash slug, and tiles tagged only to the root carry the tag-0-dash class, so the existing auto-select-on-load logic handles it fine. The Default tag setting simply never offered it: both the edit dropdown and the settings-list display filtered tags with id > 0.

Fix

  • New Setting::defaultTagOptions() builds the slug => title list used by both the edit dropdown and the list display (previously duplicated). The root tag comes first, then the pinned tags alphabetically as before.
  • The root tag's title is the app.dashboard translation key, which both paths already run through __(), so it renders as "Home Dashboard" in the user's language.

Tests

  • SettingsSeederTest: the dropdown offers 0-dash with the translated label, listed right after "none"; the list display shows the translated title when selected.
  • DashTest: tags mode exposes data-default-tag="0-dash" alongside the matching chip and tile class.
  • Full suite green locally.

In tags mode the taglist already renders the root tag (id 0) as a
'Home Dashboard' chip under the 0-dash slug, and tiles tagged only to
the root carry tag-0-dash, so auto-selecting it on load works. The
default_tag dropdown just never offered it because both the edit and
display code paths filtered on id > 0.

Move the option list into Setting::defaultTagOptions(), used by both
paths, and put the root tag first followed by the pinned tags as before.

Fixes #1589
list_value re-fetches the stored setting rather than reading the model
attribute, so the test has to write the value to the DB.
@andresvidal

Copy link
Copy Markdown

Nice!! Thanks :)

- Item::taglist() scope (home tag plus pinned tags) replaces the two
  identical closures in ItemController::dash and the hand-rolled copy in
  Setting::defaultTagOptions, which now needs one query and a pluck.
- Fold the home-dashboard assertions into the existing dropdown test
  instead of duplicating its setup.
…dashboard

# Conflicts:
#	tests/Feature/DashTest.php
@KodeStar
KodeStar merged commit 1455f70 into 2.x Aug 28, 2026
1 check passed
@LinuxServer-CI LinuxServer-CI moved this from PRs to Done in Issue & PR Tracker Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Allow "Home dashboard" as a default "Tag" in settings

3 participants