@hanzo/app 0.3.7 → 0.3.9

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/Account.js CHANGED
@@ -43,7 +43,7 @@ import { Button, Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuC
43
43
  import { api } from './lib/api.js';
44
44
  import { createOrg, say } from './lib/org.js';
45
45
  import { list } from './lib/list.js';
46
- import { choose, org as current, orgs, pick, renew, scope, superAdmin } from './lib/session.js';
46
+ import { choose, org as current, orgs, renew, reopen, scope, superAdmin } from './lib/session.js';
47
47
  import { ENTRY, settings } from './lib/host.js';
48
48
  import { leave } from './dev.js';
49
49
  import { payUrl } from './lib/pay.js';
@@ -277,9 +277,11 @@ function Create({ open, onOpenChange }) {
277
277
  catch {
278
278
  /* the next load simply says nothing */
279
279
  }
280
- pick(org);
281
280
  renew();
282
- window.location.assign('/');
281
+ // The app again, where the person is, in the new organization. Not `/`: on
282
+ // hanzo.ai that is the landing for everyone (owner, 2026-10-29), so a
283
+ // person who made an organization from /chat was left on the marketing page.
284
+ reopen(org);
283
285
  }
284
286
  catch (e) {
285
287
  setRefused(say(e, t));
@@ -307,8 +309,7 @@ export function Made() {
307
309
  return sessionStorage.removeItem(MADE);
308
310
  // Still out of the token: go on working where the person was.
309
311
  if (kept.from && current() !== kept.from && orgs().includes(kept.from)) {
310
- pick(kept.from);
311
- return window.location.reload();
312
+ return reopen(kept.from);
312
313
  }
313
314
  setMade({ org: kept.org, name: kept.name || kept.org });
314
315
  }
package/dist/Gate.js CHANGED
@@ -44,7 +44,7 @@ import { useHostname } from './lib/hostname.js';
44
44
  import { useHydrated } from './lib/hydrated.js';
45
45
  import { api } from './lib/api.js';
46
46
  import { usePersonal, useTier } from './lib/tier.js';
47
- import { CHOOSE, ORG, assumed, bearer, hasSession, org, orgs as claimed, pick, renew, role, scope, superAdmin, support } from './lib/session.js';
47
+ import { CHOOSE, ORG, assumed, bearer, hasSession, org, orgs as claimed, pick, renew, reopen, role, scope, superAdmin, support } from './lib/session.js';
48
48
  import { matches, refusal, slugify } from './lib/orgname.js';
49
49
  import { team as workspace } from './lib/host.js';
50
50
  import { checkoutUrl, money } from './lib/pay.js';
@@ -713,8 +713,7 @@ function Found({ onClose }) {
713
713
  throw new Error(t('{org} is made, and it is still called {org}: {reason}', { org: made, reason: say(err, t) }));
714
714
  });
715
715
  }
716
- pick(made);
717
- window.location.reload();
716
+ reopen(made);
718
717
  }
719
718
  catch (err) {
720
719
  setRefused(say(err, t));
package/dist/Header.js CHANGED
@@ -85,7 +85,10 @@ export function Header({ back, account }) {
85
85
  const others = accounts.filter((a) => a.sub !== current?.sub);
86
86
  const signed = isAuthenticated && Boolean(who);
87
87
  const moved = useMoved();
88
- return (_jsxs(XStack, { render: "header", "data-slot": "masthead", "data-scrolled": moved ? 'true' : 'false', "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, position: "sticky", t: 0, z: "var(--z-header)", shrink: 0, boxSizing: "content-box", height: HEIGHT, pt: NOTCH, px: GUTTER, gap: 12, items: "center", bg: moved ? GLASS : 'transparent', backdropFilter: moved ? BLUR : 'none', transition: "quickest", borderBottomWidth: 0, children: [_jsx(Home, {}), back, _jsx(View, { flex: 1, "data-tauri-drag-region": "deep" }), account !== undefined ? account : signed ? (_jsx(View, { render: "section", "aria-label": t('Account'), display: "flex", children: _jsxs(DropdownMenu, { placement: dir === 'rtl' ? 'bottom-start' : 'bottom-end', offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(XStack, { render: "button", "aria-label": t('Account: {name}', { name: who }), width: 40, height: 40, rounded: 999, items: "center", justify: "center", borderWidth: 0, bg: "transparent", hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, cursor: "pointer", children: _jsx(Avatar, { src: avatar || null, name: who, alt: "" }) }) }), _jsxs(DropdownMenuContent, { minW: 240, maxW: "calc(100vw - 16px)", "aria-labelledby": undefined, "aria-label": t('Account'), children: [_jsx(DropdownMenuLabel, { children: _jsxs(YStack, { minW: 0, gap: 2, children: [_jsx(Text, { fontSize: "$3", fontWeight: "500", color: "$ink", numberOfLines: 1, children: who }), name && email ? (_jsx(Text, { fontSize: "$2", color: "$soft", numberOfLines: 1, children: email })) : null] }) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => window.location.assign(site('/support')), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Help') }) }), _jsx(DropdownMenuSeparator, {}), others.map((a) => (_jsx(DropdownMenuItem, { onSelect: () => void switchTo(a), children: _jsx(XStack, { items: "center", gap: 10, minW: 0, children: _jsx(Face, { account: a }) }) }, a.sub))), _jsx(DropdownMenuItem, { onSelect: () => void add(), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Add account') }) }), _jsx(DropdownMenuItem, { onSelect: out, children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Log out') }) })] })] }) })) : null, _jsx(WindowControls, {})] }));
88
+ return (_jsxs(XStack, { render: "header", "data-slot": "masthead", "data-scrolled": moved ? 'true' : 'false', "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, position: "sticky", t: 0, z: "var(--z-header)", shrink: 0, boxSizing: "content-box", height: HEIGHT, pt: NOTCH, px: GUTTER, gap: 12, items: "center", bg: moved ? GLASS : 'transparent', backdropFilter: moved ? BLUR : 'none', transition: "quickest", borderBottomWidth: 0, children: [_jsx(Home, {}), back, _jsx(View, { flex: 1, "data-tauri-drag-region": "deep" }), account !== undefined ? account : signed ? (_jsx(View, { render: "section", "aria-label": t('Account'), display: "flex", children: _jsxs(DropdownMenu, { placement: dir === 'rtl' ? 'bottom-start' : 'bottom-end', offset: 8, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(XStack, { render: "button", "aria-label": t('Account: {name}', { name: who }), width: 40, height: 40,
89
+ // The face on the gutter, as the name is at the start (Home's -PAD): the 40px
90
+ // target reaches 4px past it, never the face.
91
+ marginInlineEnd: -4, rounded: 999, items: "center", justify: "center", borderWidth: 0, bg: "transparent", hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, cursor: "pointer", children: _jsx(Avatar, { src: avatar || null, name: who, alt: "" }) }) }), _jsxs(DropdownMenuContent, { minW: 240, maxW: "calc(100vw - 16px)", "aria-labelledby": undefined, "aria-label": t('Account'), children: [_jsx(DropdownMenuLabel, { children: _jsxs(YStack, { minW: 0, gap: 2, children: [_jsx(Text, { fontSize: "$3", fontWeight: "500", color: "$ink", numberOfLines: 1, children: who }), name && email ? (_jsx(Text, { fontSize: "$2", color: "$soft", numberOfLines: 1, children: email })) : null] }) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: () => window.location.assign(site('/support')), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Help') }) }), _jsx(DropdownMenuSeparator, {}), others.map((a) => (_jsx(DropdownMenuItem, { onSelect: () => void switchTo(a), children: _jsx(XStack, { items: "center", gap: 10, minW: 0, children: _jsx(Face, { account: a }) }) }, a.sub))), _jsx(DropdownMenuItem, { onSelect: () => void add(), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Add account') }) }), _jsx(DropdownMenuItem, { onSelect: out, children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Log out') }) })] })] }) })) : null, _jsx(WindowControls, {})] }));
89
92
  }
90
93
  /**
91
94
  * The name, going to this host's root. Lit (the outline and the arrow before the
package/dist/Rail.js CHANGED
@@ -125,10 +125,12 @@ export function Rail({ host, mode, at, open, toggle, inside = null, rows = false
125
125
  if (rows)
126
126
  return (_jsxs(YStack, { "data-slot": "places", render: "nav", "aria-label": t('Products'), pt: "$2", shrink: 0, children: [_jsxs(YStack, { role: "list", gap: 2, children: [_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "place-studio", icon: _jsx(WandSparkles, { size: 16, "aria-hidden": true }) }) }), _jsx(YStack, { role: "listitem", children: _jsx(Row, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "place-tabs", icon: _jsx(SquareTerminal, { size: 16, "aria-hidden": true }) }) }), apps.map((a) => (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `place-app-${a.id}`, icon: _jsx(a.icon, { size: 16, "aria-hidden": true }) }) }, a.id))), _jsx(YStack, { role: "listitem", children: _jsx(DropdownMenu, { placement: "bottom-start", minWidth: 220, trigger: _jsx(Row, { label: t('More'), "data-slot": "place-more", "aria-haspopup": "menu", icon: _jsx(Ellipsis, { size: 16, "aria-hidden": true }) }), items: rest }) })] }), betasDialog] }));
127
127
  return (_jsxs(YStack, { "data-slot": "rail", render: "nav", "aria-label": t('Products'), width: RAIL, flex: 1,
128
+ // As tall as the window and no taller: its marks scroll inside it (below), never the page.
129
+ minH: 0,
128
130
  // The first mark stands at the pane's top edge, one head row high (HEAD), the account on the sidebar's foot (Sidebar's `pb`).
129
- pt: (HEAD - MARK) / 2, pb: "$2", gap: 4, shrink: 0, items: "center", $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2 }, children: [toggle ? (_jsx(YStack, { pb: 4, children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(MessageSquare, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Dev", on: mode === 'dev' && !here, onPress: onDev, "data-slot": "rail-dev", children: _jsx(Code2, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "rail-studio", children: _jsx(WandSparkles, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "rail-tabs", children: _jsx(SquareTerminal, { size: 18, "aria-hidden": true }) }), apps.map((a) => (_jsx(Mark, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `rail-app-${a.id}`, children: _jsx(a.icon, { size: 18, "aria-hidden": true }) }, a.id))), _jsx(Mark, { label: t('Library'), on: here === 'library', onPress: to(RAISED.library), "data-slot": "rail-library", children: _jsx(Library, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Scheduled tasks'), on: here === 'scheduled', onPress: to(RAISED.scheduled), "data-slot": "rail-scheduled", children: _jsx(Clock, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Customize'), on: here === 'customize', onPress: to(RAISED.customize), "data-slot": "rail-customize", children: _jsx(Puzzle, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Betas'), on: mode === 'beta', onPress: () => go('/beta'), "data-slot": "rail-betas", children: _jsx(FlaskConical, { size: 18, "aria-hidden": true }) }), betasDialog, rest.length ? (_jsx(DropdownMenu
130
- // Toward the content: right of the rail, left of it right to left.
131
- , {
132
- // Toward the content: right of the rail, left of it right to left.
133
- placement: dir === 'rtl' ? 'left-start' : 'right-start', minWidth: 220, trigger: _jsx(XStack, { render: "button", "aria-label": t('More'), ...{ title: t('More') }, "data-slot": "rail-more", width: MARK, height: MARK, rounded: "$4", items: "center", justify: "center", cursor: "pointer", opacity: 0.62, hoverStyle: { bg: '$hover', opacity: 1 }, pressStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, $touchable: { width: 44, height: 44 }, children: _jsx(Ellipsis, { size: 18, "aria-hidden": true }) }), items: rest })) : null, _jsx(YStack, { flex: 1 }), _jsx(Account, { host: host, narrow: true, onOrg: onOrg })] }));
131
+ pt: (HEAD - MARK) / 2, pb: "$2", gap: 4, shrink: 0, items: "center", $touchable: { pt: (TOUCH_HEAD - TOUCH) / 2 }, children: [toggle ? (_jsx(YStack, { pb: 4, children: _jsx(Toggle, { open: open, onPress: toggle }) })) : null, _jsxs(YStack, { "data-slot": "rail-marks", flex: 1, minH: 0, overflowY: "auto", overflowX: "hidden", items: "center", gap: 4, width: "100%", "$platform-web": { scrollbarWidth: 'none' }, children: [_jsx(Mark, { label: t('Chat'), on: mode === 'chat', onPress: onChat, "data-slot": "rail-chat", children: _jsx(MessageSquare, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Dev", on: mode === 'dev' && !here, onPress: onDev, "data-slot": "rail-dev", children: _jsx(Code2, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Studio", on: mode === 'studio', onPress: onStudio, "data-slot": "rail-studio", children: _jsx(WandSparkles, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: "Tabs", on: mode === 'tabs', onPress: onTabs, "data-slot": "rail-tabs", children: _jsx(SquareTerminal, { size: 18, "aria-hidden": true }) }), apps.map((a) => (_jsx(Mark, { label: a.name, on: inside === a.id, onPress: () => go(hosted(a.id)), "data-slot": `rail-app-${a.id}`, children: _jsx(a.icon, { size: 18, "aria-hidden": true }) }, a.id))), _jsx(Mark, { label: t('Library'), on: here === 'library', onPress: to(RAISED.library), "data-slot": "rail-library", children: _jsx(Library, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Scheduled tasks'), on: here === 'scheduled', onPress: to(RAISED.scheduled), "data-slot": "rail-scheduled", children: _jsx(Clock, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Customize'), on: here === 'customize', onPress: to(RAISED.customize), "data-slot": "rail-customize", children: _jsx(Puzzle, { size: 18, "aria-hidden": true }) }), _jsx(Mark, { label: t('Betas'), on: mode === 'beta', onPress: () => go('/beta'), "data-slot": "rail-betas", children: _jsx(FlaskConical, { size: 18, "aria-hidden": true }) }), betasDialog, rest.length ? (_jsx(DropdownMenu
132
+ // Toward the content: right of the rail, left of it right to left.
133
+ , {
134
+ // Toward the content: right of the rail, left of it right to left.
135
+ placement: dir === 'rtl' ? 'left-start' : 'right-start', minWidth: 220, trigger: _jsx(XStack, { render: "button", "aria-label": t('More'), ...{ title: t('More') }, "data-slot": "rail-more", width: MARK, height: MARK, rounded: "$4", items: "center", justify: "center", cursor: "pointer", opacity: 0.62, hoverStyle: { bg: '$hover', opacity: 1 }, pressStyle: { bg: '$raised' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: '$outlineColor' }, $touchable: { width: 44, height: 44 }, children: _jsx(Ellipsis, { size: 18, "aria-hidden": true }) }), items: rest })) : null] }), _jsx(Account, { host: host, narrow: true, onOrg: onOrg })] }));
134
136
  }
@@ -188,6 +188,15 @@ export declare const ORG = "hanzo:org";
188
188
  * answers, so the gate does not ask for it again.
189
189
  */
190
190
  export declare function pick(o: string): void;
191
+ /**
192
+ * Open the app again in this organization: the SDK's selection, written and
193
+ * NOT announced, then the reload. For an organization the token in memory does
194
+ * not name yet (one just made, one stepped into): announced, the rooms remount
195
+ * before the reload under that token, and @hanzo/iam's provider, finding the
196
+ * organization missing from it, writes the token's first organization back over
197
+ * the choice (useOrganizations), so the reload opened the wrong one.
198
+ */
199
+ export declare function reopen(o: string): void;
191
200
  /** Fired on `window` to open the organization chooser over the shell. */
192
201
  export declare const CHOOSE = "hanzo:org:choose";
193
202
  /** Open the chooser (`Gate`): every organization of the person's, and every one for a SuperAdmin. */
@@ -459,13 +459,28 @@ export const ORG = 'hanzo:org';
459
459
  * answers, so the gate does not ask for it again.
460
460
  */
461
461
  export function pick(o) {
462
+ keep(o);
463
+ window.dispatchEvent(new Event(ORG));
464
+ }
465
+ function keep(o) {
462
466
  try {
463
467
  window.localStorage.setItem(`${PREFIX}current_org`, o);
464
468
  }
465
469
  catch {
466
470
  /* the choice lives only in this page */
467
471
  }
468
- window.dispatchEvent(new Event(ORG));
472
+ }
473
+ /**
474
+ * Open the app again in this organization: the SDK's selection, written and
475
+ * NOT announced, then the reload. For an organization the token in memory does
476
+ * not name yet (one just made, one stepped into): announced, the rooms remount
477
+ * before the reload under that token, and @hanzo/iam's provider, finding the
478
+ * organization missing from it, writes the token's first organization back over
479
+ * the choice (useOrganizations), so the reload opened the wrong one.
480
+ */
481
+ export function reopen(o) {
482
+ keep(o);
483
+ window.location.reload();
469
484
  }
470
485
  /** Fired on `window` to open the organization chooser over the shell. */
471
486
  export const CHOOSE = 'hanzo:org:choose';
@@ -518,8 +533,7 @@ export async function support(org) {
518
533
  throw new Error(body?.msg || `IAM answered ${res.status}.`);
519
534
  tokens().setItem(ACCESS, next);
520
535
  tokens().setItem(EXPIRES, String(exp * 1000));
521
- pick(org ?? opened(next)[0] ?? '');
522
- window.location.reload();
536
+ reopen(org ?? opened(next)[0] ?? '');
523
537
  }
524
538
  /**
525
539
  * Leave support mode when IAM cannot answer the step out: the stored token is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/app",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",