dsh-prompt-history 1.2.2 → 1.2.4

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/README.en.md CHANGED
@@ -39,7 +39,7 @@
39
39
  - **Auto** (terminal-style): copies the selection straight to the system clipboard on select.
40
40
  5. **Right-click pastes directly** — a right-click on the composer pastes the clipboard — no context menu, like a Linux terminal. Paste runs the same pipeline as Ctrl+V (images and reference chips behave identically), with a Clipboard API fallback when the execCommand path is blocked.
41
41
  6. **Cross-session history** (Settings toggle, default off) — keeps Up/Down history across sessions, stored in browser localStorage (cap 200), survives reloads and session switches.
42
- 7. **Chat TOC (conversation directory)** — when the conversation gets long, a subtle semi-transparent, draggable grip on the chat's left edge (brightens on hover) expands a directory of every user message in order — click any entry to jump to that spot; click outside or press Esc to close. Can be toggled off in Settings.
42
+ 7. **Chat TOC (conversation directory)** — when the conversation gets long, a subtle semi-transparent, draggable grip on the chat's left edge (brightens on hover) expands a directory of every user message in order — click any entry to jump to that spot, and scroll through all entries when the list gets long; click outside or press Esc to close. Can be toggled off in Settings.
43
43
 
44
44
  Pure UI behavior: no session events, no agent-loop changes, no model requests. Recalled or quoted text only enters the ordinary composer draft — it reaches the model only if *you* press Enter.
45
45
 
package/README.es.md CHANGED
@@ -39,7 +39,7 @@
39
39
  - **Auto** (estilo terminal): copia la selección directamente al portapapeles del sistema al seleccionar.
40
40
  5. **Clic derecho pega directamente** — un clic derecho sobre el compositor pega el portapapeles — sin menú contextual, como en una terminal Linux. El pegado usa la misma canalización que Ctrl+V (las imágenes y las chips de referencia se comportan igual), con respaldo de Clipboard API cuando la ruta execCommand está bloqueada.
41
41
  6. **Historial entre sesiones** (interruptor en Ajustes, apagado por defecto) — mantiene el historial de ↑/↓ entre sesiones, almacenado en localStorage (límite 200), sobrevive a recargas y cambios de sesión.
42
- 7. **TOC del chat (índice de la conversación)** — cuando la conversación se hace larga, una pequeña manija semitransparente y arrastrable en el borde izquierdo del chat (se ilumina al pasar el cursor) despliega un índice de cada mensaje de usuario en orden — haz clic en cualquier entrada para saltar a ese punto; haz clic fuera o pulsa Esc para cerrar. Se puede desactivar en Ajustes.
42
+ 7. **TOC del chat (índice de la conversación)** — cuando la conversación se hace larga, una pequeña manija semitransparente y arrastrable en el borde izquierdo del chat (se ilumina al pasar el cursor) despliega un índice de cada mensaje de usuario en orden — haz clic en cualquier entrada para saltar a ese punto y desplázate por todas las entradas cuando la lista es larga; haz clic fuera o pulsa Esc para cerrar. Se puede desactivar en Ajustes.
43
43
 
44
44
  Comportamiento de UI puro: sin eventos de sesión, sin cambios en el bucle del agente, sin peticiones al modelo. El texto recuperado o citado solo entra en el borrador normal del compositor — llega al modelo solo si *tú* pulsas Enter.
45
45
 
package/README.md CHANGED
@@ -39,7 +39,7 @@
39
39
  - **选中即自动复制**:终端风格,选中直接写系统剪贴板。
40
40
  5. **鼠标右键直接粘贴** — 在输入框上右键即粘贴剪贴板内容(和 Linux 终端一致,不弹菜单);粘贴走与 Ctrl+V 完全一致的管线(图片与引用 chip 行为一致),execCommand 路径被限制时自动回退到 Clipboard API 手动插入。
41
41
  6. **跨会话历史记忆**(设置里可开关,默认关)— 开启后 ↑/↓ 历史在会话间保持,存于浏览器本地(上限 200 条),刷新/切换会话不丢失。
42
- 7. **会话目录(Chat TOC)** — 聊天内容多时,对话左侧边缘有一个半透明、可拖动的把手(悬停变亮),点击展开按时间顺序列出你发送过的所有消息,点击任意一条即可跳转到对应位置;点击外部或按 Esc 关闭。可在设置里**一键开关**。
42
+ 7. **会话目录(Chat TOC)** — 聊天内容多时,对话左侧边缘有一个半透明、可拖动的把手(悬停变亮),点击展开按时间顺序列出你发送过的所有消息,点击任意一条即可跳转到对应位置;条目多时可在目录内滚动查看全部;点击外部或按 Esc 关闭。可在设置里**一键开关**。
43
43
 
44
44
  纯 UI 行为:不产生会话事件、不改变 agent 循环、不发起模型请求。召回/引用的文本只会进入输入框草稿,只有**你**按 Enter 才会到达模型。
45
45
 
package/README.pt.md CHANGED
@@ -39,7 +39,7 @@
39
39
  - **Auto** (estilo terminal): copia a seleção direto para a área de transferência do sistema ao selecionar.
40
40
  5. **Botão direito cola diretamente** — um clique com o botão direito no compositor cola a área de transferência — sem menu de contexto, como num terminal Linux. A colagem usa o mesmo pipeline do Ctrl+V (imagens e chips de referência se comportam igual), com fallback da Clipboard API quando o caminho execCommand está bloqueado.
41
41
  6. **Histórico entre sessões** (alternância em Configurações, desligado por padrão) — mantém o histórico de ↑/↓ entre sessões, armazenado em localStorage do navegador (limite 200), sobrevive a recarregamentos e trocas de sessão.
42
- 7. **TOC do chat (índice da conversa)** — quando a conversa fica longa, uma alça sutil, semitransparente e arrastável na borda esquerda do chat (acende no hover) expande um índice de cada mensagem de usuário em ordem — clique em qualquer item para saltar para aquele ponto; clique fora ou pressione Esc para fechar. Pode ser desativado nas Configurações.
42
+ 7. **TOC do chat (índice da conversa)** — quando a conversa fica longa, uma alça sutil, semitransparente e arrastável na borda esquerda do chat (acende no hover) expande um índice de cada mensagem de usuário em ordem — clique em qualquer item para saltar para aquele ponto e role por todas as entradas quando a lista ficar longa; clique fora ou pressione Esc para fechar. Pode ser desativado nas Configurações.
43
43
 
44
44
  Comportamento puro de UI: sem eventos de sessão, sem mudanças no loop do agente, sem requisições ao modelo. O texto recuperado ou citado só entra no rascunho comum do compositor — chega ao modelo apenas se *você* pressionar Enter.
45
45
 
package/lib/client.js CHANGED
@@ -361,7 +361,7 @@ window.__ModuleLoader__.load({
361
361
  const gripCenterY = gripTop + 26;
362
362
  const natural = Math.min(panel.getBoundingClientRect().height, 480);
363
363
  const maxHeight = Math.min(natural, window.innerHeight - 8);
364
- const left = Math.max(4, Math.min(gripRight + gap, window.innerWidth - 230 - 4));
364
+ const left = Math.max(4, Math.min(gripRight + gap, window.innerWidth - 308));
365
365
  const next = {
366
366
  top: Math.max(4, Math.min(gripCenterY - maxHeight / 2, window.innerHeight - maxHeight - 4)),
367
367
  left,
@@ -1138,10 +1138,10 @@ window.__ModuleLoader__.load({
1138
1138
  ".dsh-ph-group{margin:8px 0 4px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);}",
1139
1139
  ".dsh-ph-toc-grip{position:fixed;z-index:2147483000;width:20px;height:52px;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-specific-menu);background:color-mix(in srgb,var(--dsw-specific-menu) 88%,#000);box-shadow:0 1px 4px rgba(0,0,0,.18);color:var(--dsw-alias-label-primary);font-size:14px;line-height:1;cursor:pointer;opacity:.65;transition:opacity .15s;display:flex;align-items:center;justify-content:center;padding:0;}",
1140
1140
  ".dsh-ph-toc-grip:hover{opacity:1;background:var(--dsw-alias-bg-layer-2);}",
1141
- ".dsh-ph-toc{position:fixed;z-index:2147483000;width:220px;max-height:min(60vh,480px);display:flex;flex-direction:column;padding:8px;border-radius:12px;background:var(--dsw-specific-menu);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 8px 28px rgba(0,0,0,.25);box-sizing:border-box;}",
1141
+ ".dsh-ph-toc{position:fixed;z-index:2147483000;width:300px;max-height:min(60vh,480px);display:flex;flex-direction:column;padding:8px;border-radius:12px;background:var(--dsw-specific-menu);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 8px 28px rgba(0,0,0,.25);box-sizing:border-box;}",
1142
1142
  ".dsh-ph-toc-title{margin:0 4px 6px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);}",
1143
- ".dsh-ph-toc-list{overflow-y:auto;display:flex;flex-direction:column;gap:2px;box-sizing:border-box;}",
1144
- ".dsh-ph-toc-item{display:block;width:100%;text-align:left;padding:5px 8px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-primary);font-size:12px;line-height:1.4;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;}",
1143
+ ".dsh-ph-toc-list{overflow-y:auto;display:flex;flex-direction:column;gap:2px;box-sizing:border-box;min-height:0;flex:1 1 auto;overscroll-behavior:contain;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);}",
1144
+ ".dsh-ph-toc-item{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;width:100%;text-align:left;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-primary);font-size:13px;line-height:1.5;cursor:pointer;overflow:hidden;white-space:normal;box-sizing:border-box;}",
1145
1145
  ".dsh-ph-toc-item:hover{background:var(--dsw-alias-bg-layer-2);}"
1146
1146
  ].join("");
1147
1147
  /**
@@ -1153,7 +1153,7 @@ window.__ModuleLoader__.load({
1153
1153
  */
1154
1154
  function apply(ctx) {
1155
1155
  const style = document.createElement("style");
1156
- style.dataset.plugin = "dsh-prompt-history";
1156
+ style.dataset.pluginCss = "dsh-ph-settings";
1157
1157
  style.textContent = SETTINGS_CSS;
1158
1158
  document.head.appendChild(style);
1159
1159
  ctx.effect(() => ctx.locale.register(NS, {
@@ -15,10 +15,12 @@ const SETTINGS_CSS = [
15
15
  '.dsh-ph-group{margin:8px 0 4px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);}',
16
16
  '.dsh-ph-toc-grip{position:fixed;z-index:2147483000;width:20px;height:52px;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-specific-menu);background:color-mix(in srgb,var(--dsw-specific-menu) 88%,#000);box-shadow:0 1px 4px rgba(0,0,0,.18);color:var(--dsw-alias-label-primary);font-size:14px;line-height:1;cursor:pointer;opacity:.65;transition:opacity .15s;display:flex;align-items:center;justify-content:center;padding:0;}',
17
17
  '.dsh-ph-toc-grip:hover{opacity:1;background:var(--dsw-alias-bg-layer-2);}',
18
- '.dsh-ph-toc{position:fixed;z-index:2147483000;width:220px;max-height:min(60vh,480px);display:flex;flex-direction:column;padding:8px;border-radius:12px;background:var(--dsw-specific-menu);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 8px 28px rgba(0,0,0,.25);box-sizing:border-box;}',
18
+ '.dsh-ph-toc{position:fixed;z-index:2147483000;width:300px;max-height:min(60vh,480px);display:flex;flex-direction:column;padding:8px;border-radius:12px;background:var(--dsw-specific-menu);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 8px 28px rgba(0,0,0,.25);box-sizing:border-box;}',
19
19
  '.dsh-ph-toc-title{margin:0 4px 6px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);}',
20
- '.dsh-ph-toc-list{overflow-y:auto;display:flex;flex-direction:column;gap:2px;box-sizing:border-box;}',
21
- '.dsh-ph-toc-item{display:block;width:100%;text-align:left;padding:5px 8px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-primary);font-size:12px;line-height:1.4;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;}',
20
+ '.dsh-ph-toc-list{overflow-y:auto;display:flex;flex-direction:column;gap:2px;box-sizing:border-box;min-height:0;flex:1 1 auto;overscroll-behavior:contain;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);}',
21
+ // Entries clamp to two lines so a long prompt stays readable (single-line
22
+ // ellipsis at 220px showed only ~13 chars and was unreadable).
23
+ '.dsh-ph-toc-item{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;width:100%;text-align:left;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-primary);font-size:13px;line-height:1.5;cursor:pointer;overflow:hidden;white-space:normal;box-sizing:border-box;}',
22
24
  '.dsh-ph-toc-item:hover{background:var(--dsw-alias-bg-layer-2);}',
23
25
  ].join('');
24
26
  /**
@@ -30,7 +32,10 @@ const SETTINGS_CSS = [
30
32
  */
31
33
  export function apply(ctx) {
32
34
  const style = document.createElement('style');
33
- style.dataset.plugin = 'dsh-prompt-history';
35
+ // data-plugin-css (not data-plugin): the theme/skin system also tags style
36
+ // elements with the bundle's package name, so a query on data-plugin would
37
+ // be ambiguous.
38
+ style.dataset.pluginCss = 'dsh-ph-settings';
34
39
  style.textContent = SETTINGS_CSS;
35
40
  document.head.appendChild(style);
36
41
  // Dictionaries + the vanilla-DOM translator (toolbar/pills/overlay/TOC).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-prompt-history",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "DSH web plugin: terminal-style input for the composer — bash-like Up/Down prompt history with prefix search and Ctrl+R, selection toolbar with copy and quote (Codex-style > blockquote), right-click paste, toggleable draggable chat TOC, fully internationalized (zh/en), with copy modes in Settings (history sourced from the session's own message log; zero config required).",
5
5
  "keywords": [
6
6
  "dsh",
@@ -161,7 +161,7 @@ export function ChatToc({ nodes }: ChatTocProps): JSX.Element {
161
161
  const gripCenterY = gripTop + 26 // grip height 52 → vertical center
162
162
  const natural = Math.min(panel.getBoundingClientRect().height, 480)
163
163
  const maxHeight = Math.min(natural, window.innerHeight - 8)
164
- const left = Math.max(4, Math.min(gripRight + gap, window.innerWidth - 230 - 4))
164
+ const left = Math.max(4, Math.min(gripRight + gap, window.innerWidth - 308))
165
165
  // Prefer centering on the grip; clamp so both edges stay inside the viewport.
166
166
  const top = Math.max(4, Math.min(gripCenterY - maxHeight / 2, window.innerHeight - maxHeight - 4))
167
167
  const next = { top, left, maxHeight }
@@ -31,10 +31,12 @@ const SETTINGS_CSS = [
31
31
  '.dsh-ph-group{margin:8px 0 4px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);}',
32
32
  '.dsh-ph-toc-grip{position:fixed;z-index:2147483000;width:20px;height:52px;border:1px solid var(--dsw-alias-border-l1);border-radius:9px;background:var(--dsw-specific-menu);background:color-mix(in srgb,var(--dsw-specific-menu) 88%,#000);box-shadow:0 1px 4px rgba(0,0,0,.18);color:var(--dsw-alias-label-primary);font-size:14px;line-height:1;cursor:pointer;opacity:.65;transition:opacity .15s;display:flex;align-items:center;justify-content:center;padding:0;}',
33
33
  '.dsh-ph-toc-grip:hover{opacity:1;background:var(--dsw-alias-bg-layer-2);}',
34
- '.dsh-ph-toc{position:fixed;z-index:2147483000;width:220px;max-height:min(60vh,480px);display:flex;flex-direction:column;padding:8px;border-radius:12px;background:var(--dsw-specific-menu);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 8px 28px rgba(0,0,0,.25);box-sizing:border-box;}',
34
+ '.dsh-ph-toc{position:fixed;z-index:2147483000;width:300px;max-height:min(60vh,480px);display:flex;flex-direction:column;padding:8px;border-radius:12px;background:var(--dsw-specific-menu);border:1px solid var(--dsw-alias-border-l1);box-shadow:0 8px 28px rgba(0,0,0,.25);box-sizing:border-box;}',
35
35
  '.dsh-ph-toc-title{margin:0 4px 6px;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);}',
36
- '.dsh-ph-toc-list{overflow-y:auto;display:flex;flex-direction:column;gap:2px;box-sizing:border-box;}',
37
- '.dsh-ph-toc-item{display:block;width:100%;text-align:left;padding:5px 8px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-primary);font-size:12px;line-height:1.4;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;}',
36
+ '.dsh-ph-toc-list{overflow-y:auto;display:flex;flex-direction:column;gap:2px;box-sizing:border-box;min-height:0;flex:1 1 auto;overscroll-behavior:contain;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);}',
37
+ // Entries clamp to two lines so a long prompt stays readable (single-line
38
+ // ellipsis at 220px showed only ~13 chars and was unreadable).
39
+ '.dsh-ph-toc-item{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;width:100%;text-align:left;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-primary);font-size:13px;line-height:1.5;cursor:pointer;overflow:hidden;white-space:normal;box-sizing:border-box;}',
38
40
  '.dsh-ph-toc-item:hover{background:var(--dsw-alias-bg-layer-2);}',
39
41
  ].join('')
40
42
 
@@ -47,7 +49,10 @@ const SETTINGS_CSS = [
47
49
  */
48
50
  export function apply(ctx: ClientContext): void {
49
51
  const style = document.createElement('style')
50
- style.dataset.plugin = 'dsh-prompt-history'
52
+ // data-plugin-css (not data-plugin): the theme/skin system also tags style
53
+ // elements with the bundle's package name, so a query on data-plugin would
54
+ // be ambiguous.
55
+ style.dataset.pluginCss = 'dsh-ph-settings'
51
56
  style.textContent = SETTINGS_CSS
52
57
  document.head.appendChild(style)
53
58