autosolutions-os 0.3.10 → 0.3.11

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,43 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.11 - 2026-11-04
4
+
5
+ The owner's three marks, so people can tell which tabs to trust: " (*)" for
6
+ sample data, " (Incomplete)" for real data with parts still missing, and no
7
+ mark for real, complete data.
8
+
9
+ ### autosolutions-os/nav
10
+
11
+ - `OsDataStatus` (`"mock" | "incomplete" | "working"`) and `osDataStatus(toolId,
12
+ where, tabId?)`: the status of a tool's page, or of one of its views. By
13
+ default an app's page (`where: "app"`) is `working` and a page in the Hub
14
+ (`where: "hub"`) is `mock`; a tool with an app is always `mock` in the Hub,
15
+ where its page shows no data of its own.
16
+ - `OS_TOOL_DATA`: the one record of the tools whose status is not their
17
+ default, each with what is missing (`missing`) and any view whose status
18
+ differs (`tabs`). Today it has one: Retailer sell out (POS) is
19
+ `incomplete`, since Ops Hub's POS dashboard reads retailers' sales only
20
+ (no retailer stock or ranging data, so Retailer stock cover and Ranging are
21
+ not built).
22
+ - osFrame marks every row that opens a page from it, after the name: a
23
+ `mock` row keeps " (*)" and now has a tooltip (`title`) that says what it
24
+ means; an `incomplete` row gets " (Incomplete)" (`OS_INCOMPLETE_MARK`,
25
+ `osIncompleteLabel()`) and a tooltip that says what is missing; a `working`
26
+ row is as before. A word in the label, not a row badge: in the menu's width
27
+ a badge squeezed "Retailer sell out (POS)" onto four lines. The same in the
28
+ Hub, in an app on the core and in an app off it, for this app's own tools
29
+ too. A locked row and the Hub panel have no mark.
30
+ - `osMarkedLabel(label, status)`: a label with its status's mark, for an
31
+ app's own tabs (the Hub's pages). `OS_MARK_HINTS`: the words for each mark,
32
+ for the tooltips and an app's legend.
33
+ - The menu search matches a row by its name without either mark, as it did
34
+ without " (*)".
35
+ - Unchanged: every id, link, lock, tab and route; `OS_SAMPLE_MARK` and
36
+ `osSampleLabel()`; which rows are samples.
37
+ - Apps take this release with a lockfile bump. An app whose tests compare a
38
+ sample row whole (`toEqual`) adds its new `title`; one that names Retailer
39
+ sell out (POS)'s row by its label sees " (Incomplete)" after it.
40
+
3
41
  ## 0.3.10 - 2026-10-21
4
42
 
5
43
  The owner removed two menu rows that are not on their sheet.
package/README.md CHANGED
@@ -245,6 +245,17 @@ why).
245
245
  after its name, in every app (0.3.2, `OS_SAMPLE_MARK`): the owner's mark
246
246
  for work in progress. A row that opens an app has none, so a tool loses it
247
247
  the day it gets one.
248
+ - Every row that opens a page carries the mark of that page's data (0.3.11,
249
+ `osDataStatus()`), so people can tell which numbers to trust: " (*)" after
250
+ the name for sample data (`mock`), " (Incomplete)" in its place for real
251
+ data with parts still missing (`incomplete`, `OS_INCOMPLETE_MARK`), and no
252
+ mark for real, complete data (`working`). The row's tooltip says what its
253
+ mark means (`OS_MARK_HINTS`), and for an incomplete one what is missing. By
254
+ default an app's page is `working` and a page in the Hub `mock`;
255
+ `OS_TOOL_DATA` is the one record of the tools (and views) whose status is
256
+ not their default (today: Retailer sell out (POS), whose dashboard reads
257
+ retailers' sales only). A locked row and the Hub panel have no mark. The Hub
258
+ marks its pages' tabs from the same record (`osMarkedLabel()`).
248
259
  - Operations' Overview is Ops Hub's home dashboard (0.3.3): it opens Ops Hub
249
260
  for someone who holds it, and is locked for someone who does not, like
250
261
  Ops Hub's tools. In the Hub a locked row's page files under its function,
@@ -292,7 +303,9 @@ const grouped = [...groups, { title: "Setup", items: [osSettingsTab("/b2b-frank/
292
303
  Supabase: the rail (`OS_FUNCTIONS`), the menu map (`OS_MENU`), the Hub panel
293
304
  (`OS_HUB_MENU`), `OS_TOOL_LINKS`, `OS_TOOL_ALIASES` and `osToolId()`,
294
305
  `osHubPath()`, `HUB_URL`, `HUB_PATHS`, `HINTS`, `osFooter()`, `staticLinks()`,
295
- `osSettingsTab()`, `OS_SAMPLE_MARK` and `osSampleLabel()`, `osMenuEntries()`
306
+ `osSettingsTab()`, `OS_SAMPLE_MARK` and `osSampleLabel()`, the data marks
307
+ (`OS_TOOL_DATA`, `osDataStatus()`, `OS_INCOMPLETE_MARK`, `osIncompleteLabel()`,
308
+ `osMarkedLabel()`, `OS_MARK_HINTS`), `osMenuEntries()`
296
309
  and `searchOsMenu()` (the menu search's data and matching), and `osFrame()`,
297
310
  the routing rules the frame runs on. An app on its own
298
311
  project (Ops Hub: see "Linked, not federated" in `docs/CONTRACT.md`) pairs it
package/dist/nav.d.ts CHANGED
@@ -218,10 +218,60 @@ export declare const HINTS: {
218
218
  * an app. A row that opens an app, this app's own tools, a locked row and
219
219
  * the Hub panel (the Hub's real pages) have none. The Hub's sample pages put
220
220
  * it on their tabs too (`osSampleLabel`), since all their data is mock.
221
+ * Since 0.3.11 the mark follows the row's data status (`osDataStatus`): it
222
+ * is the mark of `mock`, and a marked row's tooltip says what it means.
221
223
  */
222
224
  export declare const OS_SAMPLE_MARK = " (*)";
223
225
  /** `label` with the sample mark after it, once. */
224
226
  export declare function osSampleLabel(label: string): string;
227
+ /**
228
+ * What a row's page shows (0.3.11), so people can tell which numbers to
229
+ * trust: `mock`, sample numbers (" (*)" after the name, `OS_SAMPLE_MARK`);
230
+ * `incomplete`, real data with parts still missing (" (Incomplete)" in the
231
+ * asterisk's place, `OS_INCOMPLETE_MARK`); `working`, real and complete data
232
+ * (no mark).
233
+ */
234
+ export type OsDataStatus = "mock" | "incomplete" | "working";
235
+ /** A tool whose data status is not its default (0.3.11). */
236
+ export type OsToolData = {
237
+ /** Its page's status: its app's page when the tool has an app, else its page in the Hub. */
238
+ data: OsDataStatus;
239
+ /** For `incomplete`: what is still missing, in plain words. The row's tooltip says it. */
240
+ missing?: string;
241
+ /** A view (tab, by id) whose status is not the tool's. */
242
+ tabs?: Readonly<Record<string, OsDataStatus>>;
243
+ };
244
+ /**
245
+ * The one record of data statuses (0.3.11, the owner's three marks of
246
+ * 4 November 2026). By default a tool with an app shows that app's real data
247
+ * (`working`), and every other tool's page in the Hub is one of the design's
248
+ * sample dashboards (`mock`). A tool is listed only where its default is
249
+ * wrong, and when its data changes, this is the one place to change:
250
+ * osFrame marks every app's menu from it, and the Hub marks its pages and
251
+ * their tabs from it (`osDataStatus`).
252
+ */
253
+ export declare const OS_TOOL_DATA: Readonly<Record<string, OsToolData>>;
254
+ /**
255
+ * The mark after the name of a row, or a tab, whose real data is not complete
256
+ * yet (0.3.11): the asterisk's place, in words. A word in the row's label
257
+ * rather than a badge at its end, which in the menu's width would squeeze a
258
+ * long name onto four lines.
259
+ */
260
+ export declare const OS_INCOMPLETE_MARK = " (Incomplete)";
261
+ /** `label` with the incomplete mark after it, once (0.3.11). */
262
+ export declare function osIncompleteLabel(label: string): string;
263
+ /** `label` with the mark its data status calls for (0.3.11): " (*)", " (Incomplete)", or none. */
264
+ export declare function osMarkedLabel(label: string, status: OsDataStatus): string;
265
+ /** What each mark means (0.3.11): a marked row's tooltip, and the words of an app's legend. */
266
+ export declare const OS_MARK_HINTS: Readonly<Record<OsDataStatus, string>>;
267
+ /**
268
+ * The data status of a tool's page, or of one of its views (0.3.11), from
269
+ * `OS_TOOL_DATA`. `where` is the page the person is shown: "app", the tool's
270
+ * app (or this app's own page for it); "hub", its page in the Hub. A tool
271
+ * with an app shows no data of its own in the Hub (its page there only sends
272
+ * people to the app, or says why it cannot), so its Hub page is `mock`.
273
+ */
274
+ export declare function osDataStatus(toolId: string, where: "app" | "hub", tabId?: string): OsDataStatus;
225
275
  /** The Settings tab's id, label and glyph (the rail's own settings glyph), 0.3.2. */
226
276
  export declare const OS_SETTINGS_TAB: Readonly<OsNavItem>;
227
277
  /**
package/dist/nav.js CHANGED
@@ -313,12 +313,89 @@ export const HINTS = {
313
313
  * an app. A row that opens an app, this app's own tools, a locked row and
314
314
  * the Hub panel (the Hub's real pages) have none. The Hub's sample pages put
315
315
  * it on their tabs too (`osSampleLabel`), since all their data is mock.
316
+ * Since 0.3.11 the mark follows the row's data status (`osDataStatus`): it
317
+ * is the mark of `mock`, and a marked row's tooltip says what it means.
316
318
  */
317
319
  export const OS_SAMPLE_MARK = " (*)";
318
320
  /** `label` with the sample mark after it, once. */
319
321
  export function osSampleLabel(label) {
320
322
  return label.endsWith(OS_SAMPLE_MARK) ? label : `${label}${OS_SAMPLE_MARK}`;
321
323
  }
324
+ /**
325
+ * The one record of data statuses (0.3.11, the owner's three marks of
326
+ * 4 November 2026). By default a tool with an app shows that app's real data
327
+ * (`working`), and every other tool's page in the Hub is one of the design's
328
+ * sample dashboards (`mock`). A tool is listed only where its default is
329
+ * wrong, and when its data changes, this is the one place to change:
330
+ * osFrame marks every app's menu from it, and the Hub marks its pages and
331
+ * their tabs from it (`osDataStatus`).
332
+ */
333
+ export const OS_TOOL_DATA = {
334
+ /* Ops Hub's POS dashboard (0.3.6) reads retailers' sales only: Ops Hub's
335
+ menu shows its other two views locked, not built. */
336
+ "retailer-sell-out": {
337
+ data: "incomplete",
338
+ missing: "Sell in vs sell out only. Retailer stock and ranging data are not in yet, so Retailer stock cover and Ranging are not built.",
339
+ },
340
+ };
341
+ /**
342
+ * The mark after the name of a row, or a tab, whose real data is not complete
343
+ * yet (0.3.11): the asterisk's place, in words. A word in the row's label
344
+ * rather than a badge at its end, which in the menu's width would squeeze a
345
+ * long name onto four lines.
346
+ */
347
+ export const OS_INCOMPLETE_MARK = " (Incomplete)";
348
+ /** `label` with the incomplete mark after it, once (0.3.11). */
349
+ export function osIncompleteLabel(label) {
350
+ return label.endsWith(OS_INCOMPLETE_MARK) ? label : `${label}${OS_INCOMPLETE_MARK}`;
351
+ }
352
+ /** `label` with the mark its data status calls for (0.3.11): " (*)", " (Incomplete)", or none. */
353
+ export function osMarkedLabel(label, status) {
354
+ if (status === "mock")
355
+ return osSampleLabel(label);
356
+ return status === "incomplete" ? osIncompleteLabel(label) : label;
357
+ }
358
+ /** What each mark means (0.3.11): a marked row's tooltip, and the words of an app's legend. */
359
+ export const OS_MARK_HINTS = {
360
+ mock: "(*) Sample data: not real numbers yet.",
361
+ incomplete: "(Incomplete) Real data, but some parts are still missing.",
362
+ working: "No mark: real data.",
363
+ };
364
+ const hasOwn = (object, key) => Object.prototype.hasOwnProperty.call(object, key);
365
+ /** Whether the tool has an app to open (an `OS_TOOL_LINKS` entry with an app or an address). */
366
+ function hasApp(id) {
367
+ const link = hasOwn(OS_TOOL_LINKS, id) ? OS_TOOL_LINKS[id] : undefined;
368
+ return Boolean(link?.app || link?.url);
369
+ }
370
+ /**
371
+ * The data status of a tool's page, or of one of its views (0.3.11), from
372
+ * `OS_TOOL_DATA`. `where` is the page the person is shown: "app", the tool's
373
+ * app (or this app's own page for it); "hub", its page in the Hub. A tool
374
+ * with an app shows no data of its own in the Hub (its page there only sends
375
+ * people to the app, or says why it cannot), so its Hub page is `mock`.
376
+ */
377
+ export function osDataStatus(toolId, where, tabId) {
378
+ const id = osToolId(toolId);
379
+ if (where === "hub" && hasApp(id))
380
+ return "mock";
381
+ const note = hasOwn(OS_TOOL_DATA, id) ? OS_TOOL_DATA[id] : undefined;
382
+ const status = note?.data ?? (where === "app" ? "working" : "mock");
383
+ const tabs = note?.tabs;
384
+ return tabId !== undefined && tabs && hasOwn(tabs, tabId) ? tabs[tabId] : status;
385
+ }
386
+ /* A row with the mark its page's data status calls for (0.3.11), after its
387
+ name, and a tooltip that says what the mark means: for an incomplete row
388
+ also what is missing. A working row is as it was. */
389
+ function marked(row, id, status) {
390
+ if (status === "working")
391
+ return row;
392
+ const missing = status === "incomplete" && hasOwn(OS_TOOL_DATA, id) ? OS_TOOL_DATA[id].missing : undefined;
393
+ return {
394
+ ...row,
395
+ label: osMarkedLabel(row.label, status),
396
+ title: missing ? `${OS_MARK_HINTS[status]} ${missing}` : OS_MARK_HINTS[status],
397
+ };
398
+ }
322
399
  /** The Settings tab's id, label and glyph (the rail's own settings glyph), 0.3.2. */
323
400
  export const OS_SETTINGS_TAB = { id: "settings", label: "Settings", icon: "settings" };
324
401
  /**
@@ -519,9 +596,12 @@ export function osFrame(options) {
519
596
  ...(group.title ? { title: group.title } : {}),
520
597
  items: group.items.map((entry) => {
521
598
  const base = { id: entry.id, label: entry.label, icon: entry.icon };
599
+ /* Every row that opens a page carries the mark of that page's data
600
+ (0.3.11): this app's own page or the tool's app, or its page in
601
+ the Hub. A locked row opens nothing, and carries none. */
522
602
  const mine = own.get(entry.id);
523
603
  if (mine)
524
- return rowFor(base, mine);
604
+ return marked(rowFor(base, mine), entry.id, osDataStatus(entry.id, "app"));
525
605
  /* Its page in the Hub, which in the Hub also places a location there
526
606
  on this row when the row itself opens an app. */
527
607
  const page = osHubPath(fn, entry.overview ? null : entry.id);
@@ -529,7 +609,7 @@ export function osFrame(options) {
529
609
  knows what this person holds. */
530
610
  const href = links[entry.id];
531
611
  if (href)
532
- return { ...base, ...(isHub ? { match: [page] } : {}), href };
612
+ return marked({ ...base, ...(isHub ? { match: [page] } : {}), href }, entry.id, osDataStatus(entry.id, "app"));
533
613
  const reason = locked[entry.id];
534
614
  if (reason) {
535
615
  if (isHub)
@@ -538,8 +618,9 @@ export function osFrame(options) {
538
618
  }
539
619
  /* No app of its own (or one this frame cannot reach: off the core
540
620
  with no fixed address, or held and not deployed yet): its page in
541
- the Hub, a sample, marked so (0.3.2). */
542
- return inHub({ ...base, label: osSampleLabel(base.label) }, page);
621
+ the Hub, a sample unless OS_TOOL_DATA says otherwise, marked so
622
+ (0.3.2, from its data status since 0.3.11). */
623
+ return marked(inHub(base, page), entry.id, osDataStatus(entry.id, "hub"));
543
624
  }),
544
625
  }));
545
626
  }
@@ -734,8 +815,9 @@ export function searchOsMenu(entries, query, limit = 8) {
734
815
  const typed = words.join(" ");
735
816
  const ranked = [];
736
817
  entries.forEach((entry, at) => {
737
- /* The sample mark is no part of the name. */
738
- const label = fold(entry.label.endsWith(OS_SAMPLE_MARK) ? entry.label.slice(0, -OS_SAMPLE_MARK.length) : entry.label);
818
+ /* A data mark, the sample mark or (0.3.11) the incomplete one, is no part of the name. */
819
+ const mark = [OS_SAMPLE_MARK, OS_INCOMPLETE_MARK].find((m) => entry.label.endsWith(m));
820
+ const label = fold(mark ? entry.label.slice(0, -mark.length) : entry.label);
739
821
  const all = `${label} ${fold(entry.context)}`;
740
822
  if (!words.every((word) => all.includes(word)))
741
823
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosolutions-os",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
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",