brew-tui 1.1.0 → 1.2.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.
package/build/index.js CHANGED
@@ -349,6 +349,20 @@ var SPACING = {
349
349
  xl: 6,
350
350
  xxl: 8
351
351
  };
352
+ var BREAKPOINTS = {
353
+ /** Below this we collapse to single-column rows (only the name fits). */
354
+ narrow: 50,
355
+ /** Below this we drop the description column but keep version. */
356
+ mid: 80,
357
+ /** At or above this we render every column comfortably. */
358
+ wide: 120
359
+ };
360
+ function getLayoutMode(columns) {
361
+ if (columns < BREAKPOINTS.narrow) return "single";
362
+ if (columns < BREAKPOINTS.mid) return "compact";
363
+ if (columns < BREAKPOINTS.wide) return "comfortable";
364
+ return "wide";
365
+ }
352
366
 
353
367
  // src/components/layout/header.tsx
354
368
  import { jsx as jsx3, jsxs } from "react/jsx-runtime";
@@ -2071,10 +2085,6 @@ function formatDate(value) {
2071
2085
  const locale = getLocale();
2072
2086
  return date.toLocaleDateString(locale === "es" ? "es-ES" : "en-US");
2073
2087
  }
2074
- function truncate(str, maxLen) {
2075
- if (str.length <= maxLen) return str;
2076
- return str.slice(0, maxLen - 1) + "\u2026";
2077
- }
2078
2088
 
2079
2089
  // src/views/dashboard.tsx
2080
2090
  import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
@@ -2450,9 +2460,13 @@ function InstalledView() {
2450
2460
  const containerRef = useRef3(null);
2451
2461
  const { width: containerWidth } = useContainerSize(containerRef);
2452
2462
  const columns = containerWidth > 0 ? containerWidth : 80;
2453
- const nameWidth = Math.max(12, Math.floor(columns * 0.35));
2463
+ const mode = getLayoutMode(columns);
2464
+ const nameWidth = mode === "single" ? Math.max(
2465
+ 8,
2466
+ columns - 2
2467
+ /* cursor + gap */
2468
+ ) : Math.max(12, Math.floor(columns * 0.35));
2454
2469
  const versionWidth = Math.max(8, Math.floor(columns * 0.15));
2455
- const descWidth = Math.max(10, columns - nameWidth - versionWidth - 8);
2456
2470
  const [filter, setFilter] = useState6("");
2457
2471
  const [cursor, setCursor] = useState6(0);
2458
2472
  const [tab, setTab] = useState6("formulae");
@@ -2614,12 +2628,10 @@ function InstalledView() {
2614
2628
  ),
2615
2629
  isSearching && /* @__PURE__ */ jsx19(Box15, { marginBottom: SPACING.xs, borderStyle: "round", borderColor: COLORS.gold, paddingX: SPACING.xs, children: /* @__PURE__ */ jsx19(SearchInput, { defaultValue: filter, onChange: setFilter, isActive: isSearching }) }),
2616
2630
  /* @__PURE__ */ jsxs16(Box15, { gap: SPACING.xs, borderStyle: "single", borderBottom: true, borderTop: false, borderLeft: false, borderRight: false, borderColor: COLORS.border, children: [
2617
- /* @__PURE__ */ jsxs16(Text18, { color: COLORS.text, bold: true, children: [
2618
- " ",
2619
- t("installed_col_package").padEnd(nameWidth)
2620
- ] }),
2621
- /* @__PURE__ */ jsx19(Text18, { color: COLORS.text, bold: true, children: t("installed_col_version").padEnd(versionWidth) }),
2622
- /* @__PURE__ */ jsx19(Text18, { color: COLORS.text, bold: true, children: t("installed_col_status") })
2631
+ /* @__PURE__ */ jsx19(Text18, { color: COLORS.text, children: " " }),
2632
+ /* @__PURE__ */ jsx19(Box15, { width: nameWidth, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx19(Text18, { color: COLORS.text, bold: true, wrap: "truncate", children: t("installed_col_package") }) }),
2633
+ mode !== "single" && /* @__PURE__ */ jsx19(Box15, { width: versionWidth, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx19(Text18, { color: COLORS.text, bold: true, wrap: "truncate", children: t("installed_col_version") }) }),
2634
+ mode !== "single" && mode !== "compact" && /* @__PURE__ */ jsx19(Box15, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx19(Text18, { color: COLORS.text, bold: true, wrap: "truncate", children: t("installed_col_status") }) })
2623
2635
  ] }),
2624
2636
  /* @__PURE__ */ jsxs16(Box15, { flexDirection: "column", children: [
2625
2637
  visible.length === 0 && /* @__PURE__ */ jsx19(Box15, { paddingY: SPACING.xs, justifyContent: "center", children: /* @__PURE__ */ jsx19(Text18, { color: COLORS.textSecondary, italic: true, children: t("installed_noPackages") }) }),
@@ -2630,14 +2642,25 @@ function InstalledView() {
2630
2642
  visible.map((item, i) => {
2631
2643
  const idx = start + i;
2632
2644
  const isCurrent = idx === cursor;
2645
+ const hasBadge = item.outdated || item.pinned || item.kegOnly || item.installedAsDependency;
2633
2646
  return /* @__PURE__ */ jsxs16(SelectableRow, { isCurrent, children: [
2634
- /* @__PURE__ */ jsx19(Text18, { bold: isCurrent, inverse: isCurrent, color: isCurrent ? COLORS.text : COLORS.muted, children: truncate(item.name, nameWidth).padEnd(nameWidth) }),
2635
- /* @__PURE__ */ jsx19(Text18, { color: COLORS.teal, children: item.version.padEnd(versionWidth) }),
2636
- item.outdated && /* @__PURE__ */ jsx19(StatusBadge, { label: t("badge_outdated"), variant: "warning" }),
2637
- item.pinned && /* @__PURE__ */ jsx19(StatusBadge, { label: t("badge_pinned"), variant: "info" }),
2638
- item.kegOnly && /* @__PURE__ */ jsx19(StatusBadge, { label: t("badge_kegOnly"), variant: "muted" }),
2639
- item.installedAsDependency && /* @__PURE__ */ jsx19(StatusBadge, { label: t("badge_dep"), variant: "muted" }),
2640
- !item.outdated && !item.pinned && !item.kegOnly && !item.installedAsDependency && /* @__PURE__ */ jsx19(Text18, { color: COLORS.textSecondary, dimColor: true, children: truncate(item.desc, descWidth) })
2647
+ /* @__PURE__ */ jsx19(Box15, { width: nameWidth, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx19(
2648
+ Text18,
2649
+ {
2650
+ bold: isCurrent,
2651
+ inverse: isCurrent,
2652
+ color: isCurrent ? COLORS.text : COLORS.muted,
2653
+ wrap: "truncate-middle",
2654
+ children: item.name
2655
+ }
2656
+ ) }),
2657
+ mode !== "single" && /* @__PURE__ */ jsx19(Box15, { width: versionWidth, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx19(Text18, { color: COLORS.teal, wrap: "truncate", children: item.version }) }),
2658
+ mode !== "single" && mode !== "compact" && /* @__PURE__ */ jsx19(Box15, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: hasBadge ? /* @__PURE__ */ jsxs16(Box15, { gap: SPACING.xs, children: [
2659
+ item.outdated && /* @__PURE__ */ jsx19(StatusBadge, { label: t("badge_outdated"), variant: "warning" }),
2660
+ item.pinned && /* @__PURE__ */ jsx19(StatusBadge, { label: t("badge_pinned"), variant: "info" }),
2661
+ item.kegOnly && /* @__PURE__ */ jsx19(StatusBadge, { label: t("badge_kegOnly"), variant: "muted" }),
2662
+ item.installedAsDependency && /* @__PURE__ */ jsx19(StatusBadge, { label: t("badge_dep"), variant: "muted" })
2663
+ ] }) : /* @__PURE__ */ jsx19(Text18, { color: COLORS.textSecondary, dimColor: true, wrap: "truncate", children: item.desc }) })
2641
2664
  ] }, item.name);
2642
2665
  }),
2643
2666
  start + MAX_VISIBLE_ROWS < allItems.length && /* @__PURE__ */ jsxs16(Text18, { color: COLORS.textSecondary, dimColor: true, children: [
@@ -2840,7 +2863,7 @@ function SearchView() {
2840
2863
  const idx = start + i;
2841
2864
  const isCurrent = idx === cursor;
2842
2865
  return /* @__PURE__ */ jsxs17(SelectableRow, { isCurrent, children: [
2843
- /* @__PURE__ */ jsx20(Text19, { bold: isCurrent, inverse: isCurrent, children: result.name }),
2866
+ /* @__PURE__ */ jsx20(Box16, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx20(Text19, { bold: isCurrent, inverse: isCurrent, wrap: "truncate-middle", children: result.name }) }),
2844
2867
  /* @__PURE__ */ jsx20(
2845
2868
  StatusBadge,
2846
2869
  {
@@ -3061,7 +3084,16 @@ ${t("outdated_upgradeAllList", { list: allOutdated.map((p) => p.name).join(", ")
3061
3084
  const idx = start + i;
3062
3085
  const isCurrent = idx === cursor;
3063
3086
  return /* @__PURE__ */ jsxs18(SelectableRow, { isCurrent, children: [
3064
- /* @__PURE__ */ jsx21(Text20, { bold: isCurrent, inverse: isCurrent, color: isCurrent ? COLORS.text : COLORS.muted, children: pkg.name }),
3087
+ /* @__PURE__ */ jsx21(Box17, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx21(
3088
+ Text20,
3089
+ {
3090
+ bold: isCurrent,
3091
+ inverse: isCurrent,
3092
+ color: isCurrent ? COLORS.text : COLORS.muted,
3093
+ wrap: "truncate-middle",
3094
+ children: pkg.name
3095
+ }
3096
+ ) }),
3065
3097
  /* @__PURE__ */ jsx21(VersionArrow, { current: pkg.installed_versions[0] ?? "", latest: pkg.current_version }),
3066
3098
  pkg.pinned && /* @__PURE__ */ jsx21(StatusBadge, { label: t("outdated_pinned"), variant: "info" })
3067
3099
  ] }, pkg.name);
@@ -3322,7 +3354,12 @@ function ServicesView() {
3322
3354
  const containerRef = useRef7(null);
3323
3355
  const { width: containerWidth } = useContainerSize(containerRef);
3324
3356
  const cols = containerWidth > 0 ? containerWidth : 80;
3325
- const svcNameWidth = Math.max(12, Math.floor(cols * 0.35));
3357
+ const mode = getLayoutMode(cols);
3358
+ const svcNameWidth = mode === "single" ? Math.max(
3359
+ 8,
3360
+ cols - 2
3361
+ /* cursor + gap */
3362
+ ) : Math.max(12, Math.floor(cols * 0.35));
3326
3363
  const svcStatusWidth = Math.max(8, Math.floor(cols * 0.15));
3327
3364
  const MAX_VISIBLE_ROWS = useVisibleRows({
3328
3365
  reservedRows: lastError || actionInProgress ? 8 : 6,
@@ -3394,12 +3431,10 @@ function ServicesView() {
3394
3431
  ) }),
3395
3432
  /* @__PURE__ */ jsxs20(Box19, { flexDirection: "column", marginTop: SPACING.xs, children: [
3396
3433
  /* @__PURE__ */ jsxs20(Box19, { gap: SPACING.xs, borderStyle: "single", borderBottom: true, borderTop: false, borderLeft: false, borderRight: false, borderColor: COLORS.border, paddingBottom: SPACING.none, children: [
3397
- /* @__PURE__ */ jsxs20(Text22, { bold: true, color: COLORS.text, children: [
3398
- " ",
3399
- t("services_name").padEnd(svcNameWidth)
3400
- ] }),
3401
- /* @__PURE__ */ jsx23(Text22, { bold: true, color: COLORS.text, children: t("services_status").padEnd(svcStatusWidth) }),
3402
- /* @__PURE__ */ jsx23(Text22, { bold: true, color: COLORS.text, children: t("services_user") })
3434
+ /* @__PURE__ */ jsx23(Text22, { bold: true, color: COLORS.text, children: " " }),
3435
+ /* @__PURE__ */ jsx23(Box19, { width: svcNameWidth, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx23(Text22, { bold: true, color: COLORS.text, wrap: "truncate", children: t("services_name") }) }),
3436
+ mode !== "single" && /* @__PURE__ */ jsx23(Box19, { width: svcStatusWidth, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx23(Text22, { bold: true, color: COLORS.text, wrap: "truncate", children: t("services_status") }) }),
3437
+ mode !== "single" && mode !== "compact" && /* @__PURE__ */ jsx23(Box19, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx23(Text22, { bold: true, color: COLORS.text, wrap: "truncate", children: t("services_user") }) })
3403
3438
  ] }),
3404
3439
  start > 0 && /* @__PURE__ */ jsxs20(Text22, { color: COLORS.textSecondary, dimColor: true, children: [
3405
3440
  " ",
@@ -3409,10 +3444,21 @@ function ServicesView() {
3409
3444
  const idx = start + i;
3410
3445
  const isCurrent = idx === cursor;
3411
3446
  return /* @__PURE__ */ jsxs20(SelectableRow, { isCurrent, children: [
3412
- /* @__PURE__ */ jsx23(Text22, { bold: isCurrent, inverse: isCurrent, color: isCurrent ? COLORS.text : COLORS.muted, children: truncate(svc.name, svcNameWidth - 2).padEnd(svcNameWidth - 2) }),
3413
- /* @__PURE__ */ jsx23(StatusBadge, { label: svc.status, variant: STATUS_VARIANTS[svc.status] }),
3414
- /* @__PURE__ */ jsx23(Text22, { color: COLORS.muted, children: svc.user ?? "-" }),
3415
- svc.exit_code != null && svc.exit_code !== 0 && /* @__PURE__ */ jsx23(Text22, { color: COLORS.error, children: t("common_exit", { code: svc.exit_code }) })
3447
+ /* @__PURE__ */ jsx23(Box19, { width: svcNameWidth, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx23(
3448
+ Text22,
3449
+ {
3450
+ bold: isCurrent,
3451
+ inverse: isCurrent,
3452
+ color: isCurrent ? COLORS.text : COLORS.muted,
3453
+ wrap: "truncate-middle",
3454
+ children: svc.name
3455
+ }
3456
+ ) }),
3457
+ mode !== "single" && /* @__PURE__ */ jsx23(Box19, { width: svcStatusWidth, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx23(StatusBadge, { label: svc.status, variant: STATUS_VARIANTS[svc.status] }) }),
3458
+ mode !== "single" && mode !== "compact" && /* @__PURE__ */ jsxs20(Box19, { flexGrow: 1, flexShrink: 1, minWidth: 0, gap: SPACING.xs, children: [
3459
+ /* @__PURE__ */ jsx23(Text22, { color: COLORS.muted, wrap: "truncate", children: svc.user ?? "-" }),
3460
+ svc.exit_code != null && svc.exit_code !== 0 && /* @__PURE__ */ jsx23(Text22, { color: COLORS.error, children: t("common_exit", { code: svc.exit_code }) })
3461
+ ] })
3416
3462
  ] }, svc.name);
3417
3463
  }),
3418
3464
  start + MAX_VISIBLE_ROWS < services.length && /* @__PURE__ */ jsxs20(Text22, { color: COLORS.textSecondary, dimColor: true, children: [
@@ -4529,8 +4575,8 @@ function HistoryView() {
4529
4575
  const ts = new Date(entry.timestamp).getTime() / 1e3;
4530
4576
  return /* @__PURE__ */ jsxs28(SelectableRow, { isCurrent, children: [
4531
4577
  /* @__PURE__ */ jsx31(Text29, { color, bold: true, children: icon }),
4532
- /* @__PURE__ */ jsx31(Text29, { bold: isCurrent, inverse: isCurrent, color: isCurrent ? COLORS.text : COLORS.muted, children: t(ACTION_LABEL_KEYS[entry.action]).padEnd(12) }),
4533
- /* @__PURE__ */ jsx31(Text29, { color: COLORS.text, children: entry.packageName ?? t("history_all") }),
4578
+ /* @__PURE__ */ jsx31(Box27, { width: 14, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx31(Text29, { bold: isCurrent, inverse: isCurrent, color: isCurrent ? COLORS.text : COLORS.muted, wrap: "truncate", children: t(ACTION_LABEL_KEYS[entry.action]) }) }),
4579
+ /* @__PURE__ */ jsx31(Box27, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: /* @__PURE__ */ jsx31(Text29, { color: COLORS.text, wrap: "truncate-middle", children: entry.packageName ?? t("history_all") }) }),
4534
4580
  entry.success ? /* @__PURE__ */ jsx31(StatusBadge, { label: t("badge_ok"), variant: "success" }) : /* @__PURE__ */ jsx31(StatusBadge, { label: t("badge_fail"), variant: "error" }),
4535
4581
  /* @__PURE__ */ jsx31(Text29, { color: COLORS.muted, children: formatRelativeTime(ts) })
4536
4582
  ] }, entry.id);
@@ -4913,7 +4959,7 @@ function AccountView() {
4913
4959
  status === "pro" || status === "team" || status === "expired" ? `v ${t("hint_revalidate")} ` : "",
4914
4960
  revalidating ? t("account_revalidating") : "",
4915
4961
  " ",
4916
- t("app_version", { version: "1.1.0" })
4962
+ t("app_version", { version: "1.2.0" })
4917
4963
  ] }) })
4918
4964
  ] });
4919
4965
  }
@@ -6397,7 +6443,7 @@ async function reportError(err, context = {}) {
6397
6443
  const config = await resolveConfig();
6398
6444
  if (!config.enabled || !config.endpoint) return;
6399
6445
  const machineId = await getMachineId();
6400
- const version = true ? "1.1.0" : "unknown";
6446
+ const version = true ? "1.2.0" : "unknown";
6401
6447
  await postReport(buildReport("error", err, context, machineId, version), config);
6402
6448
  }
6403
6449
  async function installCrashReporter() {
@@ -6406,7 +6452,7 @@ async function installCrashReporter() {
6406
6452
  if (!config.enabled || !config.endpoint) return;
6407
6453
  _installed = true;
6408
6454
  const machineId = await getMachineId();
6409
- const version = true ? "1.1.0" : "unknown";
6455
+ const version = true ? "1.2.0" : "unknown";
6410
6456
  process.on("uncaughtException", (err) => {
6411
6457
  void postReport(buildReport("fatal", err, { kind: "uncaughtException" }, machineId, version), config);
6412
6458
  });
@@ -6421,7 +6467,7 @@ import { jsx as jsx39 } from "react/jsx-runtime";
6421
6467
  var [, , command, arg] = process.argv;
6422
6468
  async function runCli() {
6423
6469
  if (command === "--version" || command === "-v" || command === "version") {
6424
- process.stdout.write("1.1.0\n");
6470
+ process.stdout.write("1.2.0\n");
6425
6471
  return;
6426
6472
  }
6427
6473
  await ensureDataDirs();
@@ -6604,7 +6650,7 @@ async function ensureBrewBarRunning() {
6604
6650
  await useLicenseStore.getState().initialize();
6605
6651
  if (!useLicenseStore.getState().isPro()) return;
6606
6652
  const { isBrewBarInstalled, installBrewBar, launchBrewBar } = await import("./brewbar-installer-GWJ76J6G.js");
6607
- const { checkBrewBarVersion } = await import("./version-check-LVSQFXZU.js");
6653
+ const { checkBrewBarVersion } = await import("./version-check-MJZDQG73.js");
6608
6654
  try {
6609
6655
  if (!await isBrewBarInstalled()) {
6610
6656
  console.log(t("cli_brewbarInstalling"));