From c0c202c5ff2474f533651b593190656e27dc5ac7 Mon Sep 17 00:00:00 2001 From: KodeStar Date: Wed, 8 Jul 2026 17:10:19 +0100 Subject: [PATCH 1/2] Add a configurable default tag for the dashboard In tags mode the dashboard always opened showing every link. This adds a "Default tag" setting (Advanced) that pre-selects one tag group on load, so the dashboard opens filtered to it - the built-in equivalent of the custom JavaScript workaround people have been sharing. The setting is a select populated from the user's own tags, following the same dynamic-option pattern already used for the search provider. When a tag is chosen its slug is exposed on the tag list and the matching tab is activated on load; when the setting is empty, behaviour is unchanged and all links are shown. Resolves #1556 --- app/Http/Controllers/ItemController.php | 1 + app/Setting.php | 12 +++++ database/seeders/SettingsSeeder.php | 15 ++++++ lang/en/app.php | 1 + public/js/app.js | 8 ++++ resources/assets/js/app.js | 9 ++++ resources/views/partials/taglist.blade.php | 2 +- tests/Feature/DashTest.php | 22 +++++++++ .../database/seeders/SettingsSeederTest.php | 47 +++++++++++++++++++ 9 files changed, 116 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index cd5492b1e..87a383089 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -40,6 +40,7 @@ public function dash(Request $request): View $treat_tags_as = \App\Setting::fetch('treat_tags_as'); $data["treat_tags_as"] = $treat_tags_as; + $data['default_tag'] = \App\Setting::fetch('default_tag'); if (config('app.auth_roles_enable')) { $roles = explode(config('app.auth_roles_delimiter'), $request->header(config('app.auth_roles_header'))); diff --git a/app/Setting.php b/app/Setting.php index 0c6dd5fdf..72768d363 100644 --- a/app/Setting.php +++ b/app/Setting.php @@ -123,6 +123,12 @@ public function getListValueAttribute() $options = (array) json_decode($this->options); 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)->orderBy('title', 'asc')->get(); + foreach ($tags as $tag) { + $options[$tag->tag_url] = $tag->title; + } } $value = (array_key_exists($this->value, $options)) ? __($options[$this->value]) @@ -190,6 +196,12 @@ public function getEditValueAttribute() $options = json_decode($this->options); 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)->orderBy('title', 'asc')->get(); + foreach ($tags as $tag) { + $options[$tag->tag_url] = $tag->title; + } } $value = '