From 7d1ca8500619d314b8c185ff066d19cd78c54255 Mon Sep 17 00:00:00 2001 From: KodeStar Date: Thu, 27 Aug 2026 20:01:18 +0100 Subject: [PATCH 1/3] Offer the Home dashboard as a default tag option 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 --- app/Setting.php | 37 +++++++++++++----- tests/Feature/DashTest.php | 17 +++++++++ .../database/seeders/SettingsSeederTest.php | 38 +++++++++++++++++++ 3 files changed, 82 insertions(+), 10 deletions(-) diff --git a/app/Setting.php b/app/Setting.php index 74532ef70..81d231394 100644 --- a/app/Setting.php +++ b/app/Setting.php @@ -124,11 +124,7 @@ public function getListValueAttribute() if ($this->key === 'search_provider') { $options = Search::providers()->pluck('name', 'id')->toArray(); } elseif ($this->key === 'default_tag') { - $options = []; - $tags = Item::where('type', 1)->where('id', '>', 0)->pinned()->orderBy('title', 'asc')->get(); - foreach ($tags as $tag) { - $options[$tag->tag_url] = $tag->title; - } + $options = self::defaultTagOptions(); } $value = (array_key_exists($this->value, $options)) ? __($options[$this->value]) @@ -197,11 +193,7 @@ public function getEditValueAttribute() if ($this->key === 'search_provider') { $options = Search::providers()->pluck('name', 'id'); } elseif ($this->key === 'default_tag') { - $options = ['' => 'app.options.none']; - $tags = Item::where('type', 1)->where('id', '>', 0)->pinned()->orderBy('title', 'asc')->get(); - foreach ($tags as $tag) { - $options[$tag->tag_url] = $tag->title; - } + $options = ['' => 'app.options.none'] + self::defaultTagOptions(); } $value = '