klaudio 0.11.1 → 0.11.2

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 +1 -1
  2. package/src/cli.js +12 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "klaudio",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Add sound effects to your coding sessions — play sounds when tasks complete, notifications arrive, and more",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -137,15 +137,16 @@ const NavHint = ({ back = true, extra = "" }) =>
137
137
  );
138
138
 
139
139
  // ── Screen: Scope ───────────────────────────────────────────────
140
- const ScopeScreen = ({ onNext, onMusic, tts, onToggleTts, outdatedReasons }) => {
140
+ const ScopeScreen = ({ onNext, onMusic, onUpdate, tts, onToggleTts, outdatedReasons }) => {
141
+ const isOutdated = outdatedReasons && outdatedReasons.length > 0;
141
142
  const items = [
143
+ ...(isOutdated ? [{ label: "⬆ Apply updates", value: "_update" }] : []),
142
144
  { label: "Global — Claude Code + Copilot (all projects)", value: "global" },
143
145
  { label: "This project — Claude Code + Copilot (this project only)", value: "project" },
144
- // index 2 = music
145
146
  { label: "🎵 Play game music while you code", value: "_music" },
146
147
  ];
147
148
  const [sel, setSel] = useState(0);
148
- const GAP_AT = 2; // visual gap before this index
149
+ const GAP_AT = (isOutdated ? 1 : 0) + 2; // visual gap before music
149
150
 
150
151
  useInput((input, key) => {
151
152
  if (input === "k" || key.upArrow) {
@@ -156,17 +157,16 @@ const ScopeScreen = ({ onNext, onMusic, tts, onToggleTts, outdatedReasons }) =>
156
157
  onToggleTts();
157
158
  } else if (key.return) {
158
159
  const v = items[sel].value;
159
- if (v === "_music") onMusic();
160
+ if (v === "_update") onUpdate();
161
+ else if (v === "_music") onMusic();
160
162
  else onNext(v);
161
163
  }
162
164
  });
163
165
 
164
- const isOutdated = outdatedReasons && outdatedReasons.length > 0;
165
-
166
166
  return h(Box, { flexDirection: "column" },
167
167
  isOutdated
168
168
  ? h(Box, { flexDirection: "column", marginLeft: 2, marginBottom: 1 },
169
- h(Text, { color: "yellow", bold: true }, " Updates available — re-apply to enable:"),
169
+ h(Text, { color: "yellow", bold: true }, " Updates available:"),
170
170
  ...outdatedReasons.map((r, i) =>
171
171
  h(Text, { key: i, color: "yellow", dimColor: true, marginLeft: 4 }, `+ ${r}`),
172
172
  ),
@@ -1605,6 +1605,11 @@ const InstallApp = () => {
1605
1605
  checkHooksOutdated(s).then(setOutdatedReasons).catch(() => {});
1606
1606
  setScreen(SCREEN.PRESET);
1607
1607
  },
1608
+ onUpdate: () => {
1609
+ // Quick-apply: use global scope with existing sounds, skip to install
1610
+ setScope("global");
1611
+ setScreen(SCREEN.INSTALLING);
1612
+ },
1608
1613
  onMusic: () => setScreen(SCREEN.MUSIC_MODE),
1609
1614
  });
1610
1615