@anchrd/intel-ui 0.8.0 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchrd/intel-ui",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
package/src/i18n/en.json CHANGED
@@ -147,6 +147,8 @@
147
147
  "tools.emptyHelp": "The portal answered, and it offers your account no tools. An administrator decides in the portal which servers exist and who may reach them.",
148
148
  "tools.unreachable": "Portal not reachable",
149
149
  "tools.unreachableHelp": "The company MCP portal did not answer, so Intel cannot tell which tools you have. Nothing is stored here; try again once the portal responds.",
150
+ "tools.connectFailed": "Portal sign-in failed",
151
+ "tools.connectFailedHelp": "The sign-in to the company MCP portal broke before it could be answered. This is a technical fault, not a decision about your access — reload to try again, and tell an administrator if it stays.",
150
152
  "tools.origin": "Origin",
151
153
  "tools.originPortal": "Company portal",
152
154
  "tools.inputSchema": "Input schema",
@@ -44,11 +44,17 @@ export function Tools() {
44
44
  // A hit from the header search arrives as `?select=<tool name>`, and the row it names opens with
45
45
  // the list. Nothing else about the row changes: it is still only a disclosure.
46
46
  const requested = useRouterState({ select: (state) => selectedFrom(state.location.search) });
47
- // The silent sign-in returns here with a marker when the portal refused. Only its presence is
48
- // used: the value comes from outside and could carry provider detail, so it is never rendered.
49
- const refused =
50
- typeof window !== "undefined" &&
51
- new URLSearchParams(window.location.search).has("connectError");
47
+ // The silent sign-in returns here with a marker when it failed. The value comes from outside
48
+ // and could carry provider detail, so it is never rendered — it is only compared against the
49
+ // codes Intel itself writes, to tell "you may not" from "the sign-in broke" (#93): the first is
50
+ // a sentence about access, the second must not masquerade as one.
51
+ const connectError =
52
+ typeof window === "undefined"
53
+ ? null
54
+ : new URLSearchParams(window.location.search).get("connectError");
55
+ const refused = connectError !== null;
56
+ const accessDenied =
57
+ connectError === "portal_sign_in_refused" || connectError === "permission_required";
52
58
  const [signingIn, setSigningIn] = React.useState(false);
53
59
 
54
60
  // ⚠️ Nobody is asked to start this. The portal sign-in is a browser redirect, so the screen
@@ -90,7 +96,7 @@ export function Tools() {
90
96
  ) : !catalog.data.portalConnected ? (
91
97
  signingIn ? (
92
98
  <p className="text-sm text-muted-foreground">{i18n.t("tools.signingIn")}</p>
93
- ) : (
99
+ ) : accessDenied || !refused ? (
94
100
  // The end of the silent walk for somebody no Access policy carries. It is a sentence
95
101
  // about access, not an invitation to connect: there is nothing they could click that
96
102
  // would change the answer, and what the portal replied is not repeated here.
@@ -102,6 +108,16 @@ export function Tools() {
102
108
  title={i18n.t("tools.noAccess")}
103
109
  help={i18n.t("tools.noAccessHelp")}
104
110
  />
111
+ ) : (
112
+ // Every other marker is machinery, not policy: the sign-in broke before anyone could
113
+ // be allowed or refused. Saying "no access" here sent the last reader hunting through
114
+ // Access policies while the real fault sat in a failed client registration (#93).
115
+ <Notice
116
+ alert
117
+ icon={<PlugZap aria-hidden="true" className="mx-auto size-8 text-destructive" />}
118
+ title={i18n.t("tools.connectFailed")}
119
+ help={i18n.t("tools.connectFailedHelp")}
120
+ />
105
121
  )
106
122
  ) : catalog.data.items.length === 0 ? (
107
123
  <Notice