hopdeck 1.2.4 → 1.2.6

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.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,25 @@
1
1
  # Cambios
2
2
 
3
+ ## 1.2.6
4
+
5
+ ### Mejorado
6
+ - **Lista más legible:** el número de conversaciones de cada proyecto destaca y se separa de «hace cuánto» con un punto; los proyectos plegados se atenúan y el desplegado lleva la flecha en color.
7
+ - **Vista previa más rica:** una fila de resumen («hace 3 h · últimos 6 mensajes»), tus mensajes con `›` en violeta y los de Claude con `●` en naranja.
8
+ - **Barra de ayuda contextual:** muestra solo las teclas que sirven para lo seleccionado (proyecto: desplegar y fijar; conversación: reanudar y renombrar).
9
+ - **Pantalla de bienvenida** con las teclas principales cuando no hay nada abierto.
10
+ - **Icono** del proyecto (`docs/icon.svg` y `docs/icon.png`) para el avatar del repositorio.
11
+
12
+ ## 1.2.5
13
+
14
+ ### Cambiado
15
+ - **En Linux y macOS el terminal integrado es ahora el modo por defecto**, también con `tmux` instalado, para que la vista previa al pasar el cursor y las imágenes funcionen igual que en Windows. El modo tmux sigue disponible con `HOPDECK_TMUX=1` y se usa solo si el terminal integrado no está disponible.
16
+ - **La vista previa de imagen es más pequeña** (como mucho 36×9 celdas): es una vista rápida, no un visor. Para verla en grande, clic sobre `[Image #N]`.
17
+ - **En Windows Terminal el Sixel se activa sin esperar la respuesta del terminal**, que no siempre atraviesa ConPTY. `HOPDECK_SIXEL=0` lo apaga.
18
+ - **Logotipo con el texto convertido a trazados** (Inter 800): se ve igual en cualquier equipo y en la página de npm. Se añaden copias PNG en `docs/`.
19
+
3
20
  ## 1.2.4
4
21
 
5
22
  ### Nuevo
6
- - **Logotipo con el texto convertido a trazados** (Inter 800): se ve igual en cualquier equipo y en la página de npm, sin depender de la fuente instalada. Se añaden copias PNG en `docs/`.
7
23
  - **Imagen real al pasar el cursor por `[Image #N]`** en terminales con Sixel (Windows Terminal 1.22 o posterior, iTerm2, WezTerm, foot, Konsole…). Hopdeck pregunta al terminal si lo admite y, si es así, dibuja la imagen con todos sus píxeles dentro del cuadro del hover; el texto del chat que queda debajo se repinta al apartar el cursor. Si no lo admite se mantiene la vista de bloques. `HOPDECK_SIXEL=1` lo fuerza y `HOPDECK_SIXEL=0` lo desactiva.
8
24
  - **Clic en `[Image #N]` abre la imagen en grande** en el visor de imágenes del sistema, a su tamaño real. La vista rápida del terminal solo puede dibujar dos píxeles por carácter: una captura de pantalla de 1917 px de ancho quedaba en unos 50 y no se podía leer. Arrastrar para copiar texto y hacer clic en otro texto siguen igual. El cuadro del hover avisa («clic: abrir en grande») y es algo más grande.
9
25
 
package/README.en.md CHANGED
@@ -169,7 +169,7 @@ Each command has **one single form**. Any other word, or a variant such as `inst
169
169
  | System | Works with | Notes |
170
170
  |---|---|---|
171
171
  | **Windows** | PowerShell, CMD, Windows Terminal | All features. This is where it has been tested the most. |
172
- | **macOS / Linux** | Any terminal with color | With `tmux` installed it uses tmux panes (the list responds to the wheel and clicks, but no hover preview or chat images); without `tmux`, it uses a built-in terminal with every feature. |
172
+ | **macOS / Linux** | Any terminal with color | It uses the built-in terminal, with every feature (hover preview, chat images). If you prefer `tmux` panes, run `HOPDECK_TMUX=1 hopdeck` (the list responds to the wheel and clicks, but no hover preview or chat images). |
173
173
  | **WSL** | Same as Linux | Reads WSL's history, which is separate from Windows' (see [troubleshooting](#troubleshooting)). |
174
174
 
175
175
  ## Configuration
@@ -200,7 +200,7 @@ Keys in `~/.hopdeck.json` you can edit by hand:
200
200
  | `maxImages` | Max images per conversation in the gallery | `200` |
201
201
  | `previewMsgs` | Messages shown in the preview | `12` |
202
202
 
203
- Other variables: `HOPDECK_EMBED=1` forces the built-in terminal, `HOPDECK_NOTMUX=1` avoids tmux and `HOPDECK_NOEMBED=1` disables it; `HOPDECK_CONFIG` and `HOPDECK_CACHE` change the paths of your preferences and the cache.
203
+ Other variables: `HOPDECK_TMUX=1` uses tmux panes on Linux/macOS, `HOPDECK_EMBED=1` forces the built-in terminal, `HOPDECK_NOTMUX=1` avoids tmux and `HOPDECK_NOEMBED=1` disables it; `HOPDECK_CONFIG` and `HOPDECK_CACHE` change the paths of your preferences and the cache.
204
204
 
205
205
  </details>
206
206
 
package/README.md CHANGED
@@ -169,7 +169,7 @@ Cada comando tiene **una sola forma**. Cualquier otra palabra, o una variante co
169
169
  | Sistema | Funciona con | Notas |
170
170
  |---|---|---|
171
171
  | **Windows** | PowerShell, CMD, Windows Terminal | Todas las funciones. Es donde más se ha probado. |
172
- | **macOS / Linux** | Cualquier terminal con color | Con `tmux` instalado usa paneles de tmux (la lista responde a la rueda y al clic, pero sin vista previa al pasar el cursor ni imágenes del chat); sin `tmux`, usa un terminal integrado con todas las funciones. |
172
+ | **macOS / Linux** | Cualquier terminal con color | Usa el terminal integrado, con todas las funciones (vista previa al pasar el cursor, imágenes del chat). Si prefieres paneles de `tmux`, lanza `HOPDECK_TMUX=1 hopdeck` (la lista responde a la rueda y al clic, pero sin vista previa al pasar el cursor ni imágenes). |
173
173
  | **WSL** | Igual que Linux | Lee el historial de WSL, que es distinto del de Windows (ver [problemas frecuentes](#problemas-frecuentes)). |
174
174
 
175
175
  ## Configuración
@@ -200,7 +200,7 @@ Claves de `~/.hopdeck.json` que puedes editar a mano:
200
200
  | `maxImages` | Imágenes máximas por conversación en la galería | `200` |
201
201
  | `previewMsgs` | Mensajes mostrados en la vista previa | `12` |
202
202
 
203
- Otras variables: `HOPDECK_EMBED=1` fuerza el terminal integrado, `HOPDECK_NOTMUX=1` evita tmux y `HOPDECK_NOEMBED=1` lo desactiva; `HOPDECK_CONFIG` y `HOPDECK_CACHE` cambian las rutas de tus preferencias y de la caché.
203
+ Otras variables: `HOPDECK_TMUX=1` usa paneles de tmux en Linux/macOS, `HOPDECK_EMBED=1` fuerza el terminal integrado, `HOPDECK_NOTMUX=1` evita tmux y `HOPDECK_NOEMBED=1` lo desactiva; `HOPDECK_CONFIG` y `HOPDECK_CACHE` cambian las rutas de tus preferencias y de la caché.
204
204
 
205
205
  </details>
206
206
 
@@ -13,7 +13,7 @@ Ninguna dependencia ejecuta scripts de instalación (`npm audit`: 0 vulnerabilid
13
13
 
14
14
  ## Tipografía del logotipo
15
15
 
16
- El texto de `docs/logo-*.svg` y `docs/logo-*.png` está convertido a trazados a partir de la fuente [Inter](https://rsms.me/inter/) (peso 800), con licencia SIL Open Font License 1.1, que permite este uso. No se distribuye la fuente.
16
+ El texto de `docs/logo-*.svg`, `docs/logo-*.png` y la «H» de `docs/icon.*` están convertido a trazados a partir de la fuente [Inter](https://rsms.me/inter/) (peso 800), con licencia SIL Open Font License 1.1, que permite este uso. No se distribuye la fuente.
17
17
 
18
18
  ## Marcas
19
19
 
package/bin/hopdeck.js CHANGED
@@ -393,10 +393,14 @@ function frameTree(W, H) {
393
393
  const base = sel ? (EMBED && E.focus === 'right' ? C.selOff : C.selOn) : '';
394
394
  const mark = [sel ? '▌' : ' ', C.accent];
395
395
  if (e.t === 'p') {
396
- const right = (e.p.sessions.length ? String(e.p.sessions.length).padStart(3) + ' ' + ago(e.p.mtime).padStart(6) : '');
397
- lines.push(fit([mark, [e.open ? ' ▾ ' : ' ▸ ', C.dim],
398
- [(e.p.pinned ? '★ ' : '') + (e.p.isCwd ? '● ' : '') + e.p.name, sel ? C.text + C.bold : e.p.hidden ? C.dim : (e.p.isCwd ? C.ok : C.text)]], W - 11, base) +
399
- fit([[right, C.dim]], 11, base));
396
+ const n = e.p.sessions.length;
397
+ // nº de conversaciones (destacado) · hace cuánto fue la última; alineado con la columna de tiempo de las conversaciones
398
+ const right = n ? [[String(n).padStart(3), sel ? C.text + C.bold : C.text], [' · ', C.faint], [''.padEnd(0), ''], [ago(e.p.mtime).padStart(6), C.dim], [' ', '']] : [[' ', '']];
399
+ // 4) los proyectos plegados se atenúan: el desplegado, el de esta carpeta y el seleccionado destacan
400
+ const nameC = sel ? C.text + C.bold : e.p.hidden ? C.dim : e.p.isCwd ? C.ok : e.open ? C.text : C.dim;
401
+ lines.push(fit([mark, [e.open ? ' ▾ ' : ' ▸ ', e.open ? C.accent : C.dim],
402
+ [(e.p.pinned ? '★ ' : '') + (e.p.isCwd ? '● ' : '') + e.p.name, nameC]], W - 13, base) +
403
+ fit(right, 13, base));
400
404
  } else if (e.t === 'm') {
401
405
  lines.push(fit([mark, [' ', ''], [T.more(e.n), sel ? C.text : C.dim]], W, base));
402
406
  } else if (e.t === 'l') {
@@ -430,7 +434,11 @@ function frameTree(W, H) {
430
434
  [' Tab ' + (S.deep ? '◉ ' : '○ ') + T.deep, S.deep ? C.ok : C.dim]], W));
431
435
  } else {
432
436
  const k = T.k, segs = [[' ', '']];
433
- for (const [key, desc] of [['⏎', k.open], ['n', k.neu], ['/', k.find], ['?', LANG === 'es' ? 'ayuda' : 'help']]) segs.push([key, C.accent], [' ' + desc + ' ', C.dim]);
437
+ const keys = !cur ? [['⏎', k.open], ['n', k.neu], ['/', k.find], ['?', T.kHelp]]
438
+ : cur.t === 'p' ? [['⏎', T.kUnfold], ['n', k.neu], ['p', T.kPin], ['/', k.find], ['?', T.kHelp]]
439
+ : cur.t === 's' ? [['⏎', k.resume], ['R', T.kRename], ['n', k.neu], ['/', k.find], ['?', T.kHelp]]
440
+ : [['⏎', k.open], ['n', k.neu], ['/', k.find], ['?', T.kHelp]];
441
+ for (const [key, desc] of keys) segs.push([key, C.accent], [' ' + desc + ' ', C.dim]);
434
442
  lines.push(fit(segs, W));
435
443
  }
436
444
  return lines;
@@ -870,7 +878,8 @@ function termRow(term, y, width, sel, from = 0) {
870
878
  const paintMark = (t) => t.replace('\u0001', R + C.text + C.bold);
871
879
 
872
880
  function idleRow(y, width, height) {
873
- const rows = [[C.brand + C.bold, '» Hop\u0001deck'], [C.text, T.idle1], [C.dim, T.idle2], ['', ''], [C.dim, T.idle3]];
881
+ const k = T.k;
882
+ const rows = [[C.brand + C.bold, '» Hop\u0001deck'], [C.text, T.idle1], [C.dim, T.idle2], ['', ''], [C.accent, `⏎ ${k.resume} n ${k.neu} / ${k.find} ? ${T.kHelp}`], [C.dim, T.idle3]];
874
883
  const i = y - (Math.floor(height / 2) - 2);
875
884
  if (i < 0 || i >= rows.length) return ' '.repeat(width);
876
885
  const [st, t] = rows[i];
@@ -964,7 +973,8 @@ async function shownSession(x) {
964
973
 
965
974
  // ── Imágenes reales (Sixel): se usan si el terminal las admite; si no, la vista rápida con medios bloques ──
966
975
  /** HOPDECK_SIXEL=1 las fuerza, =0 las apaga; sin definir, se usan si el terminal dijo que las admite (consulta DA1 al arrancar). */
967
- const sixelOn = () => process.env.HOPDECK_SIXEL === '1' || (process.env.HOPDECK_SIXEL !== '0' && E.sixelDetected);
976
+ // En Windows Terminal (1.22+) la respuesta del terminal no siempre atraviesa ConPTY, así que ahí se activa sin esperarla.
977
+ const sixelOn = () => process.env.HOPDECK_SIXEL === '1' || (process.env.HOPDECK_SIXEL !== '0' && (E.sixelDetected || (WIN && !!process.env.WT_SESSION)));
968
978
 
969
979
  /**
970
980
  * Quita de la entrada las respuestas del terminal a nuestras consultas y las guarda en `st`:
@@ -1025,7 +1035,7 @@ function hoverPopup(hv, rw, th) {
1025
1035
  const d = g.dec.get(0), lab = ` [Image #${hv.n}] `;
1026
1036
  let rows, tw, sx = null;
1027
1037
  if (d && d.rgba && sixelOn()) { // imagen real: se deja un hueco en blanco del tamaño de la imagen y se dibuja encima con Sixel
1028
- const cw = E.cell.w, ch = E.cell.h, maxCols = Math.max(8, Math.min(rw - 6, 140)), maxRows = Math.max(2, th - 5);
1038
+ const cw = E.cell.w, ch = E.cell.h, maxCols = Math.max(8, Math.min(rw - 6, 36)), maxRows = Math.max(2, Math.min(th - 5, 9)); // vista previa pequeña: como mucho 36×9 celdas
1029
1039
  const k = Math.min((maxCols * cw) / d.w, (maxRows * ch) / d.h, 3);
1030
1040
  const iw = Math.max(1, Math.min(maxCols, Math.round((d.w * k) / cw))), ih = Math.max(1, Math.min(maxRows, Math.round((d.h * k) / ch))), key = `sx:${iw}x${ih}`;
1031
1041
  let data = g.cache.get(key);
@@ -1168,18 +1178,22 @@ function previewFor(x) {
1168
1178
  return null;
1169
1179
  }
1170
1180
 
1171
- function previewRows(msgs, width, height) {
1181
+ function previewRows(msgs, width, height, info = '') {
1172
1182
  const lines = [];
1173
1183
  for (const m of msgs) {
1174
1184
  const user = m.role === 'user';
1175
- wrapText(m.text, Math.max(10, width - 4)).forEach((t, i) => lines.push([i === 0 ? (user ? ' › ' : ' ') : ' ', user ? C.accent : '', t, user ? C.text : C.dim]));
1185
+ // tú: › en violeta y texto destacado; Claude: ● en naranja y texto atenuado
1186
+ wrapText(m.text, Math.max(10, width - 4)).forEach((t, i) => lines.push([i === 0 ? (user ? ' › ' : ' ● ') : ' ', user ? C.accent + C.bold : C.brand, t, user ? C.text : C.dim]));
1176
1187
  lines.push(null);
1177
1188
  }
1178
1189
  while (lines.length && lines[lines.length - 1] === null) lines.pop();
1179
- const shown = lines.slice(-Math.max(1, height - 2)), rows = [];
1190
+ const head = info ? 2 : 0; // fila de resumen + línea en blanco
1191
+ const shown = lines.slice(-Math.max(1, height - 2 - head)), rows = [];
1180
1192
  for (let i = 0; i < height; i++) {
1181
1193
  if (i === height - 1) { rows.push(fit([[' ' + T.prevHint, C.accent]], width)); continue; }
1182
- const l = shown[i];
1194
+ if (info && i === 0) { rows.push(fit([[' ' + info, C.dim]], width)); continue; }
1195
+ if (info && i === 1) { rows.push(' '.repeat(width)); continue; }
1196
+ const l = shown[i - head];
1183
1197
  rows.push(l ? fit([[l[0], l[1]], [' ' + (l[2] || ''), l[3]]], width) : ' '.repeat(width));
1184
1198
  }
1185
1199
  return rows;
@@ -1200,7 +1214,7 @@ function renderEmbed() {
1200
1214
  // sin chat abierto: vista previa de la conversación seleccionada en la lista
1201
1215
  const selEnt = !sh && !S.help && !S.qs ? flatList()[S.c] : null;
1202
1216
  const pvMsgs = selEnt && selEnt.t === 's' ? previewFor(selEnt.s) : null;
1203
- const pvRows = pvMsgs && pvMsgs.length ? previewRows(pvMsgs, rw, th) : null;
1217
+ const pvRows = pvMsgs && pvMsgs.length ? previewRows(pvMsgs, rw, th, T.prevInfo(ago(selEnt.s.mtime), pvMsgs.length)) : null;
1204
1218
  const hdr = sh || (selEnt && selEnt.t === 's' ? { project: selEnt.p.name, title: selEnt.s.title, branch: gitBranch(selEnt.p.cwd) } : null);
1205
1219
  const gRows = E.gallery ? galleryRows(rw, th) : null;
1206
1220
  const hv = !E.gallery && sh && sh.ready && E.hover && !E.hover.g.loading && E.hover.g.images.length ? E.hover : null;
@@ -1689,9 +1703,12 @@ async function run() {
1689
1703
  if (!SIDEBAR && process.env.HOPDECK_INSIDE) { console.log(T.inside); return; }
1690
1704
  if (!SIDEBAR) await offerShortcut(); // primera vez: ¿quieres que `claude` abra Hopdeck?
1691
1705
  if (!SIDEBAR) {
1692
- const preferTmux = !WIN && !process.env.HOPDECK_NOTMUX && !process.env.HOPDECK_EMBED && hasTmux();
1693
- if (preferTmux) return bootstrap();
1706
+ // Por defecto se usa el terminal integrado (vista previa al pasar el cursor, imágenes). tmux solo con HOPDECK_TMUX=1,
1707
+ // o como alternativa si el terminal integrado no está disponible.
1708
+ const tmuxOk = !WIN && !process.env.HOPDECK_NOTMUX && !process.env.HOPDECK_EMBED && hasTmux();
1709
+ if (tmuxOk && process.env.HOPDECK_TMUX) return bootstrap();
1694
1710
  if (!process.env.HOPDECK_NOEMBED) { E.deps = loadDeps(); EMBED = !!E.deps; }
1711
+ if (!EMBED && tmuxOk) return bootstrap();
1695
1712
  }
1696
1713
  process.on('exit', () => { if (active) { try { process.stdout.write('\x1b[?1000l\x1b[?1003l\x1b[?1006l\x1b[?25h\x1b[?1049l'); } catch { /* */ } } });
1697
1714
  process.on('SIGTERM', () => quit(0));
package/lib/i18n.js CHANGED
@@ -18,7 +18,7 @@ const T = {
18
18
  imgNoPrev: 'No se puede previsualizar este formato', imgHint: '← → navegar o abrir en el visor esc cerrar', imgFolder: 'Imágenes abiertas en el visor',
19
19
  more: (n) => `mostrar ${n} más…`, busyRename: 'Cierra la conversación antes de renombrarla', renameLbl: 'nombre',
20
20
  copied: (n) => `Copiado (${n} caracteres)`, archMsg: 'Archivada (H para verlas)', unarchMsg: 'Desarchivada', qsHint: 'saltar a cualquier conversación',
21
- prevHint: '⏎ reanudar esta conversación', noPrev: 'Sin mensajes para mostrar',
21
+ prevHint: '⏎ reanudar esta conversación', prevInfo: (a, n) => `${a === 'ahora' ? 'ahora mismo' : 'hace ' + a} · últimos ${n} mensajes`, kUnfold: 'desplegar', kRename: 'renombrar', kPin: 'fijar', kHelp: 'ayuda', noPrev: 'Sin mensajes para mostrar',
22
22
  bar6: 'ocultar lista', bar7: 'mostrar lista', deep: 'contenido', pathPrompt: 'nombre de la nueva carpeta', mkIn: 'se crea en', fbTitle: 'Elegir carpeta', fbHere: 'Abrir chat aquí', fbNew: 'Nueva carpeta aquí…', fbUp: 'Subir un nivel', fbProj: 'proyecto', fbHint: '⏎ entrar · ␣ abrir · / buscar · . ocultas', fbDrives: 'Este equipo', fbRecent: 'reciente', hoverMiss: (n) => `[Image #${n}]: aún no está en el historial`, fbEmpty: 'Sin subcarpetas', badId: 'Identificador de sesión no válido',
23
23
  imgClickHint: 'clic: abrir en grande', imgOpened: (n) => `[Image #${n}] abierta en el visor de imágenes`,
24
24
  unknownCmd: (c) => `Comando desconocido: "${c}"`, didYouMean: (s) => `¿Quisiste decir "${s}"?`, cmdList: 'Comandos: hopdeck shortcut on|off · uninstall · doctor · help (y --list, --version).\nLas opciones de claude (por ejemplo --model opus) se pasan tal cual: hopdeck --model opus',
@@ -58,7 +58,7 @@ const T = {
58
58
  imgNoPrev: 'This format cannot be previewed', imgHint: '← → browse o open in viewer esc close', imgFolder: 'Images opened in the viewer',
59
59
  more: (n) => `show ${n} more…`, busyRename: 'Close the conversation before renaming it', renameLbl: 'name',
60
60
  copied: (n) => `Copied (${n} chars)`, archMsg: 'Archived (H to show)', unarchMsg: 'Unarchived', qsHint: 'jump to any conversation',
61
- prevHint: '⏎ resume this conversation', noPrev: 'No messages to show',
61
+ prevHint: '⏎ resume this conversation', prevInfo: (a, n) => `${a === 'now' ? 'just now' : a + ' ago'} · last ${n} messages`, kUnfold: 'unfold', kRename: 'rename', kPin: 'pin', kHelp: 'help', noPrev: 'No messages to show',
62
62
  bar6: 'hide list', bar7: 'show list', deep: 'content', pathPrompt: 'new folder name', mkIn: 'created in', fbTitle: 'Pick a folder', fbHere: 'Open chat here', fbNew: 'New folder here…', fbUp: 'Go up', fbProj: 'project', fbHint: '⏎ enter · ␣ open · / find · . hidden', fbDrives: 'This PC', fbRecent: 'recent', hoverMiss: (n) => `[Image #${n}]: not in the history yet`, fbEmpty: 'No subfolders', badId: 'Invalid session id',
63
63
  imgClickHint: 'click: open full size', imgOpened: (n) => `[Image #${n}] opened in the image viewer`,
64
64
  unknownCmd: (c) => `Unknown command: "${c}"`, didYouMean: (s) => `Did you mean "${s}"?`, cmdList: 'Commands: hopdeck shortcut on|off · uninstall · doctor · help (and --list, --version).\nclaude options (for example --model opus) are passed through as they are: hopdeck --model opus',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hopdeck",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Selector visual de proyectos y conversaciones para Claude Code, en la terminal: salta entre proyectos sin hacer cd.",
5
5
  "author": "fabriciodev26",
6
6
  "license": "MIT",