Skip to content

Commit 4325e4c

Browse files
andrasbacsaiclaude
andcommitted
feat: Add toggle to disable recents menu from settings dropdown
- Add "Recents" section in settings dropdown with Enable/Disable toggle - Store preference in localStorage (recents_enabled) - Hide recents menu from sidebar when disabled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent aeb4ba5 commit 4325e4c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

resources/views/components/navbar.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ class="px-1 py-0.5 text-xs font-semibold text-neutral-500 dark:text-neutral-400
104104
<li class="flex-1 overflow-x-hidden">
105105
<ul role="list" class="flex flex-col h-full space-y-1.5">
106106
@if (isSubscribed() || !isCloud())
107-
<livewire:recents-menu />
107+
<template x-if="localStorage.getItem('recents_enabled') !== 'false'">
108+
<livewire:recents-menu />
109+
</template>
108110
<li>
109111
<a title="Dashboard" href="/"
110112
class="{{ request()->is('/') ? 'menu-item-active menu-item' : 'menu-item' }}">

resources/views/livewire/settings-dropdown.blade.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
class="relative p-2 dark:text-neutral-400 hover:dark:text-white transition-colors cursor-pointer"
111111
title="Preferences">
112112
<!-- Sliders Icon -->
113-
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" title="Preferences">
113+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" title="Preferences">
114114
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
115115
d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4" />
116116
</svg>
@@ -231,6 +231,19 @@ class="px-1 dropdown-item-no-padding flex items-center gap-2">
231231
</svg>
232232
<span>90%</span>
233233
</button>
234+
235+
<!-- Recents Section -->
236+
<div
237+
class="my-1 font-bold border-b dark:border-coolgray-500 border-neutral-300 dark:text-white text-md">
238+
Recents</div>
239+
<button @click="localStorage.setItem('recents_enabled', localStorage.getItem('recents_enabled') === 'false' ? 'true' : 'false'); window.location.reload()"
240+
class="px-1 dropdown-item-no-padding flex items-center gap-2">
241+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
242+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
243+
d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
244+
</svg>
245+
<span x-text="localStorage.getItem('recents_enabled') === 'false' ? 'Enable' : 'Disable'"></span>
246+
</button>
234247
</div>
235248
</div>
236249
</div>

0 commit comments

Comments
 (0)