flavor-code 1.4.1-beta.1 → 1.4.1

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.
@@ -1997,9 +1997,6 @@ function isPlatformShortcut(character, key, letter, platform = process.platform)
1997
1997
  if (character.toLowerCase() !== letter.toLowerCase()) return false;
1998
1998
  return platform === "darwin" ? key.super || key.ctrl : key.ctrl;
1999
1999
  }
2000
- function outputToggleShortcut(platform = process.platform) {
2001
- return platform === "darwin" ? "Cmd+O" : "Ctrl+O";
2002
- }
2003
2000
  function removeLastCliImageOnBackspace(input, cursor, images) {
2004
2001
  if (input.length === 0 && cursor === 0 && images.length > 0) {
2005
2002
  return { handled: true, images: images.slice(0, -1) };
@@ -2126,13 +2123,11 @@ async function runTerminalSubmissionChain(options) {
2126
2123
  if (prompt !== void 0) options.onPendingConsumed(options.pending.values);
2127
2124
  }
2128
2125
  }
2129
- function classifyTerminalInput(key, activeSession = false) {
2126
+ function classifyTerminalInput(key) {
2130
2127
  if (key.wheelUp) return { type: "scroll", rows: -3 };
2131
2128
  if (key.wheelDown) return { type: "scroll", rows: 3 };
2132
2129
  if (key.pageUp) return { type: "page", fraction: -0.5 };
2133
2130
  if (key.pageDown) return { type: "page", fraction: 0.5 };
2134
- if (activeSession && key.upArrow) return { type: "scroll", rows: -3 };
2135
- if (activeSession && key.downArrow) return { type: "scroll", rows: 3 };
2136
2131
  if (key.upArrow) return { type: "history", direction: "up" };
2137
2132
  if (key.downArrow) return { type: "history", direction: "down" };
2138
2133
  return null;
@@ -2518,10 +2513,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2518
2513
  }
2519
2514
  };
2520
2515
  use_input_default((character, key, event) => {
2521
- const terminalAction = classifyTerminalInput(
2522
- key,
2523
- transcript.active !== void 0 && slashCompletion === null && mentionCompletion === null
2524
- );
2516
+ const terminalAction = classifyTerminalInput(key);
2525
2517
  if (terminalAction?.type === "scroll") {
2526
2518
  const scroll = selectWheelScrollTarget(
2527
2519
  scrollRef.current,
@@ -2552,6 +2544,7 @@ function App({ workspace, home, resumeSession, instanceId, palAlias }) {
2552
2544
  }
2553
2545
  if (isPlatformShortcut(character, key, "o")) {
2554
2546
  setExpandedOutput((value) => !value);
2547
+ scrollRef.current?.scrollToBottom();
2555
2548
  return;
2556
2549
  }
2557
2550
  if (shouldReadClipboardImage(character, key, event.keypress.isPasted)) {
@@ -3061,7 +3054,6 @@ function TerminalLayout({
3061
3054
  ideContext
3062
3055
  }) {
3063
3056
  const dividerWidth = Math.max(1, columns - 1);
3064
- const outputShortcut = outputToggleShortcut();
3065
3057
  const showWelcome = completed.length === 0 && active === void 0;
3066
3058
  const activeCompletion = completion ?? mentionCompletion;
3067
3059
  const menuRows = activeCompletion === void 0 ? 0 : Math.min(6, activeCompletion.items.length - activeCompletion.windowStart);
@@ -3098,9 +3090,7 @@ function TerminalLayout({
3098
3090
  completedWindow.hiddenTurns,
3099
3091
  " earlier turns and ",
3100
3092
  completedWindow.hiddenBlocks,
3101
- " output items hidden \xB7 ",
3102
- outputShortcut,
3103
- " expand all"
3093
+ " output items hidden \xB7 Ctrl/Cmd+O expand all"
3104
3094
  ] }) : null,
3105
3095
  completedWindow.turns.map((turn, index) => /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", children: [
3106
3096
  index > 0 ? /* @__PURE__ */ jsx5(TurnSeparator, { width: columns }) : null,
@@ -3195,7 +3185,7 @@ function TerminalLayout({
3195
3185
  /* @__PURE__ */ jsx5(
3196
3186
  FooterStatus,
3197
3187
  {
3198
- hint: activeSession ? `Esc ${pendingPrompts.length > 0 ? "edit latest" : "stop"} \xB7 Ctrl+C cancel \xB7 Enter queue \xB7 Ctrl/Cmd+R history \xB7 ${outputShortcut} ${expandedOutput ? "collapse" : "expand"} output` : completion !== void 0 ? "\u2191/\u2193 select \xB7 Tab complete \xB7 Esc close" : mentionCompletion !== void 0 ? "\u2191/\u2193 select \xB7 Tab complete \xB7 click choose \xB7 Esc close" : `Enter send \xB7 \u2191\u2193/Ctrl/Cmd+R history \xB7 ${outputShortcut} ${expandedOutput ? "collapse" : "expand"} output \xB7 Ctrl+C exit`,
3188
+ hint: activeSession ? `Esc ${pendingPrompts.length > 0 ? "edit latest" : "stop"} \xB7 Ctrl+C cancel \xB7 Enter queue \xB7 Ctrl/Cmd+R history \xB7 Ctrl/Cmd+O ${expandedOutput ? "collapse" : "expand"} output` : completion !== void 0 ? "\u2191/\u2193 select \xB7 Tab complete \xB7 Esc close" : mentionCompletion !== void 0 ? "\u2191/\u2193 select \xB7 Tab complete \xB7 click choose \xB7 Esc close" : `Enter send \xB7 \u2191\u2193/Ctrl/Cmd+R history \xB7 Ctrl/Cmd+O ${expandedOutput ? "collapse" : "expand"} output \xB7 Ctrl+C exit`,
3199
3189
  ...ideContext === void 0 ? {} : { ideContext }
3200
3190
  }
3201
3191
  )
@@ -3699,7 +3689,7 @@ function workspaceRelativePath(value, workspaceName) {
3699
3689
  if (normalized.toLocaleLowerCase().startsWith(rootPrefix.toLocaleLowerCase())) return normalized.slice(rootPrefix.length);
3700
3690
  return normalized;
3701
3691
  }
3702
- var CLI_COMMAND_OUTPUT_LINE_LIMIT = 8;
3692
+ var CLI_COMMAND_OUTPUT_LINE_LIMIT = 16;
3703
3693
  function CommandPresentationView({
3704
3694
  presentation,
3705
3695
  expanded
@@ -3709,12 +3699,9 @@ function CommandPresentationView({
3709
3699
  const label = presentation.variant === "terminal" ? "TERMINAL" : "COMMAND";
3710
3700
  const hasStdout = jobOutputLines(presentation.stdout ?? "").length > 0;
3711
3701
  const hasStderr = jobOutputLines(presentation.stderr ?? "").length > 0;
3712
- const collapsedPerStreamLimit = hasStdout && hasStderr ? Math.floor(CLI_COMMAND_OUTPUT_LINE_LIMIT / 2) : CLI_COMMAND_OUTPUT_LINE_LIMIT;
3713
- const perStreamLimit = expanded ? Number.POSITIVE_INFINITY : collapsedPerStreamLimit;
3702
+ const perStreamLimit = expanded ? Number.POSITIVE_INFINITY : hasStdout && hasStderr ? Math.floor(CLI_COMMAND_OUTPUT_LINE_LIMIT / 2) : CLI_COMMAND_OUTPUT_LINE_LIMIT;
3714
3703
  const stdout = boundedCommandLines(presentation.stdout ?? "", perStreamLimit);
3715
3704
  const stderr = boundedCommandLines(presentation.stderr ?? "", perStreamLimit);
3716
- const collapsible = stdout.total > collapsedPerStreamLimit || stderr.total > collapsedPerStreamLimit;
3717
- const shortcut = outputToggleShortcut();
3718
3705
  return /* @__PURE__ */ jsxs4(Box_default, { flexDirection: "column", paddingLeft: 2, marginBottom: 1, children: [
3719
3706
  /* @__PURE__ */ jsxs4(Box_default, { children: [
3720
3707
  /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u250C\u2500 " }),
@@ -3736,15 +3723,7 @@ function CommandPresentationView({
3736
3723
  ] }),
3737
3724
  /* @__PURE__ */ jsxs4(Box_default, { children: [
3738
3725
  /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2514\u2500 " }),
3739
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: commandFooter(presentation, state) }),
3740
- collapsible ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
3741
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: " \xB7 " }),
3742
- /* @__PURE__ */ jsx5(Text, { color: "ansi:cyanBright", children: shortcut }),
3743
- /* @__PURE__ */ jsxs4(Text, { dimColor: true, children: [
3744
- " ",
3745
- expanded ? "collapse" : "expand"
3746
- ] })
3747
- ] }) : null
3726
+ /* @__PURE__ */ jsx5(Text, { dimColor: true, children: commandFooter(presentation, state) })
3748
3727
  ] })
3749
3728
  ] });
3750
3729
  }
@@ -3758,8 +3737,7 @@ function CommandOutputSection({
3758
3737
  /* @__PURE__ */ jsxs4(Box_default, { children: [
3759
3738
  /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u251C\u2500 " }),
3760
3739
  /* @__PURE__ */ jsx5(Text, { color: error ? "#e06c50" : tone, bold: true, children: label }),
3761
- /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` \xB7 ${value.total} ${value.total === 1 ? "LINE" : "LINES"}` }),
3762
- value.hidden === 0 ? null : /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` \xB7 ${value.head.length + value.tail.length} SHOWN` })
3740
+ /* @__PURE__ */ jsx5(Text, { dimColor: true, children: ` \xB7 ${value.total} ${value.total === 1 ? "LINE" : "LINES"}` })
3763
3741
  ] }),
3764
3742
  value.head.map((line, index) => /* @__PURE__ */ jsx5(CommandOutputLine, { line, tone, error }, `head:${index}`)),
3765
3743
  value.hidden === 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { children: [
@@ -3784,8 +3762,8 @@ function CommandOutputLine({ line, tone, error }) {
3784
3762
  function boundedCommandLines(output, limit) {
3785
3763
  const lines = jobOutputLines(output);
3786
3764
  if (lines.length <= limit) return { total: lines.length, head: lines, tail: [], hidden: 0 };
3787
- const headCount = Math.ceil(limit * 0.625);
3788
- const tailCount = Math.max(0, limit - headCount);
3765
+ const headCount = Math.ceil(limit / 2);
3766
+ const tailCount = Math.floor(limit / 2);
3789
3767
  return {
3790
3768
  total: lines.length,
3791
3769
  head: lines.slice(0, headCount),
@@ -4291,7 +4269,6 @@ export {
4291
4269
  isPlatformShortcut,
4292
4270
  navigateHistory,
4293
4271
  navigatePromptHistory,
4294
- outputToggleShortcut,
4295
4272
  pastedDraftPresentation,
4296
4273
  prepareCliSubmission,
4297
4274
  promptCursorFromClick,
package/dist/cli-main.js CHANGED
@@ -921,7 +921,7 @@ async function runInteractiveCli(props) {
921
921
  const [{ render, AlternateScreen }, { createElement }, { App }] = await Promise.all([
922
922
  import("./claude-ink-JZXNSAQS.js"),
923
923
  import("react"),
924
- import("./app-UKTPW3E6.js")
924
+ import("./app-4YRKE7VI.js")
925
925
  ]);
926
926
  const instance = await render(createElement(
927
927
  AlternateScreen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flavor-code",
3
- "version": "1.4.1-beta.1",
3
+ "version": "1.4.1",
4
4
  "author": "YachuanWzh",
5
5
  "type": "module",
6
6
  "publishConfig": {