Repository navigation
Commit be91bfc
fix(ui): kanban, calendar, timeline and map draw the no-access state for a refused read (#36016)
Fixes #36010
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:看板、日历、时间线、地图这四种视图里,没有数据读取权限的人原来会看到一串英文服务器报错,现在看到和列表页一样的「无权访问」提示,按自己的语言显示。
- 为什么做:这是甘特图同类修复的收尾,把同一问题在其余四种视图里一次补齐。
- 出错会怎样:只影响被拒读这一种情况;服务器故障、断网仍显示原来的报错画面,改动可直接撤回。
- 要你做什么:无。
## What changes
The load-error branch of `ObjectKanban`, `ObjectCalendar`,
`ObjectTimeline` and `ObjectMap` now classifies a failed data load with
the shared `classifyLoadError` (`@object-ui/react`). A `forbidden`
verdict (a 403, or a `PERMISSION_DENIED` / `FORBIDDEN` code) draws the
shared `DataEmptyState` (`role="status"`, Lock icon) with the existing
`list.loadErrorForbiddenTitle` / `list.loadErrorForbiddenMessage` keys,
and none of the server's text. Every other failure keeps each view's
current error screen. This copies the Gantt pattern of PR #36006 view by
view.
- Shared helper or copy: **copied per view**. No shared "load error to
no-access" component exists, and adding one to `@object-ui/components`
would be a new public export outside the claim's file surface.
- English fallbacks: kanban and timeline get two rows in their existing
default-translation tables (`KANBAN_DEFAULT_TRANSLATIONS`,
`TIMELINE_DEFAULT_TRANSLATIONS`), with the same text as the `en` pack.
Calendar and map have no such table, so their `t()` calls carry
`defaultValue` with the same text. No new i18n key.
- Icon: kanban and calendar already depend on `lucide-react` and use
`Lock`. Timeline and map declare no icon library, so they use the shared
`LazyIcon name="lock"` from `@object-ui/components` (same as
`record-alert.tsx`), and no dependency is added.
- The map's tile-style failure (`mapStyleError`) is not a data load and
is unchanged.
- The `ObjectKanban.tsx` changes are the import lines, two fallback rows
and the load-error branch only (os-sales draft PR #35994 also edits that
file).
## Tests
New pins sit in each view's existing load-error harness as a top-level
`describe`: `ObjectKanban.errorClears-10663.test.tsx`,
`ObjectCalendar.errorClears-10663.test.tsx`,
`ObjectTimeline.errorClears-10663.test.tsx`, plus `ObjectMap.test.tsx`
(map has no load-error harness). In each one, a 403 with `httpStatus`
and `code` draws `*-no-access` with `role="status"`, the en sentence,
and no `Error`, `PERMISSION_DENIED` or `HTTP 403` text. CONTROL: a 500
keeps the existing error screen.
## Acceptance notes
- A2 (browser reading) was not done. Setting up a showcase object with a
kanban or calendar view and a refused read is not cheap here. The unit
pins drive the real component through a data source that throws the
adapter's 403 shape.
- `useTimelineTranslation` comments say the table is the "byte-identical
twin of `en.ts`". The two new rows match `en.ts`
`list.loadErrorForbidden*` text exactly.
## Verification
Two-minute check: `cd ui && pnpm exec vitest run
packages/plugin-kanban/src/ObjectKanban.errorClears-10663.test.tsx -t
'refused read'`. You should see 2 passed.
<details><summary>Green on head 37a0692: 4 files, 24 tests</summary>
```
cd ui && pnpm exec vitest run --maxWorkers=2 packages/plugin-kanban/src/ObjectKanban.errorClears-10663.test.tsx packages/plugin-calendar/src/ObjectCalendar.errorClears-10663.test.tsx packages/plugin-timeline/src/ObjectTimeline.errorClears-10663.test.tsx packages/plugin-map/src/ObjectMap.test.tsx
Test Files 4 passed (4)
Tests 24 passed (24)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>Red on base (sources reverted to ec24363, tests
kept): every 403 pin red, every CONTROL green</summary>
```
x object-timeline: a refused read draws the no-access state > a 403 read draws the no-access state, with none of the server text
v object-timeline: ... > CONTROL: a 500 keeps the existing error screen
x object-calendar: ... > a 403 read ...
v object-calendar: ... > CONTROL: a 500 ...
x ObjectMap: ... > a 403 read ...
v ObjectMap: ... > CONTROL: a 500 ...
x object-kanban: ... > a 403 read ...
v object-kanban: ... > CONTROL: a 500 ...
Tests 4 failed | 20 passed (24)
restore: git diff HEAD empty; every restored blob equals its HEAD blob
```
</details>
<details><summary>Ablation (kanban, one view): forbidden branch
disabled, the 403 pin goes red</summary>
```
node scripts/ablation-replace.mjs --file ui/packages/plugin-kanban/src/ObjectKanban.tsx --anchor "if (error && classifyLoadError(error) === 'forbidden') {" --replacement "if (error && false) {" -- ... vitest run ... -t 'refused read'
ablation-replace: ok mutation landed: anchor 1 -> 0, blob 8bd927f -> 0f5997510cd0
Tests 1 failed | 1 passed | 4 skipped (6)
ablation-replace: ok restored: blob == HEAD (8bd927f) and `git diff HEAD` is empty
```
The test imports the component from `src` (relative `./index` /
`./ObjectMap`), so no dist build is needed for the mutation to take
effect.
</details>
<details><summary>Type check: the four plugins</summary>
```
pnpm --filter @object-ui/plugin-{kanban,calendar,timeline,map} run type-check (tsc --noEmit && tsc -p tsconfig.test.json)
packages/plugin-calendar type-check: Done
packages/plugin-kanban type-check: Done
packages/plugin-map type-check: Done
packages/plugin-timeline type-check: Done
VERDICT command-exit 0
```
</details>
<details><summary>Derived gate families (local subset)</summary>
```
head 37a0692; dispatch-gates --commands derived 38 families; all run, each exit 0:
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
dispatch-gates --ran: 38 derived, 38 run, 0 NOT-MEASURED (a DERIVED zero: all 38 recorded an exit code)
check:query-options-erasure and check:type-check-debt hit the 300s timeout of the first loop (exit 124); rerun with no timeout: both exit 0
```
</details>
Files to read first: `ui/packages/plugin-map/src/ObjectMap.tsx` (the new
branch sits before the data error screen and must not catch
`mapStyleError`), `ui/packages/plugin-timeline/src/ObjectTimeline.tsx`
(`LazyIcon` instead of `lucide-react`),
`ui/packages/plugin-kanban/src/ObjectKanban.tsx` (it overlaps PR
#35994).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CZrgaiMgTJCnswR6jQ)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9b3227f commit be91bfc
10 files changed
Lines changed: 368 additions & 4 deletions
File tree
- .changeset
- ui/packages
- plugin-calendar/src
- plugin-kanban/src
- plugin-map/src
- plugin-timeline/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
104 | 127 | | |
105 | 128 | | |
106 | 129 | | |
| |||
211 | 234 | | |
212 | 235 | | |
213 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
1508 | 1510 | | |
1509 | 1511 | | |
1510 | 1512 | | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
1511 | 1538 | | |
1512 | 1539 | | |
1513 | 1540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
101 | 124 | | |
102 | 125 | | |
103 | 126 | | |
| |||
191 | 214 | | |
192 | 215 | | |
193 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
94 | 103 | | |
95 | 104 | | |
96 | 105 | | |
| |||
1953 | 1962 | | |
1954 | 1963 | | |
1955 | 1964 | | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
1956 | 1984 | | |
1957 | 1985 | | |
1958 | 1986 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
1386 | 1387 | | |
1387 | 1388 | | |
1388 | 1389 | | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
1389 | 1418 | | |
1390 | 1419 | | |
1391 | 1420 | | |
| |||
0 commit comments