sideby 0.32.0 → 0.32.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.
package/dist/build.json CHANGED
@@ -1 +1 @@
1
- {"id":"20261030T091708-6dfc06"}
1
+ {"id":"20261030T095351-4f4eaf"}
@@ -45,7 +45,7 @@ function run(argv) {
45
45
 
46
46
  var out = ObjC.unwrap($.NSTemporaryDirectory()) + 'sideby-menubar-' + $.NSProcessInfo.processInfo.processIdentifier + '.json';
47
47
  var snap = null, task = null, handle = null, lastStart = 0, lastOk = 0, failed = false;
48
- var refs = [], actions = [], footer = null, appearance = '';
48
+ var refs = [], actions = [], footer = null, appearance = '', manual = false;
49
49
  // The first words, before any snapshot has said which language to use.
50
50
  var zh = /^zh/i.test(lang);
51
51
  var CARD_ICON = ${JSON.stringify(FAVICON_SVG)};
@@ -89,6 +89,7 @@ function run(argv) {
89
89
  function finishSnapshot() {
90
90
  var ok = task.terminationStatus === 0;
91
91
  task = null;
92
+ manual = false;
92
93
  closeHandle();
93
94
  if (ok) {
94
95
  try {
@@ -233,7 +234,7 @@ function run(argv) {
233
234
  function footerText() {
234
235
  if (!snap) return LOADING;
235
236
  var l = snap.labels;
236
- if (task && !lastOk) return l.refreshing;
237
+ if (task && (manual || !lastOk)) return l.refreshing;
237
238
  if (failed) return l.refreshFailed;
238
239
  var minutes = Math.floor((now() - lastOk) / 60);
239
240
  return minutes < 1 ? l.updatedJustNow : l.updatedMinutes.replace('{n}', String(minutes));
@@ -465,10 +466,52 @@ function run(argv) {
465
466
  if (img) mi.image = img;
466
467
  return mi;
467
468
  }
469
+ // The last line: when the numbers were checked, and a refresh button. A button in a view keeps the menu open, so
470
+ // a click shows "Refreshing…" and then the new numbers in place, as menu bar apps such as CodexBar do. ⌘R does the
471
+ // same through a hidden item.
472
+ function footerItem(menu, L, refreshTitle) {
473
+ var W = Math.max(280, L ? L.width : 280), H = 24;
474
+ var v = $.NSView.alloc.initWithFrame($.NSMakeRect(0, 0, W, H));
475
+ v.autoresizingMask = $.NSViewWidthSizable;
476
+ var clock = symbol('clock');
477
+ if (clock) {
478
+ var iv = $.NSImageView.imageViewWithImage(clock);
479
+ iv.frame = $.NSMakeRect(HEAD_X, (H - 14) / 2, 14, 14);
480
+ iv.contentTintColor = $.NSColor.secondaryLabelColor;
481
+ v.addSubview(iv);
482
+ }
483
+ footer = $.NSTextField.labelWithString(footerText());
484
+ footer.font = $.NSFont.menuFontOfSize(0);
485
+ footer.textColor = $.NSColor.secondaryLabelColor;
486
+ footer.frame = $.NSMakeRect(HEAD_TEXT_X, (H - 17) / 2, W - HEAD_TEXT_X - 44, 17);
487
+ v.addSubview(footer);
488
+ if (refreshTitle) {
489
+ var b = $.NSButton.alloc.initWithFrame($.NSMakeRect(W - 38, (H - 22) / 2, 26, 22));
490
+ b.autoresizingMask = $.NSViewMinXMargin;
491
+ b.bezelStyle = $.NSBezelStyleRecessed;
492
+ b.showsBorderOnlyWhileMouseInside = true;
493
+ b.image = symbol('arrow.clockwise');
494
+ b.imagePosition = $.NSImageOnly;
495
+ b.toolTip = refreshTitle + ' (⌘R)';
496
+ b.target = target;
497
+ b.action = 'refresh:';
498
+ v.addSubview(b);
499
+ var key = $.NSMenuItem.alloc.initWithTitleActionKeyEquivalent(refreshTitle, 'refresh:', 'r');
500
+ key.target = target;
501
+ key.hidden = true;
502
+ key.allowsKeyEquivalentWhenHidden = true;
503
+ menu.addItem(key);
504
+ }
505
+ var mi = $.NSMenuItem.alloc.init;
506
+ mi.view = v;
507
+ menu.addItem(mi);
508
+ }
509
+ // One menu for the item's life: a rebuild swaps its items, so an open menu shows new numbers in place.
510
+ var menu = $.NSMenu.alloc.init;
511
+ menu.autoenablesItems = false;
468
512
  function build() {
469
513
  drawTitle();
470
- var menu = $.NSMenu.alloc.init;
471
- menu.autoenablesItems = false;
514
+ menu.removeAllItems;
472
515
  refs = [];
473
516
  if (snap) {
474
517
  var L = layout(snap.sections);
@@ -496,15 +539,14 @@ function run(argv) {
496
539
  }
497
540
  });
498
541
  menu.addItem($.NSMenuItem.separatorItem);
499
- footer = withImage(add(menu, footerText(), null), 'clock');
500
- withImage(add(menu, snap.labels.refresh, 'refresh:', 0, 'r'), 'arrow.clockwise');
542
+ footerItem(menu, L, snap.labels.refresh);
501
543
  withImage(add(menu, snap.labels.openPanel, 'openPanel:', 0, 'o'), 'macwindow');
502
544
  menu.addItem($.NSMenuItem.separatorItem);
503
545
  if (hotkeyStatus === 'taken' && hotkeyWant)
504
546
  withImage(add(menu, snap.labels.hotkeyTaken.replace('{key}', hotkeyWant.label), 'openPanel:'), 'keyboard');
505
547
  withImage(add(menu, snap.labels.hide, 'hide:'), 'eye.slash');
506
548
  } else {
507
- footer = withImage(add(menu, footerText(), null), 'clock');
549
+ footerItem(menu, null, null);
508
550
  withImage(add(menu, OPEN_PANEL, 'openPanel:', 0, 'o'), 'macwindow');
509
551
  }
510
552
  closeItem(menu);
@@ -538,14 +580,16 @@ function run(argv) {
538
580
  // The bars are pictures in the colours of the moment; redraw them when light or dark mode changes.
539
581
  if (ObjC.unwrap(app.effectiveAppearance.name) !== appearance) build();
540
582
  else drawTitle();
541
- if (footer) footer.title = footerText();
583
+ if (footer) footer.stringValue = footerText();
542
584
  },
543
585
  },
544
586
  'refresh:': {
545
587
  types: ['void', ['id']],
546
588
  implementation: function () {
547
589
  // A manual refresh must query the Host, even if an automatic cache read is already running.
590
+ manual = true;
548
591
  startSnapshot(true);
592
+ if (footer) footer.stringValue = footerText();
549
593
  },
550
594
  },
551
595
  // A setting changed (the shortcut): read the snapshot again now, after one that is running, with no restart.
@@ -592,7 +636,8 @@ function run(argv) {
592
636
  $.NSDistributedNotificationCenter.defaultCenter.addObserverSelectorNameObject(target, 'reload:', $('${MENUBAR_RELOAD}'), $());
593
637
  build();
594
638
  startSnapshot();
595
- $.NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(TICK, target, 'tick:', $(), true);
639
+ // Common modes: the tick also runs while the menu is open, so a refresh started there lands in place.
640
+ $.NSRunLoop.mainRunLoop.addTimerForMode($.NSTimer.timerWithTimeIntervalTargetSelectorUserInfoRepeats(TICK, target, 'tick:', $(), true), $.NSRunLoopCommonModes);
596
641
  app.run;
597
642
  }
598
643
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sideby",
3
- "version": "0.32.0",
3
+ "version": "0.32.1",
4
4
  "description": "Run work, personal and API-key accounts at the same time, without their configs drifting apart.",
5
5
  "license": "MIT",
6
6
  "author": "Adonis0123 (https://github.com/Adonis0123)",
@@ -2,7 +2,7 @@
2
2
  name: sideby
3
3
  description: Use when the user runs, or wants to run, several AI coding accounts (Claude Code, Codex, Grok Build, pi) side by side. Covers installing sideby and setting up a new account ("install sideby", "set up another Claude account", "add cc008", "配置一个 cc00x", "再加一个 Codex 账号"), explaining what accounts share and what stays separate ("what do my accounts share?", "这些账号共享了什么"), showing which account a session is ("show [cc001] in the status line", "加上账号标识"), finding a past session of any account ("找一下我上周改登录页的那个会话"), telling another running session something, in any account ("告诉 cc002 ……", "给跑构建的那个会话发消息"; Claude Code's own SendMessage reaches only sessions of the same account), seeing accounts, quota and usage, moving on when one hits its 5-hour or weekly limit, moving the current task to another account ("用 cc008 继续", "交回 cc008"), adding a short command (alias) or a pick command that starts whichever account has the most quota ("加个 cc"), adding an API account from a vendor's docs ("加一个 DeepSeek API 账号"), supporting a new tool, and repairing drifted account directories (skills, hooks, rules or settings not shared, wrong symlinks, credential file permissions). Drives the `sideby` CLI with `--json`; the agent does every step except browser sign-in, filling in secrets and starting interactive sessions, which it hands to the user as one command (inside an Auto Handoff session, `sideby handoff ready --to` moves the task itself).
4
4
  metadata:
5
- version: "0.32.0"
5
+ version: "0.32.1"
6
6
  requires:
7
7
  bins: [sideby, node]
8
8
  cliHelp: sideby --help