autosolutions-os 0.2.2 → 0.2.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.3 - 2026-10-01
4
+
5
+ With `autosolutions-design-system` 6.3.4, whose frame fixes this release
6
+ wires up. The design-system peer range is now `>=6.3.4 <7`: the Hub's rail
7
+ rule below tells Back to hub from the rail's Hub by 6.3.4's `back` flag,
8
+ and an older design system does not send it.
9
+
10
+ - **The rail's Hub, in the Hub, reopens its menu where the person is.**
11
+ After browsing another function's menu, the rail's Hub left any Hub page
12
+ that was not Smart Comms (an Agent thread, Brand Voice, the Signature
13
+ Generator) for `/comms/overview`: the thread or the form was gone, a
14
+ history entry was added, the Hub menu stayed closed, and from the
15
+ launcher focus fell to the page as the shell changed, all from a control
16
+ announced as "Hub, collapsed". `osFrame().targetFor` now answers the hub
17
+ function with no row with nothing (no navigation) when the URL is already
18
+ in that function and it has a menu, so the frame reopens the Hub menu on
19
+ the current page, expanded, focus kept, as it already did on the
20
+ Overview. From another place (Admin, or an app's own Settings) it still
21
+ lands on the Hub's landing, and Back to hub (`back: true`, design system
22
+ 6.3.4) lands there from anywhere, as before. Other apps are unchanged:
23
+ their rail Hub goes to the Hub.
24
+ - **A company with no artwork has its name on the plate.** With 6.3.4 the
25
+ plate shows the acting company's name when `markFor(tenant, "plain")`
26
+ does not load (a company outside the brand bucket's eight with no stored
27
+ logo, such as one created in Admin), where it showed a broken image.
28
+ `OsWorkspaceFrame` passes the name it always passed. In the company menu,
29
+ a company whose mark does not load keeps its name and drops the image.
30
+ - **Tab order** and **the bar on a phone** come with 6.3.4 and need nothing
31
+ here: an open menu is next in Tab order after its function, and at 767px
32
+ and below the bar fits the screen with the plate whole.
33
+ - **A direct caller of `targetFor` that means Back to hub passes
34
+ `back: true`.** In the Hub (`appKey: "hub"`), `targetFor` with the hub
35
+ function and no row, and no flag, now means the rail's Hub: from a Hub
36
+ page outside the landing (an Agent thread, Brand Voice, the Signature
37
+ Generator) it answers `null`, where 0.2.2 answered the landing. Back to
38
+ hub is `{ fn: { id: "hub" }, item: null, tab: null, back: true }`, which
39
+ still lands on the landing from anywhere. `OsWorkspaceFrame` passes the
40
+ frame's state whole, so an app that renders it changes nothing but the
41
+ two versions; so does an app that wires the design system's
42
+ `WorkspaceFrame` to `osFrame` itself and passes the state to `targetFor`
43
+ whole, `back` included. Outside the Hub nothing changes: the hub function
44
+ with no row goes to the Hub either way.
45
+ - **The Hub's adoption commit also updates one test.** Its
46
+ `src/launcher/nav.test.ts` models Back to hub ("lands Back to hub on the
47
+ Overview from anywhere off it") as the hub function with no row and no
48
+ flag, which fails on 0.2.3 for `/comms/agent/abc` and
49
+ `/launcher?section=brandvoice`. It builds the state with `back: true`
50
+ instead:
51
+
52
+ ```ts
53
+ const back: OsFrameState = { fn: { id: "hub" }, item: null, tab: null, back: true };
54
+ expect(frame(everyone, { location: from }).targetFor(back, from), from)
55
+ .toEqual({ href: "/comms/overview", external: false });
56
+ ```
57
+
3
58
  ## 0.2.2 - 2026-09-30
4
59
 
5
60
  With `autosolutions-design-system` 6.3.3, whose frame fixes this release
package/README.md CHANGED
@@ -35,9 +35,14 @@ export function App() {
35
35
  the top bar with the company's mark and switcher, the rail, the OS menu (the 53
36
36
  tools of the menu map: the handoff's 49 plus Shelf simulator, Key accounts, PM
37
37
  Copilot and Candidate hub), the footer with Admin for people who manage something, and the
38
- browser-tab icon. It needs `autosolutions-design-system` 6.3.3 or later
39
- (an optional peer: only this entry point uses it). Take this package's 0.2.2
40
- and the design system's 6.3.3 together, in one commit.
38
+ browser-tab icon. It needs `autosolutions-design-system` 6.3.4 or later
39
+ (an optional peer: only this entry point uses it). Take this package's 0.2.3
40
+ and the design system's 6.3.4 together, in one commit. An app that renders
41
+ `OsWorkspaceFrame` changes nothing else. Code that calls `osFrame().targetFor`
42
+ itself in the Hub (a test of the Hub's rows, say) and means Back to hub passes
43
+ `back: true`: since 0.2.3 the hub function with no row and no flag is the
44
+ rail's Hub (see below). The Hub's adoption of 0.2.3 updates its one test that
45
+ does this (the CHANGELOG has the change).
41
46
 
42
47
  ```tsx
43
48
  import { OsWorkspaceFrame } from "autosolutions-os/frame";
@@ -101,7 +106,10 @@ why).
101
106
  (`staticLinks()`). Tools with no app follow the map: Pricing researcher and
102
107
  Brand voice copywriter read "Live, not linked from the Hub yet", anything
103
108
  not Live shows its status.
104
- - The company plate is `markFor(tenant, "plain")`. The chevron appears only for
109
+ - The company plate is `markFor(tenant, "plain")`. A company with no artwork
110
+ there (one outside the brand bucket's eight, with no stored logo), or whose
111
+ artwork fails to load, has its name on the plate instead, and its row in
112
+ the company menu drops the broken mark. The chevron appears only for
105
113
  someone with more than one company, and then the plate and the chevron are
106
114
  one button that opens the company menu: a menu of the companies, the acting
107
115
  one checked, with arrow keys, and focus back on the button when it closes.
@@ -127,7 +135,13 @@ why).
127
135
  - Admin appears when `my_admin_scope()` says the person manages something; pass
128
136
  `admin` to decide it yourself.
129
137
  - The Hub passes `hubItems`, its own rows. In any other app the rail's Hub, Back
130
- to hub and Admin go to the Hub.
138
+ to hub and Admin go to the Hub. In the Hub, the rail's Hub is its menu's
139
+ control: pressed after browsing another function's menu, it reopens the Hub
140
+ menu on the page the person is on (a thread, a tool, the Overview), with no
141
+ navigation. From another place (Admin, an app's Settings) it lands on the
142
+ Hub's landing, as Back to hub does from anywhere. `targetFor` tells the two
143
+ apart by the design system's `back` flag (6.3.4): the hub function with no
144
+ row is the rail's Hub, and with `back: true` it is Back to hub.
131
145
 
132
146
  ### Off the core
133
147
 
@@ -157,6 +171,7 @@ const here = pathname + search;
157
171
  footerItems={frame.footerItems}
158
172
  location={{ ...frame.locate(here), href: here }}
159
173
  onNavigate={(state) => {
174
+ // The state whole: `reselect` and `back` (Back to hub) change where it goes.
160
175
  const target = frame.targetFor(state, here);
161
176
  if (!target) return false; // goes nowhere: the frame stays where `here` is
162
177
  if (target.external) window.location.assign(target.href);
package/dist/frame.d.ts CHANGED
@@ -4,7 +4,8 @@
4
4
  * Every app on the core renders this around its pages. It draws the same rail,
5
5
  * the same 53-tool menu and the same footer in every app, marks this app's own
6
6
  * tools live, links the others through the catalogue, and puts the acting
7
- * company's mark on the top bar's plate, which opens the company menu.
7
+ * company's mark on the top bar's plate (its name, when it has no artwork or
8
+ * the artwork fails to load), which opens the company menu.
8
9
  *
9
10
  * It knows nothing about routers. Hand it the current location (pathname plus
10
11
  * query) and an `onNavigate(href)` that pushes an in-app path. Rows for other
package/dist/frame.js CHANGED
@@ -5,7 +5,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
5
5
  * Every app on the core renders this around its pages. It draws the same rail,
6
6
  * the same 53-tool menu and the same footer in every app, marks this app's own
7
7
  * tools live, links the others through the catalogue, and puts the acting
8
- * company's mark on the top bar's plate, which opens the company menu.
8
+ * company's mark on the top bar's plate (its name, when it has no artwork or
9
+ * the artwork fails to load), which opens the company menu.
9
10
  *
10
11
  * It knows nothing about routers. Hand it the current location (pathname plus
11
12
  * query) and an `onNavigate(href)` that pushes an in-app path. Rows for other
@@ -21,6 +22,15 @@ import { useCompanySwitch } from "./chrome.js";
21
22
  import { markFor, refreshOsContext } from "./context.js";
22
23
  import { myAdminScope } from "./identity.js";
23
24
  import { catalogueLinks, osFrame } from "./nav.js";
25
+ /* A company's mark in the company menu; nothing, never a broken image, when
26
+ its artwork does not load (the row already says the company's name). */
27
+ function CompanyMenuMark({ src }) {
28
+ const [failed, setFailed] = useState(null);
29
+ if (failed === src)
30
+ return null;
31
+ return _jsx("img", { className: "as-ws__company-mark", src: src, alt: "", onError: () => { if (failed !== src)
32
+ setFailed(src); } });
33
+ }
24
34
  export function OsWorkspaceFrame({ os, auth, appKey, tools, hubItems, location, onNavigate, search, actions, companySwitch = "os", panelFooter, onSignOut, settingsPath, homePath, admin, favicon = true, initialOpen, className, children, ...rest }) {
25
35
  /* Only data-* and aria-* reach the frame's root. */
26
36
  const attributes = Object.fromEntries(Object.entries(rest).filter(([key]) => /^(data|aria)-/.test(key)));
@@ -102,10 +112,12 @@ export function OsWorkspaceFrame({ os, auth, appKey, tools, hubItems, location,
102
112
  active: tenant.id === current.id,
103
113
  checked: tenant.id === current.id,
104
114
  disabled: busy,
105
- prefix: _jsx("img", { className: "as-ws__company-mark", src: markFor(tenant, "plain"), alt: "" }),
115
+ prefix: _jsx(CompanyMenuMark, { src: markFor(tenant, "plain") }),
106
116
  onAction: () => pick(tenant),
107
117
  })),
108
118
  }] }), busy && _jsx("div", { className: "as-ws__company-note", role: "status", children: "Switching\u2026" }), error && _jsx("div", { className: "as-ws__company-note as-ws__company-note--error", role: "alert", children: error })] })) : undefined;
109
- const topBar = (_jsx(TopBar, { variant: "workspace", searchPlaceholder: search?.placeholder ?? "Search", searchValue: search?.value, onSearchChange: search?.onChange, actions: actions, company: current?.slug ?? null, companySrc: current ? markFor(current, "plain") : undefined, companyName: current?.name, onSwitchCompany: switchable ? () => setMenuOpen((open) => !open) : undefined, companyMenu: companyMenu, companyMenuOpen: menuOpen, onCompanyMenuClose: () => setMenuOpen(false) }));
119
+ const topBar = (_jsx(TopBar, { variant: "workspace", searchPlaceholder: search?.placeholder ?? "Search", searchValue: search?.value, onSearchChange: search?.onChange, actions: actions, company: current?.slug ?? null, companySrc: current ? markFor(current, "plain") : undefined,
120
+ /* Also what the plate shows when the company has no artwork, or it fails to load. */
121
+ companyName: current?.name, onSwitchCompany: switchable ? () => setMenuOpen((open) => !open) : undefined, companyMenu: companyMenu, companyMenuOpen: menuOpen, onCompanyMenuClose: () => setMenuOpen(false) }));
110
122
  return (_jsx(WorkspaceFrame, { className: className, topBar: topBar, functions: frame.functions, sections: frame.sections, footerItems: frame.footerItems, homeFunction: frame.homeFunction, location: { ...frame.locate(location), href: location }, onNavigate: navigate, onSignOut: signOut, favicon: favicon, panelFooter: panelFooter, ...(initialOpen === undefined ? {} : { initialOpen }), ...attributes, children: children }));
111
123
  }
package/dist/nav.d.ts CHANGED
@@ -187,7 +187,8 @@ export type OsTarget = {
187
187
  };
188
188
  /**
189
189
  * The part of WorkspaceFrame's state a destination depends on. `reselect` is
190
- * WorkspaceFrame's flag for a click on what it already shows.
190
+ * WorkspaceFrame's flag for a click on what it already shows, `back` its flag
191
+ * for Back to hub (design system 6.3.4).
191
192
  */
192
193
  export type OsFrameState = {
193
194
  fn: {
@@ -200,6 +201,7 @@ export type OsFrameState = {
200
201
  id: string;
201
202
  } | null;
202
203
  reselect?: boolean | undefined;
204
+ back?: boolean | undefined;
203
205
  };
204
206
  export type OsFrameOptions = {
205
207
  /** This app's catalogue key; "hub" for the Hub itself. */
@@ -230,7 +232,10 @@ export type OsFrame = {
230
232
  locate: (location: string) => OsLocation;
231
233
  /**
232
234
  * Where a click from `location` goes; null when it goes nowhere (opening a
233
- * menu, a locked row, or already there). A reselect (`state.reselect`, a
235
+ * menu, the rail's Hub inside the Hub, a locked row, or already there).
236
+ * In the Hub the hub function with no row is the rail's Hub; Back to hub
237
+ * is that state with `back: true`, so a caller that means it passes the
238
+ * flag. A reselect (`state.reselect`, a
234
239
  * click on the tab or row the frame already shows) goes to that tab's or
235
240
  * row's own path unless `location` is exactly it, so a page filed under a
236
241
  * tab (a draft under Requests) goes back to the tab's page.
package/dist/nav.js CHANGED
@@ -395,6 +395,12 @@ export function osFrame(options) {
395
395
  return null; // opening a function's menu is not a navigation
396
396
  if (!isHub)
397
397
  return toHub(HUB_PATHS.home);
398
+ /* The rail's Hub where the person is already in the Hub (a thread, a
399
+ tool, the landing) reopens its menu on that page: it is the menu's
400
+ control, never a navigation. Back to hub, and the rail's Hub from
401
+ another place (Admin, an app's Settings), land on the landing. */
402
+ if (!state.back && here.fn === fn && (sections[fn]?.length ?? 0) > 0)
403
+ return null;
398
404
  /* The Hub: stay anywhere on the landing's own ground, else land on it. */
399
405
  const landing = locate(homePath);
400
406
  return here.fn === landing.fn && here.item === landing.item ? null : { href: homePath, external: false };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosolutions-os",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "One sign-in, one company switcher, one app grid. What every AutoSolutions app imports instead of copying.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@supabase/supabase-js": ">=2.40.0",
24
- "autosolutions-design-system": ">=6.3.3 <7",
24
+ "autosolutions-design-system": ">=6.3.4 <7",
25
25
  "react": ">=18"
26
26
  },
27
27
  "peerDependenciesMeta": {