@starlove/orbit 1.3.1 → 1.3.3

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starlove/orbit",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "edition": "full",
5
- "builtAt": "2026-06-03T01:18:23.204Z"
5
+ "builtAt": "2026-06-03T04:36:04.899Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starlove/orbit",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "Starscape Orbit — local-first, pretty, human-ai-first kanban system.",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
@@ -14,6 +14,8 @@ import {
14
14
  THEME_CHANGE_EVENT,
15
15
  applyStoredThemePreference,
16
16
  currentTheme,
17
+ storedThemePreference,
18
+ setThemePreference,
17
19
  toggleThemePreference
18
20
  } from "./theme-preference.js";
19
21
 
@@ -42,6 +44,14 @@ themeToggle?.addEventListener("click", () => {
42
44
  toggleThemePreference();
43
45
  });
44
46
 
47
+ // When there's no explicit user preference stored, track OS changes live so
48
+ // data-theme stays in sync and CSS selectors ([data-theme="dark"]) keep working.
49
+ window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
50
+ if (!storedThemePreference()) {
51
+ setThemePreference(e.matches ? "dark" : "light", { notify: true });
52
+ }
53
+ });
54
+
45
55
  window.addEventListener(THEME_CHANGE_EVENT, () => {
46
56
  syncThemeIcon();
47
57
  starscape.sync();
@@ -37,20 +37,27 @@ export function storedThemePreference(storage = safeStorage()) {
37
37
  return THEMES.has(value) ? value : null;
38
38
  }
39
39
 
40
+ function systemTheme() {
41
+ try {
42
+ return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
43
+ } catch {
44
+ return "light";
45
+ }
46
+ }
47
+
40
48
  export function currentTheme({ doc = safeDocument(), storage = safeStorage() } = {}) {
41
49
  const rootTheme = safeDocument(doc)?.documentElement?.getAttribute?.("data-theme");
42
- return THEMES.has(rootTheme) ? rootTheme : storedThemePreference(storage) ?? "light";
50
+ if (THEMES.has(rootTheme)) return rootTheme;
51
+ return storedThemePreference(storage) ?? systemTheme();
43
52
  }
44
53
 
45
54
  export function applyStoredThemePreference({
46
55
  doc = safeDocument(),
47
56
  storage = safeStorage()
48
57
  } = {}) {
49
- const storedTheme = storedThemePreference(storage);
50
- if (storedTheme) {
51
- safeDocument(doc)?.documentElement?.setAttribute?.("data-theme", storedTheme);
52
- }
53
- return currentTheme({ doc, storage });
58
+ const theme = storedThemePreference(storage) ?? systemTheme();
59
+ safeDocument(doc)?.documentElement?.setAttribute?.("data-theme", theme);
60
+ return theme;
54
61
  }
55
62
 
56
63
  export function setThemePreference(theme, {
Binary file
@@ -6,6 +6,21 @@ const execFileAsync = promisify(execFile);
6
6
 
7
7
  const DEFAULT_TITLE = "Choose repo folder for Orbit board";
8
8
 
9
+ const WINDOWS_FOLDER_PICKER_ARGS = (title) => [
10
+ "-NoProfile",
11
+ "-STA",
12
+ "-Command",
13
+ [
14
+ "Add-Type -AssemblyName System.Windows.Forms",
15
+ "$dialog = New-Object System.Windows.Forms.FolderBrowserDialog",
16
+ `$dialog.Description = ${JSON.stringify(title)}`,
17
+ "if ($dialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {",
18
+ " [Console]::OutputEncoding = [System.Text.Encoding]::UTF8",
19
+ " Write-Output $dialog.SelectedPath",
20
+ "}"
21
+ ].join("; ")
22
+ ];
23
+
9
24
  export function folderPickerCommands(platform = process.platform, title = DEFAULT_TITLE) {
10
25
  if (platform === "darwin") {
11
26
  return [
@@ -20,20 +35,7 @@ export function folderPickerCommands(platform = process.platform, title = DEFAUL
20
35
  return [
21
36
  {
22
37
  command: "powershell.exe",
23
- args: [
24
- "-NoProfile",
25
- "-STA",
26
- "-Command",
27
- [
28
- "Add-Type -AssemblyName System.Windows.Forms",
29
- "$dialog = New-Object System.Windows.Forms.FolderBrowserDialog",
30
- `$dialog.Description = ${JSON.stringify(title)}`,
31
- "if ($dialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {",
32
- " [Console]::OutputEncoding = [System.Text.Encoding]::UTF8",
33
- " Write-Output $dialog.SelectedPath",
34
- "}"
35
- ].join("; ")
36
- ]
38
+ args: WINDOWS_FOLDER_PICKER_ARGS(title)
37
39
  }
38
40
  ];
39
41
  }
@@ -46,6 +48,10 @@ export function folderPickerCommands(platform = process.platform, title = DEFAUL
46
48
  {
47
49
  command: "kdialog",
48
50
  args: ["--getexistingdirectory", ".", title]
51
+ },
52
+ {
53
+ command: "powershell.exe",
54
+ args: WINDOWS_FOLDER_PICKER_ARGS(title)
49
55
  }
50
56
  ];
51
57
  }
@@ -59,6 +65,15 @@ function isPickerCancel(error) {
59
65
  return error?.code === 1 && /cancel|user canceled|user cancelled/i.test(stderr);
60
66
  }
61
67
 
68
+ function windowsPathToWslPath(rawPath) {
69
+ const path = String(rawPath || "").trim();
70
+ const drivePath = path.match(/^([a-zA-Z]):[\\/](.*)$/);
71
+ if (!drivePath) return path;
72
+ const drive = drivePath[1].toLowerCase();
73
+ const rest = drivePath[2].replace(/\\/g, "/").replace(/^\/+/, "");
74
+ return `/mnt/${drive}/${rest}`;
75
+ }
76
+
62
77
  export async function pickFolder(options = {}) {
63
78
  const platform = options.platform || process.platform;
64
79
  const title = options.title || DEFAULT_TITLE;
@@ -73,7 +88,8 @@ export async function pickFolder(options = {}) {
73
88
  timeout: 120000,
74
89
  windowsHide: false
75
90
  });
76
- const selectedPath = normalizePath(String(result.stdout || "").trim());
91
+ const rawPath = String(result.stdout || "").trim();
92
+ const selectedPath = normalizePath(platform === "linux" && spec.command === "powershell.exe" ? windowsPathToWslPath(rawPath) : rawPath);
77
93
  return selectedPath ? { path: selectedPath } : { canceled: true };
78
94
  } catch (error) {
79
95
  if (isMissingCommand(error)) {