@nevescloud/pip 3.2.0 → 3.3.0

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/pip-core.esm.js +25 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevescloud/pip",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Floating assistant bubble + panel + chat runtime. ESM, no build.",
5
5
  "type": "module",
6
6
  "main": "pip-core.esm.js",
package/pip-core.esm.js CHANGED
@@ -258,6 +258,19 @@ const CSS = `
258
258
  .pip-scroll::-webkit-scrollbar { width: 6px; }
259
259
  .pip-scroll::-webkit-scrollbar-track { background: transparent; }
260
260
  .pip-scroll::-webkit-scrollbar-thumb { background: var(--pip-border, light-dark(rgba(0,0,0,0.10), rgba(255,255,255,0.12))); border-radius: 3px; }
261
+ /* Backdrop dim while the slash autocomplete is open — Apple-style focus
262
+ shift (Spotlight, Quick Look). History stays glanceable but visually
263
+ recedes so the menu is the active surface. */
264
+ .pip-scroll {
265
+ transition: opacity 140ms ease-out;
266
+ }
267
+ .pip-scroll.is-backdrop {
268
+ opacity: 0.28;
269
+ pointer-events: none;
270
+ }
271
+ @media (prefers-reduced-motion: reduce) {
272
+ .pip-scroll { transition: none; }
273
+ }
261
274
 
262
275
  .pip-notify {
263
276
  font-size: var(--pip-t-caption, 12px);
@@ -1645,11 +1658,15 @@ export function createPip(opts = {}) {
1645
1658
  }
1646
1659
  function dispatchBuiltinSlash(cmd) {
1647
1660
  if (cmd === "help" || cmd === "?") {
1648
- const lines = [];
1649
- for (const s of _slashCommands.values()) lines.push(`- \`/${s.name}\` ${s.description || ""}`);
1650
- lines.push("- `/clear` clear chat history");
1651
- lines.push("- `/help` list commands");
1652
- return { reply: lines.join("\n") };
1661
+ // The slash autocomplete dropdown already lists every command with
1662
+ // its description /help duplicating that as a chat turn was visual
1663
+ // noise and history clutter. Reopen the dropdown in cmd-name mode
1664
+ // instead, same surface a user gets by typing `/`.
1665
+ input.value = "/";
1666
+ input.setSelectionRange(1, 1);
1667
+ input.focus();
1668
+ updateSlashSuggest();
1669
+ return { clearedUI: true };
1653
1670
  }
1654
1671
  if (cmd === "clear") {
1655
1672
  history.length = 0;
@@ -2020,7 +2037,8 @@ export function createPip(opts = {}) {
2020
2037
 
2021
2038
  function renderSlashList() {
2022
2039
  slashList.innerHTML = "";
2023
- if (!slashCurrent.length) { slashList.hidden = true; return; }
2040
+ if (!slashCurrent.length) { slashList.hidden = true; scroll.classList.remove("is-backdrop"); return; }
2041
+ scroll.classList.add("is-backdrop");
2024
2042
  slashCurrent.forEach((item, i) => {
2025
2043
  const li = document.createElement("li");
2026
2044
  li.setAttribute("role", "option");
@@ -2061,6 +2079,7 @@ export function createPip(opts = {}) {
2061
2079
  slashCmdContext = null;
2062
2080
  slashList.hidden = true;
2063
2081
  slashList.innerHTML = "";
2082
+ scroll.classList.remove("is-backdrop");
2064
2083
  }
2065
2084
 
2066
2085
  function updateSlashSuggest() {