@freesyntax/notch-cli 0.5.1 → 0.5.11

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/dist/index.js +17 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6337,14 +6337,28 @@ function menuDismiss(state) {
6337
6337
  }
6338
6338
  function renderMenu(state) {
6339
6339
  if (!state.visible || state.filtered.length === 0) return "";
6340
- const items = state.filtered.slice(0, MAX_VISIBLE);
6341
- const hasMore = state.filtered.length > MAX_VISIBLE;
6340
+ const total = state.filtered.length;
6341
+ let scrollTop = 0;
6342
+ if (state.selected >= MAX_VISIBLE) {
6343
+ scrollTop = state.selected - MAX_VISIBLE + 1;
6344
+ }
6345
+ if (scrollTop + MAX_VISIBLE > total) {
6346
+ scrollTop = Math.max(0, total - MAX_VISIBLE);
6347
+ }
6348
+ const items = state.filtered.slice(scrollTop, scrollTop + MAX_VISIBLE);
6349
+ const hasMore = scrollTop + MAX_VISIBLE < total;
6350
+ const hasAbove = scrollTop > 0;
6342
6351
  let currentCategory = "";
6343
6352
  const lines = [];
6344
6353
  lines.push(chalk26.gray(" \u250C\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
6354
+ if (hasAbove) {
6355
+ const above = scrollTop;
6356
+ lines.push(chalk26.gray(` \u2502 ${chalk26.dim(`\u2191 ${above} more\u2026`)}${"".padEnd(40 - String(above).length)}\u2502`));
6357
+ }
6345
6358
  for (let i = 0; i < items.length; i++) {
6346
6359
  const cmd = items[i];
6347
- const isSelected = i === state.selected;
6360
+ const absoluteIndex = scrollTop + i;
6361
+ const isSelected = absoluteIndex === state.selected;
6348
6362
  if (cmd.category !== currentCategory) {
6349
6363
  currentCategory = cmd.category;
6350
6364
  if (i > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freesyntax/notch-cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.11",
4
4
  "description": "Notch CLI — AI-powered coding assistant by Driftrail",
5
5
  "type": "module",
6
6
  "bin": {