claude-code-hub 0.17.4 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/public/app.js +25 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-hub",
3
- "version": "0.17.4",
3
+ "version": "0.18.1",
4
4
  "description": "Unified hub for Claude Code tools — Marketplace + Kanban in one PWA",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -35,10 +35,10 @@
35
35
  },
36
36
  "homepage": "https://github.com/NikiforovAll/claude-code-hub#readme",
37
37
  "dependencies": {
38
- "claude-code-cost": "^0.8.1",
39
- "claude-code-kanban": "^4.8.0",
40
- "claude-code-marketplace": "^0.7.1",
41
- "claude-code-memory-explorer": "^0.5.1",
38
+ "claude-code-cost": "^0.9.0",
39
+ "claude-code-kanban": "^4.10.0",
40
+ "claude-code-marketplace": "^0.8.0",
41
+ "claude-code-memory-explorer": "^0.6.0",
42
42
  "express": "^4.21.0",
43
43
  "open": "^10.1.0"
44
44
  },
package/public/app.js CHANGED
@@ -3,7 +3,21 @@ let activeApp = null;
3
3
  const iframes = {};
4
4
  const loadedApps = new Set();
5
5
  let allowedOrigins = new Set();
6
- let lastTheme = null;
6
+ // {theme: 'dark'|'light', colorTheme: '<id>'} — survives hub reloads so
7
+ // late-loading iframes and fresh sessions get the last chosen theme.
8
+ const themeState = loadThemeState();
9
+
10
+ function loadThemeState() {
11
+ try {
12
+ return JSON.parse(localStorage.getItem('hub-theme')) ?? {};
13
+ } catch {
14
+ return {};
15
+ }
16
+ }
17
+
18
+ function themeMessage() {
19
+ return { type: 'hub:theme', theme: themeState.theme, colorTheme: themeState.colorTheme };
20
+ }
7
21
 
8
22
  async function init() {
9
23
  const res = await fetch('/api/config');
@@ -53,8 +67,8 @@ function onIframeLoad(appId) {
53
67
  if (appId === activeApp) {
54
68
  document.getElementById('loading-overlay').classList.add('fade-out');
55
69
  }
56
- if (lastTheme) {
57
- iframes[appId].contentWindow?.postMessage({ type: 'hub:theme', theme: lastTheme }, new URL(apps[appId].url).origin);
70
+ if (themeState.theme || themeState.colorTheme) {
71
+ iframes[appId].contentWindow?.postMessage(themeMessage(), new URL(apps[appId].url).origin);
58
72
  }
59
73
  }
60
74
 
@@ -74,12 +88,17 @@ function listenMessages() {
74
88
  if (digit >= 1 && digit <= 9) switchByIndex(digit - 1);
75
89
  }
76
90
  } else if (data.type === 'hub:theme') {
91
+ // Legacy senders pass only {theme}; colorTheme is optional and sticky.
77
92
  if (data.theme !== 'light' && data.theme !== 'dark') return;
78
- if (data.theme === lastTheme) return;
79
- lastTheme = data.theme;
93
+ const hasColor = typeof data.colorTheme === 'string' && /^[a-z0-9-]{0,32}$/.test(data.colorTheme);
94
+ const changed = data.theme !== themeState.theme || (hasColor && data.colorTheme !== themeState.colorTheme);
95
+ if (!changed) return;
96
+ themeState.theme = data.theme;
97
+ if (hasColor) themeState.colorTheme = data.colorTheme;
98
+ localStorage.setItem('hub-theme', JSON.stringify(themeState));
80
99
  for (const [id, iframe] of Object.entries(iframes)) {
81
100
  if (iframe.contentWindow === e.source) continue;
82
- iframe.contentWindow?.postMessage({ type: 'hub:theme', theme: data.theme }, new URL(apps[id].url).origin);
101
+ iframe.contentWindow?.postMessage(themeMessage(), new URL(apps[id].url).origin);
83
102
  }
84
103
  }
85
104
  });