autosolutions-os 0.4.3 → 0.4.5

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,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.5 - 2026-11-06
4
+
5
+ There are no company admins any more, only AutoSolutions OS admins (Didac,
6
+ 6 November 2026), so the package no longer sends people to one.
7
+
8
+ - The grey hint on a locked menu row now reads "Ask an AutoSolutions OS admin to
9
+ switch this on for you" (`HINTS.locked`). It said "Ask your company admin".
10
+ - `OsAuthGate` and the app list name an AutoSolutions OS admin too, in the words
11
+ the Hub uses since its one-page Admin. The gate's "This company does not have
12
+ this app" now reads "This app is not switched on for you in this company", as
13
+ access is given person by person.
14
+
15
+ ## 0.4.4 - 2026-11-06
16
+
17
+ The Feedback button on every page (Didac, 6 November 2026: "I want the new
18
+ feedback button EVERYWHERE").
19
+
20
+ - New `autosolutions-os/feedback-everywhere`: `startOsFeedback({ appKey, token })`,
21
+ called once when an app starts. On a page with no Feedback button of its own
22
+ (a 404, an error page, a "no access" screen), a signed-in person gets the same
23
+ pink button floating at the top right, after about three seconds. It stays up
24
+ when the app's own tree has failed. People who are not signed in do not see it,
25
+ as the form cannot send for them.
26
+ - The button draws correctly outside the frame too, so `OsFeedbackButton` can go
27
+ in any TopBar's `actions`.
28
+ - The path now keeps which view a page is on (`view`, `screen`, `mode`, `tab`,
29
+ `section`), so the Slack DM and Admin list say `/?view=labels`, not `/`.
30
+ - The address a message keeps has no sign-in code or token in it.
31
+
3
32
  ## 0.4.3 - 2026-11-06
4
33
 
5
34
  The company switcher works in Ops Hub and Asset Portal with no Hub tab open
package/README.md CHANGED
@@ -138,8 +138,8 @@ of its own passes it: `search={{ placeholder: "Search", value: query, onChange:
138
138
  Since 0.3.13 the frame greys every row the person may not open: the core's
139
139
  `os_context()` returns `items`, the items of the menu they hold in the acting
140
140
  company (the Hub's permissions: View for a dashboard, Member or Admin for a
141
- tool), and every row it does not name is locked with "Ask your company admin
142
- to switch this on for you", even when its app is held (Ops Hub serves fourteen
141
+ tool), and every row it does not name is locked with "Ask an AutoSolutions OS
142
+ admin to switch this on for you", even when its app is held (Ops Hub serves fourteen
143
143
  rows since 0.3.14). Until the core answers, and with a core without `items`,
144
144
  nothing new is locked (the pages and the server check again). `itemLocks(items)` and
145
145
  `withItemLocks(catalogueLinks(...), items)` (`autosolutions-os/nav`) do the
@@ -194,7 +194,7 @@ why).
194
194
  - held, with an address: the tool goes there (plus its `path`) with
195
195
  `?tenant=`;
196
196
  - held, not deployed yet: its page in the Hub (below);
197
- - not held: locked ("Ask your company admin to switch this on for you"),
197
+ - not held: locked ("Ask an AutoSolutions OS admin to switch this on for you"),
198
198
  the one way a row is locked.
199
199
  Every tool with no app of its own, and every Overview, opens its page in the
200
200
  Hub (0.3.0): `/os/<function>` for an Overview, `/os/<function>/<tool>` for a
@@ -492,6 +492,26 @@ layout, and Escape closes it. Closing it keeps the draft until it is sent.
492
492
  `autosolutions-os/feedback` also exports the form's logic (`sendFeedback`,
493
493
  `feedbackContext`, `readPicture`) for tests.
494
494
 
495
+ A page with no top bar gets the button too (0.4.4). Each app starts the watch
496
+ once, in its router or its entry file:
497
+
498
+ ```ts
499
+ import { startOsFeedback } from "autosolutions-os/feedback-everywhere";
500
+
501
+ startOsFeedback({
502
+ appKey: "key_accounts",
503
+ token: async () => (await supabase.auth.getSession()).data.session?.access_token,
504
+ });
505
+ ```
506
+
507
+ It does nothing on the server. In the browser it looks at the page every 1.5
508
+ seconds. On a page with no Feedback button of its own (a 404, an error page, a
509
+ "no access" screen), a signed-in person gets the pink button floating at the top
510
+ right. It leaves as soon as a page has its own, and it has its own React root,
511
+ so it stays up when the app's tree has failed. The file is small and loads the
512
+ form only when a page needs it. A page with its own bar that is not the frame
513
+ puts `OsFeedbackButton` from `autosolutions-os/feedback` in the bar's `actions`.
514
+
495
515
  ## On the server
496
516
 
497
517
  The package is plain ES modules, so Node, a test runner and a dev server's SSR
package/dist/chrome.js CHANGED
@@ -55,7 +55,7 @@ export function OsAppSwitcher({ os, appKey, variant = "menu", onOpen }) {
55
55
  const tenantSlug = context.tenant?.slug ?? null;
56
56
  const columns = groupApps(context.apps);
57
57
  if (columns.length === 0) {
58
- return (_jsx("p", { className: "os-empty", children: "You are not entitled to any apps in this workspace. Ask your AutoSolutions administrator." }));
58
+ return (_jsx("p", { className: "os-empty", children: "You are not entitled to any apps in this workspace. Ask an AutoSolutions OS admin." }));
59
59
  }
60
60
  return (_jsxs("div", { className: "os-cols" + (variant === "menu" ? " os-cols--menu" : ""), children: [columns.map((column) => (_jsxs("div", { children: [_jsx("div", { className: "os-grp", children: column.group }), column.sections.map((section, index) => (_jsxs("div", { children: [section.title ? _jsx("div", { className: "os-sec", children: section.title }) : null, section.apps.map((app) => (_jsx(AppPlate, { app: app, tenantSlug: tenantSlug, current: app.key === appKey, onOpen: onOpen }, app.key)))] }, section.title ?? `section-${index}`)))] }, column.group))), _jsxs("div", { children: [_jsx("div", { className: "os-grp", children: "\u00A0" }), _jsx(AppPlate, { app: {
61
61
  key: "hub", name: "Hub", iconUrl: null, url: HUB_URL, sortOrder: 0,
@@ -2,4 +2,7 @@ import { type OsFeedbackProps } from "./feedbackSend.js";
2
2
  export { OS_FEEDBACK_ASK_CSS } from "./feedbackAsk.js";
3
3
  export { OS_FEEDBACK_LIMITS, OS_FEEDBACK_TYPES, feedbackContext, feedbackEndpoint, pastedPictures, readPicture, sendFeedback, type OsFeedbackPicture, type OsFeedbackProps, type OsFeedbackResult, type OsFeedbackTenant, type OsFeedbackType, type OsPastedData, } from "./feedbackSend.js";
4
4
  /** The bar's Feedback button and its form. */
5
- export declare function OsFeedbackButton({ appKey, token, tenant, endpoint }: OsFeedbackProps): import("react").JSX.Element;
5
+ export declare function OsFeedbackButton({ appKey, token, tenant, endpoint, float }: OsFeedbackProps & {
6
+ /** On a page with no top bar (0.4.4, feedbackEverywhere.ts): it floats at the top right. */
7
+ float?: boolean;
8
+ }): import("react").JSX.Element;
package/dist/feedback.js CHANGED
@@ -69,7 +69,7 @@ ${D} .osfb-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overf
69
69
  `;
70
70
  const EMPTY = { type: "bug", message: "", pictures: [] };
71
71
  /** The bar's Feedback button and its form. */
72
- export function OsFeedbackButton({ appKey, token, tenant, endpoint }) {
72
+ export function OsFeedbackButton({ appKey, token, tenant, endpoint, float = false }) {
73
73
  const [open, setOpen] = useState(false);
74
74
  /* Kept here, not in the dialog, so closing the form keeps what was typed. */
75
75
  const [draft, setDraft] = useState(EMPTY);
@@ -78,7 +78,7 @@ export function OsFeedbackButton({ appKey, token, tenant, endpoint }) {
78
78
  if (readSeen())
79
79
  setSeen(true);
80
80
  }, []);
81
- return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: seen ? "as-topbar__target osfb-ask is-seen" : "as-topbar__target osfb-ask", "aria-label": "Send feedback", title: "Send feedback", "aria-haspopup": "dialog", "data-os-feedback": "button", onClick: () => {
81
+ return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: `${float ? "osfb-ask--float" : "as-topbar__target"} osfb-ask${seen ? " is-seen" : ""}`, "aria-label": "Send feedback", title: "Send feedback", "aria-haspopup": "dialog", "data-os-feedback": "button", onClick: () => {
82
82
  setOpen(true);
83
83
  if (!seen) {
84
84
  setSeen(true);
@@ -1,4 +1,4 @@
1
- export declare const OS_FEEDBACK_ASK_CSS = "\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{width:auto;height:2.25rem;gap:.375rem;margin-inline-end:1rem;padding:0 .875rem 0 .6875rem;border:0;border-radius:999px;background:linear-gradient(110deg,#D1007C 0%,#6E3192 50%,#D1007C 100%);background-size:200% 100%;background-position:0% 50%;color:#FFFFFF;font:inherit;font-size:.8125rem;font-weight:600;line-height:1;white-space:nowrap;animation:osfb-ask-drift 6s ease-in-out 1s 10 alternate}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask:hover{filter:brightness(1.1)}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask:active{filter:brightness(.95)}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.is-seen{animation:none}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:block;flex:0 0 auto}\n@keyframes osfb-ask-drift{from{background-position:0% 50%}to{background-position:100% 50%}}\n@media (max-width:767px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{margin-inline-end:.5rem;gap:.3125rem;padding:0 .6875rem 0 .5rem}}\n@media (max-width:409px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{padding:0 .75rem}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:none}}\n@media (max-width:379px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{width:2.25rem;padding:0}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:block}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__word{display:none}}\n@media (max-width:359px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{margin-inline-end:.25rem}}\n@media (prefers-reduced-motion:reduce){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{animation:none}}\n@media (forced-colors:active){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{border:1px solid ButtonText;background:ButtonFace;color:ButtonText;forced-color-adjust:none}}\n";
1
+ export declare const OS_FEEDBACK_ASK_CSS = "\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{width:auto;height:2.25rem;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;cursor:pointer;gap:.375rem;margin-inline-end:1rem;padding:0 .875rem 0 .6875rem;border:0;border-radius:999px;background:linear-gradient(110deg,#D1007C 0%,#6E3192 50%,#D1007C 100%);background-size:200% 100%;background-position:0% 50%;color:#FFFFFF;font:inherit;font-size:.8125rem;font-weight:600;line-height:1;white-space:nowrap;animation:osfb-ask-drift 6s ease-in-out 1s 10 alternate}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask:hover{filter:brightness(1.1)}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask:active{filter:brightness(.95)}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.is-seen{animation:none}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask--float{position:fixed;top:.75rem;inset-inline-end:1rem;z-index:2147483000;margin:0;padding:0 .875rem 0 .6875rem;width:auto;box-shadow:0 .25rem .75rem rgba(0,0,0,.25)}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask--float .osfb-ask__icon{display:block}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask--float .osfb-ask__word{display:inline}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:block;flex:0 0 auto}\n@keyframes osfb-ask-drift{from{background-position:0% 50%}to{background-position:100% 50%}}\n@media (max-width:767px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{margin-inline-end:.5rem;gap:.3125rem;padding:0 .6875rem 0 .5rem}}\n@media (max-width:409px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{padding:0 .75rem}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:none}}\n@media (max-width:379px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{width:2.25rem;padding:0}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:block}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__word{display:none}}\n@media (max-width:359px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{margin-inline-end:.25rem}}\n@media (prefers-reduced-motion:reduce){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{animation:none}}\n@media (forced-colors:active){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{border:1px solid ButtonText;background:ButtonFace;color:ButtonText;forced-color-adjust:none}}\n";
2
2
  export declare const OS_FEEDBACK_SEEN_KEY = "autosolutions-os:feedback-seen";
3
3
  export declare function readSeen(): boolean;
4
4
  export declare function keepSeen(): void;
@@ -8,15 +8,20 @@
8
8
  * Phones: the icon and the word from 410px, the word alone from 380px (a
9
9
  * 390px iPhone), the icon alone below (measured on the Hub's bar: the search
10
10
  * gives way, the plate stays whole, the bar keeps its end padding).
11
+ * A page with no top bar gets the same pill floating at its top right, always
12
+ * with the icon and the word (0.4.4, `osfb-ask--float`).
11
13
  * Six classes outrank the frame's `.as-frame.as-ws > ... .as-topbar__target`
12
14
  * (five), which sizes every bar target as a 36px circle.
13
15
  */
14
16
  const A = ".osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask";
15
17
  export const OS_FEEDBACK_ASK_CSS = `
16
- ${A}{width:auto;height:2.25rem;gap:.375rem;margin-inline-end:1rem;padding:0 .875rem 0 .6875rem;border:0;border-radius:999px;background:linear-gradient(110deg,#D1007C 0%,#6E3192 50%,#D1007C 100%);background-size:200% 100%;background-position:0% 50%;color:#FFFFFF;font:inherit;font-size:.8125rem;font-weight:600;line-height:1;white-space:nowrap;animation:osfb-ask-drift 6s ease-in-out 1s 10 alternate}
18
+ ${A}{width:auto;height:2.25rem;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;cursor:pointer;gap:.375rem;margin-inline-end:1rem;padding:0 .875rem 0 .6875rem;border:0;border-radius:999px;background:linear-gradient(110deg,#D1007C 0%,#6E3192 50%,#D1007C 100%);background-size:200% 100%;background-position:0% 50%;color:#FFFFFF;font:inherit;font-size:.8125rem;font-weight:600;line-height:1;white-space:nowrap;animation:osfb-ask-drift 6s ease-in-out 1s 10 alternate}
17
19
  ${A}:hover{filter:brightness(1.1)}
18
20
  ${A}:active{filter:brightness(.95)}
19
21
  ${A}.is-seen{animation:none}
22
+ ${A}.osfb-ask--float{position:fixed;top:.75rem;inset-inline-end:1rem;z-index:2147483000;margin:0;padding:0 .875rem 0 .6875rem;width:auto;box-shadow:0 .25rem .75rem rgba(0,0,0,.25)}
23
+ ${A}.osfb-ask--float .osfb-ask__icon{display:block}
24
+ ${A}.osfb-ask--float .osfb-ask__word{display:inline}
20
25
  ${A} .osfb-ask__icon{display:block;flex:0 0 auto}
21
26
  @keyframes osfb-ask-drift{from{background-position:0% 50%}to{background-position:100% 50%}}
22
27
  @media (max-width:767px){${A}{margin-inline-end:.5rem;gap:.3125rem;padding:0 .6875rem 0 .5rem}}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * autosolutions-os/feedback-everywhere (0.4.4): the Feedback button on every
3
+ * page the top bar does not reach (Didac, 6 November 2026: "I want the new
4
+ * feedback button EVERYWHERE"). A 404, an error page, a "no access" screen
5
+ * and any page an app adds later have no frame, so they have no button. A
6
+ * person who lands there is the person with something to report.
7
+ *
8
+ * Each app calls `startOsFeedback` once when it starts. From then on it looks
9
+ * at the page every 1.5 seconds. When a signed-in person has been on a page
10
+ * with no Feedback button for two looks, the button floats at the top right.
11
+ * It goes away as soon as a page has a button of its own. Someone who is not
12
+ * signed in never sees it: the form cannot send without their token.
13
+ *
14
+ * It has its own React root on document.body, so it stays up when the app's
15
+ * tree has failed, which is when an error page shows. This file is small and
16
+ * loads nothing else until a page needs the button, so it can sit in an app's
17
+ * first bundle.
18
+ */
19
+ import type { OsFeedbackProps } from "./feedbackSend.js";
20
+ export type OsFeedbackEverywhereOptions = Pick<OsFeedbackProps, "appKey" | "token" | "endpoint"> & {
21
+ /** How often it looks at the page, for tests. Default 1,500 ms. */
22
+ checkMs?: number;
23
+ };
24
+ /**
25
+ * Starts the watch on this page and returns what stops it. A second call
26
+ * changes nothing and returns the same stop. On the server it does nothing.
27
+ */
28
+ export declare function startOsFeedback(options: OsFeedbackEverywhereOptions): () => void;
@@ -0,0 +1,98 @@
1
+ const BUTTON = '[data-os-feedback="button"]';
2
+ const LOOKS = 2;
3
+ let stopRunning = null;
4
+ /**
5
+ * Starts the watch on this page and returns what stops it. A second call
6
+ * changes nothing and returns the same stop. On the server it does nothing.
7
+ */
8
+ export function startOsFeedback(options) {
9
+ if (typeof window === "undefined" || typeof document === "undefined")
10
+ return () => { };
11
+ if (stopRunning)
12
+ return stopRunning;
13
+ let host = null;
14
+ let root = null;
15
+ let watcher = null;
16
+ let looks = 0;
17
+ let busy = false;
18
+ let loading = false;
19
+ let stopped = false;
20
+ /* A button that is not ours: the frame's, or one the page drew. */
21
+ const hasOwn = () => Array.from(document.querySelectorAll(BUTTON)).some((node) => !host?.contains(node));
22
+ const hide = () => {
23
+ /* Never under someone's hands: the open form keeps what they typed. */
24
+ if (host?.querySelector("dialog[open]"))
25
+ return;
26
+ watcher?.disconnect();
27
+ watcher = null;
28
+ root?.unmount();
29
+ root = null;
30
+ host?.remove();
31
+ host = null;
32
+ };
33
+ const show = async () => {
34
+ if (host || loading)
35
+ return;
36
+ loading = true;
37
+ try {
38
+ const [{ createElement }, { createRoot }, { OsFeedbackButton }] = await Promise.all([
39
+ import("react"),
40
+ import("react-dom/client"),
41
+ import("./feedback.js"),
42
+ ]);
43
+ if (stopped || hasOwn())
44
+ return;
45
+ host = document.createElement("div");
46
+ host.setAttribute("data-os-feedback", "float");
47
+ document.body.appendChild(host);
48
+ root = createRoot(host);
49
+ const endpoint = options.endpoint ? { endpoint: options.endpoint } : {};
50
+ root.render(createElement(OsFeedbackButton, { appKey: options.appKey, token: options.token, ...endpoint, float: true }));
51
+ /* A frame that arrives takes over at once, not at the next look. */
52
+ watcher = new MutationObserver(() => {
53
+ if (hasOwn())
54
+ hide();
55
+ });
56
+ watcher.observe(document.body, { childList: true, subtree: true });
57
+ }
58
+ catch {
59
+ /* A chunk that will not load: the next look tries again. */
60
+ }
61
+ finally {
62
+ loading = false;
63
+ }
64
+ };
65
+ const look = async () => {
66
+ if (busy || stopped)
67
+ return;
68
+ if (hasOwn()) {
69
+ looks = 0;
70
+ hide();
71
+ return;
72
+ }
73
+ if (!host) {
74
+ looks += 1;
75
+ if (looks < LOOKS)
76
+ return;
77
+ }
78
+ busy = true;
79
+ const token = await Promise.resolve().then(options.token).catch(() => null);
80
+ busy = false;
81
+ if (stopped)
82
+ return;
83
+ if (token)
84
+ await show();
85
+ else
86
+ hide();
87
+ };
88
+ const timer = setInterval(() => void look(), options.checkMs ?? 1500);
89
+ stopRunning = () => {
90
+ stopped = true;
91
+ clearInterval(timer);
92
+ watcher?.disconnect();
93
+ root?.unmount();
94
+ host?.remove();
95
+ stopRunning = null;
96
+ };
97
+ return stopRunning;
98
+ }
@@ -44,6 +44,9 @@ export type OsFeedbackResult = {
44
44
  };
45
45
  /** Where the form sends by default. */
46
46
  export declare function feedbackEndpoint(): string;
47
+ /** The part of a query that names the view, with its ?, or "". */
48
+ export declare function viewQuery(query: string): string;
49
+ export declare function safeAddress(href: string): string;
47
50
  /** What the form sends besides what the person types, read when they press Send. */
48
51
  export declare function feedbackContext(): {
49
52
  page: {
@@ -16,6 +16,46 @@ const PICTURE_TYPES = ["image/png", "image/jpeg", "image/webp"];
16
16
  export function feedbackEndpoint() {
17
17
  return `${coreUrl().replace(/\/+$/, "")}/functions/v1/feedback-submit`;
18
18
  }
19
+ /*
20
+ * The query names that say which view of a page this is (0.4.4). Only these go
21
+ * in the path, which the Slack DM and the Admin list show. A query can also
22
+ * hold a sign-in code or an invitation token, so nothing else does.
23
+ */
24
+ const VIEW_PARAMS = ["view", "screen", "mode", "tab", "section"];
25
+ /** The part of a query that names the view, with its ?, or "". */
26
+ export function viewQuery(query) {
27
+ const from = new URLSearchParams(query);
28
+ const keep = new URLSearchParams();
29
+ for (const name of VIEW_PARAMS) {
30
+ const value = from.get(name);
31
+ if (value)
32
+ keep.set(name, value);
33
+ }
34
+ const out = keep.toString();
35
+ return out ? `?${out}` : "";
36
+ }
37
+ /*
38
+ * The page's address with no sign-in code or token in it (0.4.4). The button
39
+ * now reaches pages like an invitation link, and an address is kept for good.
40
+ */
41
+ const SECRET_PARAM = /(^|[_-])(token|code|otp|secret|password|key)$|^state$/i;
42
+ export function safeAddress(href) {
43
+ let url;
44
+ try {
45
+ url = new URL(href);
46
+ }
47
+ catch {
48
+ return href;
49
+ }
50
+ for (const name of Array.from(url.searchParams.keys())) {
51
+ if (SECRET_PARAM.test(name))
52
+ url.searchParams.delete(name);
53
+ }
54
+ /* A hash that is not a route is a sign-in return (#access_token=...). */
55
+ if (url.hash && !url.hash.startsWith("#/"))
56
+ url.hash = "";
57
+ return url.toString();
58
+ }
19
59
  /** What the form sends besides what the person types, read when they press Send. */
20
60
  export function feedbackContext() {
21
61
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -23,7 +63,8 @@ export function feedbackContext() {
23
63
  }
24
64
  const where = window.location;
25
65
  /* A hash router's place is in the hash ("#/assets"); keep it in the path. */
26
- const route = where.hash.startsWith("#/") ? where.hash.split("?")[0] : "";
66
+ const [hashPath = "", hashQuery = ""] = where.hash.startsWith("#/") ? where.hash.split("?") : [];
67
+ const route = hashPath + viewQuery(hashQuery);
27
68
  const ratio = window.devicePixelRatio || 1;
28
69
  const commit = document.querySelector("script[data-commit-sha]")?.getAttribute("data-commit-sha")
29
70
  ?? document.documentElement.getAttribute("data-commit-sha")
@@ -40,7 +81,7 @@ export function feedbackContext() {
40
81
  ? `${Math.round(window.screen.width * ratio)}x${Math.round(window.screen.height * ratio)}`
41
82
  : null;
42
83
  return {
43
- page: { path: where.pathname + route, title: document.title || null, url: where.href },
84
+ page: { path: where.pathname + viewQuery(where.search ?? "") + route, title: document.title || null, url: safeAddress(where.href) },
44
85
  client: {
45
86
  user_agent: typeof navigator === "object" ? navigator.userAgent : null,
46
87
  viewport: `${window.innerWidth}x${window.innerHeight}`,
package/dist/gate.d.ts CHANGED
@@ -4,8 +4,8 @@
4
4
  * It answers four questions in order, and each has one honest screen:
5
5
  * is the session still arriving? → nothing, briefly
6
6
  * is anyone signed in? → sign in with Google
7
- * do they belong to a company? → ask your administrator
8
- * does this company hold this app? → ask your administrator
7
+ * do they belong to a company? → ask an OS admin
8
+ * does this company hold this app? → ask an OS admin
9
9
  *
10
10
  * It fails closed. If the core cannot be reached, nobody gets in, because the
11
11
  * alternative, showing the app and letting row-level security return empty
package/dist/gate.js CHANGED
@@ -5,8 +5,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
5
5
  * It answers four questions in order, and each has one honest screen:
6
6
  * is the session still arriving? → nothing, briefly
7
7
  * is anyone signed in? → sign in with Google
8
- * do they belong to a company? → ask your administrator
9
- * does this company hold this app? → ask your administrator
8
+ * do they belong to a company? → ask an OS admin
9
+ * does this company hold this app? → ask an OS admin
10
10
  *
11
11
  * It fails closed. If the core cannot be reached, nobody gets in, because the
12
12
  * alternative, showing the app and letting row-level security return empty
@@ -132,6 +132,6 @@ export function OsAuthGate({ os, auth, appKey, children, extraCheck, renderSigne
132
132
  if (renderDenied)
133
133
  return _jsx(_Fragment, { children: renderDenied(signOut) });
134
134
  return (_jsx("div", { className: "os-gate", children: _jsxs("div", { className: "os-gate__card", children: [_jsx("h1", { className: "os-gate__title", children: phase === "no-company" ? "No workspace yet" : "No access yet" }), _jsx("p", { className: "os-gate__body", children: phase === "no-company"
135
- ? "Your account is not part of a company yet. Ask your AutoSolutions administrator to add you."
136
- : "This company does not have this app. Ask your AutoSolutions administrator for access." }), _jsx("button", { type: "button", className: "os-gate__link", onClick: signOut, children: "Use a different account" })] }) }));
135
+ ? "Your account is not part of a company yet. Ask an AutoSolutions OS admin to add you."
136
+ : "This app is not switched on for you in this company. Ask an AutoSolutions OS admin for access." }), _jsx("button", { type: "button", className: "os-gate__link", onClick: signOut, children: "Use a different account" })] }) }));
137
137
  }
package/dist/nav.d.ts CHANGED
@@ -221,7 +221,7 @@ export declare const HUB_PATHS: {
221
221
  * longer drawn by the frame, and stay for code that reads them.
222
222
  */
223
223
  export declare const HINTS: {
224
- readonly locked: "Ask your company admin to switch this on for you";
224
+ readonly locked: "Ask an AutoSolutions OS admin to switch this on for you";
225
225
  readonly notBuilt: "Not built yet";
226
226
  readonly notLinked: "Live, not linked from the Hub yet";
227
227
  readonly checking: "Checking your access…";
@@ -329,7 +329,7 @@ export declare function staticLinks(tenantSlug?: string | null): Record<string,
329
329
  * ?tenant=, because the switcher already offers that app;
330
330
  * - held, not deployed yet (no address): neither, so the frame opens the
331
331
  * tool's page in the Hub, as it does for a tool with no app;
332
- * - not held: locked ("Ask your company admin to switch this on for you").
332
+ * - not held: locked ("Ask an AutoSolutions OS admin to switch this on for you").
333
333
  * A fixed `url` is never consulted here: it is no way round the catalogue.
334
334
  * Tools with no app open their page in the Hub (osFrame). Links are final:
335
335
  * osFrame adds nothing to them.
@@ -350,8 +350,8 @@ export declare function catalogueLinks(apps: ReadonlyArray<{
350
350
  * permissions (migration hub_permissions, 4 Nov 2026) os_context().items
351
351
  * names every item of the map the person holds in the acting company, a
352
352
  * dashboard or a tool, whatever serves it; every row it does not name is
353
- * locked, sample pages and Finance included, with "Ask your company admin to
354
- * switch this on for you". Until the core has answered (`null`, or a read
353
+ * locked, sample pages and Finance included, with "Ask an AutoSolutions OS
354
+ * admin to switch this on for you". Until the core has answered (`null`, or a read
355
355
  * that failed and is being asked again), and from a core older than the
356
356
  * permissions (`undefined`), nothing is locked here: the rows stay as they
357
357
  * were before 0.3.13, the catalogue's own "Checking your access…" rows
package/dist/nav.js CHANGED
@@ -325,7 +325,7 @@ export const HUB_PATHS = {
325
325
  * longer drawn by the frame, and stay for code that reads them.
326
326
  */
327
327
  export const HINTS = {
328
- locked: "Ask your company admin to switch this on for you",
328
+ locked: "Ask an AutoSolutions OS admin to switch this on for you",
329
329
  notBuilt: "Not built yet",
330
330
  notLinked: "Live, not linked from the Hub yet",
331
331
  checking: "Checking your access…",
@@ -472,7 +472,7 @@ export function staticLinks(tenantSlug = null) {
472
472
  * ?tenant=, because the switcher already offers that app;
473
473
  * - held, not deployed yet (no address): neither, so the frame opens the
474
474
  * tool's page in the Hub, as it does for a tool with no app;
475
- * - not held: locked ("Ask your company admin to switch this on for you").
475
+ * - not held: locked ("Ask an AutoSolutions OS admin to switch this on for you").
476
476
  * A fixed `url` is never consulted here: it is no way round the catalogue.
477
477
  * Tools with no app open their page in the Hub (osFrame). Links are final:
478
478
  * osFrame adds nothing to them.
@@ -504,8 +504,8 @@ export function catalogueLinks(apps, tenantSlug = null) {
504
504
  * permissions (migration hub_permissions, 4 Nov 2026) os_context().items
505
505
  * names every item of the map the person holds in the acting company, a
506
506
  * dashboard or a tool, whatever serves it; every row it does not name is
507
- * locked, sample pages and Finance included, with "Ask your company admin to
508
- * switch this on for you". Until the core has answered (`null`, or a read
507
+ * locked, sample pages and Finance included, with "Ask an AutoSolutions OS
508
+ * admin to switch this on for you". Until the core has answered (`null`, or a read
509
509
  * that failed and is being asked again), and from a core older than the
510
510
  * permissions (`undefined`), nothing is locked here: the rows stay as they
511
511
  * were before 0.3.13, the catalogue's own "Checking your access…" rows
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** This package's version, sent with each feedback message. A test keeps it equal to package.json. */
2
- export declare const OS_VERSION = "0.4.3";
2
+ export declare const OS_VERSION = "0.4.5";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** This package's version, sent with each feedback message. A test keeps it equal to package.json. */
2
- export const OS_VERSION = "0.4.3";
2
+ export const OS_VERSION = "0.4.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosolutions-os",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
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",
@@ -15,6 +15,7 @@
15
15
  "./search": { "types": "./dist/search.d.ts", "import": "./dist/search.js" },
16
16
  "./core-view": { "types": "./dist/coreView.d.ts", "import": "./dist/coreView.js" },
17
17
  "./feedback": { "types": "./dist/feedback.d.ts", "import": "./dist/feedback.js" },
18
+ "./feedback-everywhere": { "types": "./dist/feedbackEverywhere.d.ts", "import": "./dist/feedbackEverywhere.js" },
18
19
  "./chrome.css": "./dist/chrome.css"
19
20
  },
20
21
  "files": ["dist", "CHANGELOG.md"],
@@ -26,14 +27,17 @@
26
27
  "peerDependencies": {
27
28
  "@supabase/supabase-js": ">=2.40.0",
28
29
  "autosolutions-design-system": ">=6.5.0 <7",
29
- "react": ">=18"
30
+ "react": ">=18",
31
+ "react-dom": ">=18"
30
32
  },
31
33
  "peerDependenciesMeta": {
32
34
  "autosolutions-design-system": { "optional": true },
33
- "react": { "optional": true }
35
+ "react": { "optional": true },
36
+ "react-dom": { "optional": true }
34
37
  },
35
38
  "devDependencies": {
36
39
  "@types/react": "^19.2.0",
40
+ "@types/react-dom": "^19.2.0",
37
41
  "typescript": "^5.8.3"
38
42
  }
39
43
  }