Skip to content

Commit 3472093

Browse files
committed
feat: Re-add support for dragging and re-ordering tabs
1 parent 2c4ef39 commit 3472093

File tree

11 files changed

+407
-167
lines changed

11 files changed

+407
-167
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "altus",
33
"productName": "Altus",
4-
"version": "5.4.1",
4+
"version": "5.5.0",
55
"description": "Desktop client for WhatsApp Web with themes & multiple account support.",
66
"main": ".vite/build/main.js",
77
"build": {

public/locales/en/translation.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,8 @@
9898
"selectPreset": "Select a preset...",
9999
"bgColor": "Background color",
100100
"fgColor": "Foreground Color",
101-
"acColor": "Accent Color"
102-
}
101+
"acColor": "Accent Color",
102+
"Exit": "Exit",
103+
"Cancel": "Cancel",
104+
"Are you sure you want to exit?": "Are you sure you want to exit?"
105+
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
{
2-
"Exit": "Exit",
3-
"Cancel": "Cancel",
4-
"Are you sure you want to exit?": "Are you sure you want to exit?"
5-
}
1+
{}

src/App.tsx

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
import { For, type Component, createSignal, createResource } from "solid-js";
2-
import { tabStore } from "./stores/tabs/solid";
1+
import {
2+
For,
3+
type Component,
4+
createSignal,
5+
createResource,
6+
onCleanup,
7+
} from "solid-js";
8+
import { stableTabArray, tabStore } from "./stores/tabs/solid";
39
import WebView from "./components/WebView";
410
import TabsList from "./components/TabsList";
511
import SettingsDialog from "./components/SettingsDialog";
@@ -14,14 +20,25 @@ const App: Component = () => {
1420
const [isThemeManagerOpen, setIsThemeManagerOpen] = createSignal(false);
1521
const [menu, { refetch: refetchAppMenu }] = createResource(window.getAppMenu);
1622

17-
window.electronIPCHandlers.onOpenSettings(() => {
18-
setIsSettingsOpen(true);
23+
const handlers = new Set<() => void>();
24+
onCleanup(() => {
25+
for (const cleanup of handlers) {
26+
cleanup();
27+
}
1928
});
20-
window.electronIPCHandlers.onOpenThemeManager(() => {
21-
setIsThemeManagerOpen(true);
22-
});
23-
24-
window.electronIPCHandlers.onReloadCustomTitleBar(refetchAppMenu);
29+
handlers.add(
30+
window.electronIPCHandlers.onOpenSettings(() => {
31+
setIsSettingsOpen(true);
32+
})
33+
);
34+
handlers.add(
35+
window.electronIPCHandlers.onOpenThemeManager(() => {
36+
setIsThemeManagerOpen(true);
37+
})
38+
);
39+
handlers.add(
40+
window.electronIPCHandlers.onReloadCustomTitleBar(refetchAppMenu)
41+
);
2542

2643
return (
2744
<I18NProvider>
@@ -38,11 +55,14 @@ const App: Component = () => {
3855
)}
3956
>
4057
<TabsList />
41-
<For each={tabStore.tabs}>
58+
<For each={stableTabArray()}>
4259
{(tab) => (
4360
<div
61+
role="tabpanel"
62+
ref={(el) => console.log(tab.id, el)}
63+
id={`tabpanel-${tab.id}`}
4464
class={twJoin(
45-
"min-h-0 flex-grow",
65+
"min-h-0 flex-grow text-white",
4666
tabStore.selectedTabId !== tab.id && "hidden"
4767
)}
4868
>

0 commit comments

Comments
 (0)