Skip to content

Commit f42f66f

Browse files
wip
1 parent e1786a7 commit f42f66f

File tree

9 files changed

+103
-61
lines changed

9 files changed

+103
-61
lines changed

src/Options.vue

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
<div class="flex h-screen w-screen overflow-hidden">
33
<div class="drawer lg:drawer-open overflow-hidden">
44
<input id="drawer-menu" class="drawer-toggle" type="checkbox" />
5-
<div class="drawer-content flex flex-col items-center justify-center overflow-auto">
6-
<div class="h-screen w-full">
5+
<div class="drawer-content flex flex-col items-center justify-center overflow-auto relative">
6+
<div class="absolute inset-0 opacity-10 pointer-events-none">
7+
<div class="pattern-background"></div>
8+
</div>
9+
<div class="h-screen w-full relative z-10">
710
<div class="navbar bg-base-200">
811
<div class="navbar-start">
912
<label
@@ -97,45 +100,45 @@ const panes: Components = {
97100
const sectionItems = [
98101
{
99102
title: 'Rules',
100-
icon: 'TabRulesIcon',
103+
emoji: '📋',
101104
component: 'TabRulesPane',
102105
},
103106
{
104107
title: 'Groups',
105-
icon: 'TabGroupsIcon',
108+
emoji: '🗂️',
106109
component: 'TabGroupsPane',
107110
},
108111
{
109-
title: '🍯 Tab Hive',
110-
icon: 'TabHiveIcon',
112+
title: 'Tab Hive',
113+
emoji: '🍯',
111114
component: 'TabHivePane',
112115
},
113116
{
114117
title: 'Settings',
115-
icon: 'SettingsIcon',
118+
emoji: '⚙️',
116119
component: 'SettingsPane',
117120
},
118121
{
119122
title: 'Help',
120-
icon: 'HelpIcon',
123+
emoji: '',
121124
component: 'HelpPane',
122125
},
123126
] as MenuItem[];
124127
125128
const resourceItems = [
126129
{
127130
title: 'Chrome Web Store',
128-
icon: 'ChromeIcon',
131+
emoji: '🌐',
129132
link: 'https://chrome.google.com/webstore/detail/tab-modifier/hcbgadmbdkiilgpifjgcakjehmafcjai',
130133
},
131134
{
132135
title: 'GitHub',
133-
icon: 'GithubIcon',
136+
emoji: '💻',
134137
link: 'https://github.com/furybee/chrome-tab-modifier',
135138
},
136139
{
137140
title: 'Donate',
138-
icon: 'DonationIcon',
141+
emoji: '💝',
139142
component: 'DonationPane',
140143
},
141144
] as MenuItem[];
@@ -181,4 +184,11 @@ onMounted(async () => {
181184
});
182185
</script>
183186

184-
<style lang="scss" scoped></style>
187+
<style scoped>
188+
.pattern-background {
189+
width: 100%;
190+
height: 100%;
191+
background-image: radial-gradient(circle, currentColor 1px, transparent 1px);
192+
background-size: 32px 32px;
193+
}
194+
</style>

src/SidePanel.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<template>
2-
<div class="h-screen bg-base-100 flex flex-col">
2+
<div class="h-screen bg-base-100 flex flex-col relative">
3+
<div class="absolute inset-0 opacity-10 pointer-events-none">
4+
<div class="pattern-background"></div>
5+
</div>
6+
37
<!-- Tabs -->
4-
<div role="tablist" class="tabs tabs-bordered tabs-lg bg-base-200">
8+
<div role="tablist" class="tabs tabs-bordered tabs-lg bg-base-200 relative z-10">
59
<a
610
role="tab"
711
class="tab text-sm"
@@ -20,7 +24,7 @@
2024
</a>
2125
</div>
2226

23-
<div class="flex-1 overflow-y-auto p-4">
27+
<div class="flex-1 overflow-y-auto p-4 relative z-10">
2428
<!-- Add Rule Tab -->
2529
<div v-if="activeTab === 'add-rule'">
2630
<RuleForm
@@ -137,4 +141,11 @@ onMounted(async () => {
137141
});
138142
</script>
139143

140-
<style scoped></style>
144+
<style scoped>
145+
.pattern-background {
146+
width: 100%;
147+
height: 100%;
148+
background-image: radial-gradient(circle, currentColor 1px, transparent 1px);
149+
background-size: 32px 32px;
150+
}
151+
</style>

src/common/storage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export function _getDefaultTabModifierSettings(): TabModifierSettings {
1313
theme: 'tabee',
1414
lightweight_mode_enabled: false,
1515
lightweight_mode_patterns: [],
16+
lightweight_mode_apply_to_rules: true,
17+
lightweight_mode_apply_to_tab_hive: true,
1618
auto_close_enabled: false,
1719
auto_close_timeout: 30, // 30 minutes par défaut
1820
},

src/common/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DefineComponent } from 'vue';
22

33
export type MenuItem = {
44
title: string;
5-
icon: string;
5+
emoji: string;
66
component?: string;
77
link?: string;
88
};
@@ -56,6 +56,8 @@ export type Settings = {
5656
theme: string;
5757
lightweight_mode_enabled: boolean;
5858
lightweight_mode_patterns: LightweightModePattern[];
59+
lightweight_mode_apply_to_rules: boolean;
60+
lightweight_mode_apply_to_tab_hive: boolean;
5961
auto_close_enabled: boolean;
6062
auto_close_timeout: number; // en minutes
6163
};

src/components/options/center/sections/HelpPane.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535
<div class="card-body">
3636
<h2 class="card-title">⌨️ Keyboard Shortcuts</h2>
3737

38+
<h3 class="font-bold">Spot Search</h3>
39+
<p>
40+
Quickly search through your open tabs and bookmarks with a spotlight-style interface:
41+
</p>
42+
<ul class="list-disc ml-3">
43+
<li><strong>Windows/Linux:</strong> <kbd class="kbd kbd-sm">Alt</kbd> + <kbd class="kbd kbd-sm">Shift</kbd> + <kbd class="kbd kbd-sm">E</kbd></li>
44+
<li><strong>Mac:</strong> <kbd class="kbd kbd-sm">⌘ Command</kbd> + <kbd class="kbd kbd-sm">Shift</kbd> + <kbd class="kbd kbd-sm">E</kbd></li>
45+
</ul>
46+
<p class="mt-2">
47+
Type to filter tabs by title, URL, or tab group. Use arrow keys to navigate and press Enter to switch to a tab or open a bookmark.
48+
</p>
49+
3850
<h3 class="font-bold">Merge All Windows</h3>
3951
<p>
4052
Quickly merge all browser windows into the currently focused window using the keyboard

src/components/options/center/sections/SettingsPane.vue

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@
3131

3232
<div class="card bg-base-200 mt-4">
3333
<div class="card-body">
34-
<h2 class="card-title">Performance</h2>
34+
<h2 class="card-title">Performance & Tab Management</h2>
3535

3636
<div class="grid grid-cols-6">
3737
<div class="col-span-5">
3838
<h3 class="font-bold">Lightweight Mode</h3>
39-
<p>
40-
Reduce memory usage by disabling Tabee on specific domains or URLs. This is useful for
41-
sites where you don't need tab modifications.
42-
</p>
39+
<p>Reduce memory usage by disabling Tabee on specific domains or URLs.</p>
4340
</div>
4441
<div class="col-span-1 flex justify-end">
4542
<input
@@ -51,6 +48,25 @@
5148
</div>
5249

5350
<div v-if="lightweightModeEnabled" class="mt-4">
51+
<div class="grid grid-cols-2 gap-4 mb-4">
52+
<label class="label cursor-pointer justify-start gap-2">
53+
<input
54+
v-model="lightweightModeApplyToRules"
55+
type="checkbox"
56+
class="checkbox checkbox-xs checkbox-primary"
57+
/>
58+
<span class="label-text text-xs">Apply to Rules</span>
59+
</label>
60+
<label class="label cursor-pointer justify-start gap-2">
61+
<input
62+
v-model="lightweightModeApplyToTabHive"
63+
type="checkbox"
64+
class="checkbox checkbox-xs checkbox-primary"
65+
/>
66+
<span class="label-text text-xs">Apply to Tab Hive</span>
67+
</label>
68+
</div>
69+
5470
<div class="mb-4">
5571
<button class="btn btn-xs btn-outline btn-primary" @click="showAddPatternModal">
5672
Add Pattern
@@ -153,19 +169,15 @@
153169
</div>
154170
</div>
155171
</dialog>
156-
</div>
157-
</div>
158172

159-
<div class="card bg-base-200 mt-4">
160-
<div class="card-body">
161-
<h2 class="card-title">🍯 Tab Hive</h2>
173+
<div class="divider my-6"></div>
162174

163175
<div class="grid grid-cols-6">
164176
<div class="col-span-5">
165-
<h3 class="font-bold">Auto-Close Inactive Tabs</h3>
177+
<h3 class="font-bold">🍯 Tab Hive: Auto-Close Inactive Tabs</h3>
166178
<p>
167179
Automatically close tabs that have been inactive for a specified duration. Closed tabs
168-
will be saved in the side panel for easy restoration.
180+
will be saved in Tab Hive for easy restoration.
169181
</p>
170182
</div>
171183
<div class="col-span-1 flex justify-end">
@@ -308,6 +320,12 @@ const lightweightModeEnabled = ref(rulesStore.settings.lightweight_mode_enabled
308320
const lightweightModePatterns = ref<LightweightModePattern[]>(
309321
rulesStore.settings.lightweight_mode_patterns ?? []
310322
);
323+
const lightweightModeApplyToRules = ref(
324+
rulesStore.settings.lightweight_mode_apply_to_rules ?? true
325+
);
326+
const lightweightModeApplyToTabHive = ref(
327+
rulesStore.settings.lightweight_mode_apply_to_tab_hive ?? true
328+
);
311329
const addPatternModal = ref<HTMLDialogElement | null>(null);
312330
const newPattern = ref({
313331
type: 'domain' as 'domain' | 'regex',
@@ -334,6 +352,16 @@ watch(lightweightModeEnabled, async (enabled) => {
334352
});
335353
});
336354
355+
watch(lightweightModeApplyToRules, async (enabled) => {
356+
rulesStore.settings.lightweight_mode_apply_to_rules = enabled;
357+
await rulesStore.save();
358+
});
359+
360+
watch(lightweightModeApplyToTabHive, async (enabled) => {
361+
rulesStore.settings.lightweight_mode_apply_to_tab_hive = enabled;
362+
await rulesStore.save();
363+
});
364+
337365
watch(autoCloseEnabled, async (enabled) => {
338366
rulesStore.settings.auto_close_enabled = enabled;
339367
await rulesStore.save();

src/components/options/center/sections/TabRules/EmptyRules.vue

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<template>
22
<div class="hero min-h-screen bg-base-200 relative overflow-hidden">
3-
<div class="absolute inset-0 opacity-10">
4-
<div class="pattern-background"></div>
5-
</div>
63
<div class="hero-content text-center relative z-10">
74
<div class="max-w-lg">
85
<h1 class="text-5xl font-bold">Hello there</h1>
@@ -254,11 +251,4 @@ const rulesTips = [
254251
];
255252
</script>
256253

257-
<style scoped>
258-
.pattern-background {
259-
width: 100%;
260-
height: 100%;
261-
background-image: radial-gradient(circle, currentColor 1px, transparent 1px);
262-
background-size: 32px 32px;
263-
}
264-
</style>
254+
<style scoped></style>

src/components/options/left/Menu.vue

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}"
88
@click.prevent="onMenuClicked(menuItem)"
99
>
10-
<component :is="icons[menuItem.icon]" class="menuItem-icon" />
10+
<span class="text-xl">{{ menuItem.emoji }}</span>
1111
{{ menuItem.title }}
1212
<template v-if="menuItem.link">
1313
<ExternalIcon class="!w-3 !h-3" />
@@ -18,29 +18,10 @@
1818
</template>
1919

2020
<script lang="ts" setup>
21-
import { Components, MenuItem } from '../../../common/types.ts';
22-
import TabRulesIcon from '../../icons/TabRulesIcon.vue';
23-
import TabGroupsIcon from '../../icons/TabGroupsIcon.vue';
24-
import TabHiveIcon from '../../icons/TabHiveIcon.vue';
25-
import SettingsIcon from '../../icons/SettingsIcon.vue';
26-
import HelpIcon from '../../icons/HelpIcon.vue';
27-
import GithubIcon from '../../icons/GithubIcon.vue';
28-
import DonationIcon from '../../icons/DonationIcon.vue';
29-
import ChromeIcon from '../../icons/ChromeIcon.vue';
21+
import { MenuItem } from '../../../common/types.ts';
3022
import ExternalIcon from '../../icons/ExternalIcon.vue';
3123
import { useMenuStore } from '../../../stores/menu.store.ts';
3224
33-
const icons: Components = {
34-
TabRulesIcon,
35-
TabGroupsIcon,
36-
TabHiveIcon,
37-
SettingsIcon,
38-
HelpIcon,
39-
GithubIcon,
40-
DonationIcon,
41-
ChromeIcon,
42-
};
43-
4425
const props = defineProps<{
4526
title: string;
4627
menuItems: MenuItem[];

src/stores/rules.store.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ export const useRulesStore = defineStore('rules', {
109109
if (settings.lightweight_mode_patterns === undefined) {
110110
settings.lightweight_mode_patterns = [];
111111
}
112+
if (settings.lightweight_mode_apply_to_rules === undefined) {
113+
settings.lightweight_mode_apply_to_rules = true;
114+
}
115+
if (settings.lightweight_mode_apply_to_tab_hive === undefined) {
116+
settings.lightweight_mode_apply_to_tab_hive = true;
117+
}
112118
// Add default values for auto-close if they don't exist
113119
if (settings.auto_close_enabled === undefined) {
114120
settings.auto_close_enabled = false;

0 commit comments

Comments
 (0)