@unson/brainbase-mcp 0.50.30 → 0.51.0
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/contracts/canonical-task/store-schema.sql +3 -0
- package/dist/automation-run.js +3 -2
- package/dist/canonical-task-postgres.js +3 -0
- package/dist/canonical-task-service.d.ts +6 -0
- package/dist/canonical-task-service.js +40 -1
- package/dist/company-os-learning-adoption.d.ts +9 -0
- package/dist/company-os-learning-adoption.js +50 -1
- package/dist/durable-waits.d.ts +30 -0
- package/dist/durable-waits.js +100 -94
- package/dist/foundation-public-provider.d.ts +3 -1
- package/dist/foundation-public-provider.js +2 -2
- package/dist/graph-corrections.d.ts +46 -1
- package/dist/graph-corrections.js +172 -1
- package/dist/judgment-event-outbox.d.ts +24 -2
- package/dist/judgment-event-outbox.js +92 -10
- package/dist/judgment-frame.js +2 -2
- package/dist/judgment-host.d.ts +4 -1
- package/dist/judgment-host.js +126 -14
- package/dist/judgment-task-progress.d.ts +41 -0
- package/dist/judgment-task-progress.js +18 -0
- package/dist/knowledge-continuation.js +7 -1
- package/dist/knowledge-lookup.js +43 -58
- package/dist/mcp-runtime.d.ts +9 -0
- package/dist/mcp-runtime.js +12 -4
- package/dist/meeting-automation-runtime.d.ts +52 -0
- package/dist/meeting-automation-runtime.js +46 -0
- package/dist/queue-task-tools.js +2 -2
- package/dist/routine-liveness.js +0 -1
- package/dist/routine-runtime.js +1 -1
- package/dist/server.d.ts +59 -85
- package/dist/server.js +44 -36
- package/dist/ssot.js +1 -1
- package/dist/testing/queue-task-tools-contract.js +1 -1
- package/dist/world-model-impact-index.d.ts +132 -0
- package/dist/world-model-impact-index.js +901 -0
- package/package.json +6 -18
- package/ui/README.md +31 -0
- package/ui/graph-own-share.js +106 -50
- package/ui/graph-projects-view.js +4 -4
- package/ui/graph-view-shared.css +3 -0
- package/ui/judgment-history.css +13 -0
- package/ui/objective-editor.css +19 -2
- package/ui/objective-editor.js +6 -3
- package/ui/project-workspace.css +33 -26
- package/ui/workspace-kit.css +141 -0
- package/ui/workspace-kit.js +59 -8
- package/ui/world/world-view.css +65 -46
- package/ui/world/world-view.js +28 -19
- package/dist/execution-authority-http.d.ts +0 -30
- package/dist/execution-authority-http.js +0 -454
- package/dist/execution-authority.d.ts +0 -282
- package/dist/execution-authority.js +0 -867
- package/dist/resource-reservation-http.d.ts +0 -31
- package/dist/resource-reservation-http.js +0 -371
- package/dist/resource-reservations.d.ts +0 -221
- package/dist/resource-reservations.js +0 -577
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unson/brainbase-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"description": "Local-first Brainbase judgment OS that lets supported AI agents reuse a user's approved goals, priorities, decisions, and judgment criteria.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -387,10 +387,6 @@
|
|
|
387
387
|
"types": "./dist/mcp-tool-schema-portability.d.ts",
|
|
388
388
|
"import": "./dist/mcp-tool-schema-portability.js"
|
|
389
389
|
},
|
|
390
|
-
"./resource-reservations": {
|
|
391
|
-
"types": "./dist/resource-reservations.d.ts",
|
|
392
|
-
"import": "./dist/resource-reservations.js"
|
|
393
|
-
},
|
|
394
390
|
"./durable-waits": {
|
|
395
391
|
"types": "./dist/durable-waits.d.ts",
|
|
396
392
|
"import": "./dist/durable-waits.js"
|
|
@@ -407,10 +403,6 @@
|
|
|
407
403
|
"types": "./dist/judgment-view-http.d.ts",
|
|
408
404
|
"import": "./dist/judgment-view-http.js"
|
|
409
405
|
},
|
|
410
|
-
"./execution-authority-http": {
|
|
411
|
-
"types": "./dist/execution-authority-http.d.ts",
|
|
412
|
-
"import": "./dist/execution-authority-http.js"
|
|
413
|
-
},
|
|
414
406
|
"./server-support": {
|
|
415
407
|
"types": "./dist/server-support.d.ts",
|
|
416
408
|
"import": "./dist/server-support.js"
|
|
@@ -423,6 +415,10 @@
|
|
|
423
415
|
"types": "./dist/company-os-impact-review.d.ts",
|
|
424
416
|
"import": "./dist/company-os-impact-review.js"
|
|
425
417
|
},
|
|
418
|
+
"./world-model-impact-index": {
|
|
419
|
+
"types": "./dist/world-model-impact-index.d.ts",
|
|
420
|
+
"import": "./dist/world-model-impact-index.js"
|
|
421
|
+
},
|
|
426
422
|
"./streamable-http": {
|
|
427
423
|
"types": "./dist/streamable-http.d.ts",
|
|
428
424
|
"import": "./dist/streamable-http.js"
|
|
@@ -525,14 +521,6 @@
|
|
|
525
521
|
"types": "./dist/problem-candidates.d.ts",
|
|
526
522
|
"import": "./dist/problem-candidates.js"
|
|
527
523
|
},
|
|
528
|
-
"./resource-reservation-http": {
|
|
529
|
-
"types": "./dist/resource-reservation-http.d.ts",
|
|
530
|
-
"import": "./dist/resource-reservation-http.js"
|
|
531
|
-
},
|
|
532
|
-
"./execution-authority": {
|
|
533
|
-
"types": "./dist/execution-authority.d.ts",
|
|
534
|
-
"import": "./dist/execution-authority.js"
|
|
535
|
-
},
|
|
536
524
|
"./knowledge-continuation": {
|
|
537
525
|
"types": "./dist/knowledge-continuation.d.ts",
|
|
538
526
|
"import": "./dist/knowledge-continuation.js"
|
|
@@ -681,5 +669,5 @@
|
|
|
681
669
|
"url": "https://github.com/Unson-LLC/brainbase/issues"
|
|
682
670
|
},
|
|
683
671
|
"homepage": "https://github.com/Unson-LLC/brainbase#readme",
|
|
684
|
-
"gitHead": "
|
|
672
|
+
"gitHead": "8b9acad360928fd94db972da5861ea90044ea481"
|
|
685
673
|
}
|
package/ui/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Shared browser UI
|
|
2
|
+
|
|
3
|
+
The browser modules in this directory accept a document, DOM roots and host
|
|
4
|
+
callbacks. Load `brainbase-tokens.css`, `workspace-kit.css` and the feature's
|
|
5
|
+
stylesheet. The host owns authorization, navigation and persistence. See the
|
|
6
|
+
[common UI specification](../docs/specs/oss-common-ui-spec.md) for component
|
|
7
|
+
appearance, accessibility and compatibility contracts.
|
|
8
|
+
|
|
9
|
+
## Imported records
|
|
10
|
+
|
|
11
|
+
`createOwnShareView` from `@unson/brainbase-mcp/ui/graph-own-share` uses the
|
|
12
|
+
existing read-only snapshot routes. By default it renders its searchable list
|
|
13
|
+
and inline selected-record details. A host that already renders the same list
|
|
14
|
+
can explicitly select `presentation: 'details-only'` and consume `onState` or
|
|
15
|
+
`controller.state.search` for the original results and completeness information.
|
|
16
|
+
|
|
17
|
+
Open a record with
|
|
18
|
+
`controller.openEntity(id, { opener, expectedHandover: { graphId, digest } })`.
|
|
19
|
+
Use the snapshot identity from the row that was activated. The shared drawer
|
|
20
|
+
checks the response identity and preserves record details, judgment rationale
|
|
21
|
+
and relation navigation. `opener` accepts a Node or a function returning the
|
|
22
|
+
current trigger. Call `controller.destroy()` when leaving the host view; late
|
|
23
|
+
responses cannot revive the drawer. This presentation does not add candidate
|
|
24
|
+
search, writes, or an organization mapping model to the shared UI.
|
|
25
|
+
|
|
26
|
+
`workspaceStepBand` and `workspaceCandidateChoices` from
|
|
27
|
+
`@unson/brainbase-mcp/ui/workspace-kit` display supplied steps and candidate
|
|
28
|
+
choices. They return DOM nodes with an `update(value)` method. Candidate choices
|
|
29
|
+
also accept `update(value, { disabled })`. Their callbacks report intent; hosts
|
|
30
|
+
confirm a choice and update the controlled display. Completion, legal candidates,
|
|
31
|
+
counts and permissions are never inferred by these components.
|
package/ui/graph-own-share.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* 「持ち込んだ記録」: the owner's own Graph snapshot that a host keeps for
|
|
3
3
|
* them (an OSS Personal OS sent with `brainbase graph:upgrade`), shown next to
|
|
4
4
|
* the host's own Graph and never mixed into it.
|
|
5
5
|
*
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
} from './graph-view-shared.js';
|
|
44
44
|
import {
|
|
45
45
|
workspaceDefinition,
|
|
46
|
+
workspaceDetailDrawer,
|
|
46
47
|
workspaceLedger,
|
|
47
48
|
workspaceNotice,
|
|
48
49
|
workspaceRailBlock,
|
|
@@ -51,14 +52,14 @@ import {
|
|
|
51
52
|
} from './workspace-kit.js';
|
|
52
53
|
|
|
53
54
|
export const GRAPH_OWN_SHARE_CONTRACT_VERSION = 'brainbase.graph-own-share.v1';
|
|
54
|
-
export const GRAPH_OWN_SHARE_LABEL = '
|
|
55
|
-
export const GRAPH_OWN_OBJECTIVES_LABEL = '
|
|
55
|
+
export const GRAPH_OWN_SHARE_LABEL = '持ち込んだ記録';
|
|
56
|
+
export const GRAPH_OWN_OBJECTIVES_LABEL = '持ち込んだ目的';
|
|
56
57
|
/** Sends the local Graph (`graph:upgrade`) and lists what was sent (`graph:bundles`). */
|
|
57
58
|
export const GRAPH_OWN_SHARE_COMMANDS = Object.freeze(['brainbase graph:upgrade', 'brainbase graph:bundles']);
|
|
58
59
|
export const GRAPH_OWN_OBJECTIVE_LEDGER_COLUMNS = Object.freeze(['目的', '状態', '評価期間', '責任を持つ人', '基準']);
|
|
59
60
|
|
|
60
|
-
const OWN_LEAD = '
|
|
61
|
-
const OBJECTIVES_LEAD = '
|
|
61
|
+
const OWN_LEAD = '自分のBrainbaseから持ち込んだ最新の記録です。組織の記録とは別に、あなただけに表示されます。ここでは編集できません。';
|
|
62
|
+
const OBJECTIVES_LEAD = '自分のBrainbaseから持ち込んだ目的の定義です。組織には書き込まれず、あなただけの記録として残ります。ここでは編集できません。';
|
|
62
63
|
const PARTICIPATION = Object.freeze({ participates_in: '参加', accountable_for: '責任' });
|
|
63
64
|
const ADOPTION_LABELS = Object.freeze({ draft: '下書き', proposed: '提案中', approved: '承認済み', retired: '終了' });
|
|
64
65
|
const VISIBILITY_LABELS = Object.freeze({ private: '本人だけ', project: 'プロジェクト', organization: '組織', public: '公開' });
|
|
@@ -80,16 +81,16 @@ export function graphOwnShareSource(option, { fetcher } = {}) {
|
|
|
80
81
|
/** What the owner sent, in words: when it was sent. The snapshot ID and digest are in ownShareHandoverRows. */
|
|
81
82
|
export function ownShareHandoverText(handover) {
|
|
82
83
|
if (!isRecord(handover) || !textOrNull(handover.graphId)) return null;
|
|
83
|
-
return `${formatDateTime(handover.createdAt)}
|
|
84
|
+
return `${formatDateTime(handover.createdAt)} に自分のBrainbaseから持ち込み`;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
/** The snapshot ID, where it is kept and its digest, for the record details only. */
|
|
87
88
|
export function ownShareHandoverRows(handover) {
|
|
88
89
|
if (!isRecord(handover) || !textOrNull(handover.graphId)) return null;
|
|
89
90
|
return [
|
|
90
|
-
['
|
|
91
|
+
['持ち込みのID', handover.graphId],
|
|
91
92
|
['置き場所', textOrNull(handover.projectCode)],
|
|
92
|
-
['
|
|
93
|
+
['照合用のコード', textOrNull(handover.digest) ?? '未確認'],
|
|
93
94
|
];
|
|
94
95
|
}
|
|
95
96
|
|
|
@@ -107,10 +108,10 @@ export function ownShareStateNotice(doc, readState, { onRetry, loadingText } = {
|
|
|
107
108
|
if (readState?.state === 'not_handed_over') {
|
|
108
109
|
const body = makeElement(doc, 'div', { className: 'bb-graph-notice-body' });
|
|
109
110
|
body.append(
|
|
110
|
-
makeElement(doc, 'p', { text: '
|
|
111
|
+
makeElement(doc, 'p', { text: 'まだ何も持ち込まれていません。自分のBrainbaseで次のコマンドを実行すると、そこの記録をここへ持ち込めます。持ち込んだ記録は、あなたにだけ見えます。実行前に、接続先の設定(BRAINBASE_ORGANIZATION_URL・_TOKEN・_PROJECT・_GRAPH_ID)が要ります。2つ目のコマンドで、持ち込んだ記録を確かめられます。' }),
|
|
111
112
|
graphCommandList(doc, GRAPH_OWN_SHARE_COMMANDS),
|
|
112
113
|
);
|
|
113
|
-
return workspaceNotice(doc, { label: '
|
|
114
|
+
return workspaceNotice(doc, { label: 'まだ何も持ち込まれていません', text: body, tone: 'info', role: 'status' });
|
|
114
115
|
}
|
|
115
116
|
return graphStateNotice(doc, readState, { onRetry, loadingText });
|
|
116
117
|
}
|
|
@@ -168,9 +169,9 @@ function relationList(doc, edges, asOf, options) {
|
|
|
168
169
|
|
|
169
170
|
/** A selected project of the own share, below its ledger (not in the host's rail). */
|
|
170
171
|
export function ownProjectDetail(doc, detail, { onClose, onRetry } = {}) {
|
|
171
|
-
const wrap = makeElement(doc, 'div', { className: 'bb-graph-own-detail', attrs: { 'aria-label': '
|
|
172
|
+
const wrap = makeElement(doc, 'div', { className: 'bb-graph-own-detail', attrs: { 'aria-label': '選んだプロジェクト(持ち込んだ記録)' } });
|
|
172
173
|
const project = detail?.state === 'ok' ? detail.payload.project : { name: detail?.id ?? '', id: detail?.id ?? '' };
|
|
173
|
-
wrap.append(workspaceRailHead(doc, { kicker: '
|
|
174
|
+
wrap.append(workspaceRailHead(doc, { kicker: '持ち込んだ記録・プロジェクト', title: project.name, sub: project.id }), closeButton(doc, onClose));
|
|
174
175
|
if (detail?.state !== 'ok') {
|
|
175
176
|
wrap.append(graphStateNotice(doc, detail ?? { state: 'loading' }, { onRetry, loadingText: 'このプロジェクトを読み込んでいます。' }));
|
|
176
177
|
return wrap;
|
|
@@ -189,7 +190,7 @@ export function ownProjectDetail(doc, detail, { onClose, onRetry } = {}) {
|
|
|
189
190
|
wrap.append(workspaceRailBlock(doc, {
|
|
190
191
|
title: '関係者',
|
|
191
192
|
content: payload.participants.length === 0
|
|
192
|
-
? makeElement(doc, 'p', { className: 'bb-graph-empty', text: '
|
|
193
|
+
? makeElement(doc, 'p', { className: 'bb-graph-empty', text: '持ち込んだ記録には、このプロジェクトの関係者の情報がありません。' })
|
|
193
194
|
: relationList(doc, payload.participants, payload.asOf, { participation: true }),
|
|
194
195
|
}));
|
|
195
196
|
const relations = Array.isArray(payload.relations) ? payload.relations : [];
|
|
@@ -200,7 +201,7 @@ export function ownProjectDetail(doc, detail, { onClose, onRetry } = {}) {
|
|
|
200
201
|
function decisionRecordBlock(doc, entity, record) {
|
|
201
202
|
if (entity.type !== 'decision' || record === undefined) return null;
|
|
202
203
|
if (record === null) {
|
|
203
|
-
return workspaceRailBlock(doc, { title: '判断根拠', content: makeElement(doc, 'p', { className: 'bb-graph-empty', text: '
|
|
204
|
+
return workspaceRailBlock(doc, { title: '判断根拠', content: makeElement(doc, 'p', { className: 'bb-graph-empty', text: '持ち込んだ記録には、この判断の理由の情報がありません。' }) });
|
|
204
205
|
}
|
|
205
206
|
return workspaceRailBlock(doc, {
|
|
206
207
|
title: '判断根拠',
|
|
@@ -215,11 +216,13 @@ function decisionRecordBlock(doc, entity, record) {
|
|
|
215
216
|
}
|
|
216
217
|
|
|
217
218
|
/** A selected record of the own share, below its results (not in the host's rail). */
|
|
218
|
-
export function ownEntityDetail(doc, detail, { onClose, onRetry, onOpen } = {}) {
|
|
219
|
-
const wrap = makeElement(doc, 'div', { className: 'bb-graph-own-detail', attrs: { 'aria-label': '
|
|
219
|
+
export function ownEntityDetail(doc, detail, { onClose, onRetry, onOpen, copy = {} } = {}) {
|
|
220
|
+
const wrap = makeElement(doc, 'div', { className: 'bb-graph-own-detail', attrs: { 'aria-label': '選んだ記録(持ち込んだ記録)' } });
|
|
220
221
|
const loaded = detail?.state === 'ok' ? detail.payload : null;
|
|
221
222
|
const entity = loaded?.entity ?? detail?.pending ?? { id: detail?.id ?? '', name: detail?.id ?? '', type: null };
|
|
222
|
-
wrap.append(workspaceRailHead(doc, { kicker: `${entity.type ? typeLabel(entity.type) : '記録'}
|
|
223
|
+
wrap.append(workspaceRailHead(doc, { kicker: copy.kicker ? `${copy.kicker}・${entity.type ? typeLabel(entity.type) : '記録'}` : `持ち込んだ記録・${entity.type ? typeLabel(entity.type) : '記録'}`, title: entity.name, sub: entity.id }));
|
|
224
|
+
const close = closeButton(doc, onClose);
|
|
225
|
+
if (close) wrap.append(close);
|
|
223
226
|
if (!loaded) {
|
|
224
227
|
wrap.append(graphStateNotice(doc, detail ?? { state: 'loading' }, { onRetry, loadingText: 'この記録を読み込んでいます。' }));
|
|
225
228
|
return wrap;
|
|
@@ -235,7 +238,7 @@ export function ownEntityDetail(doc, detail, { onClose, onRetry, onOpen } = {})
|
|
|
235
238
|
}));
|
|
236
239
|
const decisionBlock = decisionRecordBlock(doc, entity, loaded.decisionRecord);
|
|
237
240
|
if (decisionBlock) wrap.append(decisionBlock);
|
|
238
|
-
for (const [key, title, empty] of [['outgoing', '
|
|
241
|
+
for (const [key, title, empty] of [['outgoing', copy.outgoingTitle ?? 'この記録からのつながり', copy.outgoingEmpty ?? 'この記録からのつながりはありません。'], ['incoming', copy.incomingTitle ?? 'この記録へのつながり', copy.incomingEmpty ?? 'この記録へのつながりはありません。']]) {
|
|
239
242
|
const edges = Array.isArray(loaded[key]) ? loaded[key] : [];
|
|
240
243
|
wrap.append(workspaceRailBlock(doc, {
|
|
241
244
|
title,
|
|
@@ -246,7 +249,7 @@ export function ownEntityDetail(doc, detail, { onClose, onRetry, onOpen } = {})
|
|
|
246
249
|
}
|
|
247
250
|
|
|
248
251
|
// ---------------------------------------------------------------------------
|
|
249
|
-
//
|
|
252
|
+
// 持ち込んだ記録 (on its own)
|
|
250
253
|
|
|
251
254
|
export const GRAPH_OWN_SHARE_LEDGER_COLUMNS = Object.freeze(['名前', '種類', '要約', '有効期間']);
|
|
252
255
|
export const GRAPH_OWN_SHARE_SEARCH_LIMIT = 50;
|
|
@@ -254,14 +257,14 @@ export const GRAPH_OWN_SHARE_SEARCH_LIMIT = 50;
|
|
|
254
257
|
* The default lead of the standalone section: what the snapshot is, who sees
|
|
255
258
|
* it, and that it becomes an organization record only once it is promoted.
|
|
256
259
|
*/
|
|
257
|
-
export const GRAPH_OWN_SHARE_VIEW_LEAD = '
|
|
260
|
+
export const GRAPH_OWN_SHARE_VIEW_LEAD = '自分のBrainbaseから持ち込んだ最新の記録です(brainbase graph:upgrade)。組織の記録とは別に、あなただけに表示されます。ここでは編集できません。組織の記録に書き込むものを選びます。';
|
|
258
261
|
|
|
259
262
|
function isOwnEntity(value) {
|
|
260
263
|
return isRecord(value) && typeof value.id === 'string' && typeof value.name === 'string' && Array.isArray(value.aliases);
|
|
261
264
|
}
|
|
262
265
|
|
|
263
266
|
/**
|
|
264
|
-
* Mounts
|
|
267
|
+
* Mounts 「持ち込んだ記録」 on its own: the owner's latest snapshot, searched
|
|
265
268
|
* by name or alias on `{basePath}/search`, with a record opened below the list
|
|
266
269
|
* from `{basePath}/entities/:id` (and a decision's judgment record). Read-only.
|
|
267
270
|
* A host places it where the owner takes records in (候補の確認, ledger D14),
|
|
@@ -273,11 +276,13 @@ function isOwnEntity(value) {
|
|
|
273
276
|
* @param {Document} [options.document]
|
|
274
277
|
* @param {Function} [options.fetcher] `fetch`-compatible function.
|
|
275
278
|
* @param {string} [options.basePath='/api/graph/own'] The host's owner-private routes.
|
|
276
|
-
* @param {string} [options.label] The section label (default
|
|
279
|
+
* @param {string} [options.label] The section label (default 持ち込んだ記録).
|
|
277
280
|
* @param {string} [options.lead] Replaces the section lead.
|
|
278
281
|
* @param {() => Date} [options.now] The owner's clock.
|
|
279
282
|
* @param {boolean} [options.autoLoad=true] Runs the empty search on mount.
|
|
280
|
-
* @
|
|
283
|
+
* @param {'details-only'} [options.presentation] Opts into the shared drawer without a second list.
|
|
284
|
+
* @param {Function} [options.onState] Reports original search read states in details-only presentation.
|
|
285
|
+
* @returns The controller: `state`, `render()`, `search(query?)`, `openEntity(id, options?)`, `closeDetail()`, `destroy()`.
|
|
281
286
|
*/
|
|
282
287
|
export function createOwnShareView({
|
|
283
288
|
root,
|
|
@@ -288,6 +293,9 @@ export function createOwnShareView({
|
|
|
288
293
|
lead = GRAPH_OWN_SHARE_VIEW_LEAD,
|
|
289
294
|
now = () => new Date(),
|
|
290
295
|
autoLoad = true,
|
|
296
|
+
presentation,
|
|
297
|
+
onState,
|
|
298
|
+
detailCopy,
|
|
291
299
|
} = {}) {
|
|
292
300
|
if (!root) throw new TypeError('root is required');
|
|
293
301
|
const doc = explicitDocument ?? globalThis.document;
|
|
@@ -295,6 +303,35 @@ export function createOwnShareView({
|
|
|
295
303
|
const state = { query: '', applied: '', search: { state: 'loading' }, detail: null };
|
|
296
304
|
let destroyed = false;
|
|
297
305
|
let generation = 0;
|
|
306
|
+
const detailsOnly = presentation === 'details-only';
|
|
307
|
+
let detailGeneration = 0;
|
|
308
|
+
let drawer = null;
|
|
309
|
+
let detailOpener = null;
|
|
310
|
+
|
|
311
|
+
function sameSnapshot(left, right) {
|
|
312
|
+
return Boolean(textOrNull(left?.graphId) && textOrNull(left?.digest)
|
|
313
|
+
&& left.graphId === right?.graphId && left.digest === right?.digest);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function ensureDrawer() {
|
|
317
|
+
if (drawer) return drawer;
|
|
318
|
+
drawer = workspaceDetailDrawer(doc, {
|
|
319
|
+
title: detailCopy?.title ?? '記録の詳細',
|
|
320
|
+
opener: () => typeof detailOpener === 'function' ? detailOpener() : detailOpener,
|
|
321
|
+
onClose: () => { state.detail = null; detailGeneration += 1; },
|
|
322
|
+
});
|
|
323
|
+
drawer.dialog.className += ' bb-graph-own-drawer';
|
|
324
|
+
return drawer;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function renderDrawer() {
|
|
328
|
+
if (!state.detail) return;
|
|
329
|
+
ensureDrawer().setContent(ownEntityDetail(doc, state.detail, {
|
|
330
|
+
onRetry: () => controller.openEntity(state.detail?.id, { expectedHandover: state.detail?.expectedHandover }),
|
|
331
|
+
onOpen: id => controller.openEntity(id, { expectedHandover: state.detail?.expectedHandover }),
|
|
332
|
+
copy: detailCopy,
|
|
333
|
+
}));
|
|
334
|
+
}
|
|
298
335
|
|
|
299
336
|
function searchForm() {
|
|
300
337
|
const form = makeElement(doc, 'form', { className: 'bb-graph-form bb-graph-own-search', attrs: { role: 'search', novalidate: true } });
|
|
@@ -309,29 +346,29 @@ export function createOwnShareView({
|
|
|
309
346
|
input.addEventListener('input', update);
|
|
310
347
|
input.addEventListener('change', update);
|
|
311
348
|
wrap.append(makeElement(doc, 'label', { text: '名前・別名', attrs: { for: 'bb-graph-own-q' } }), input);
|
|
312
|
-
form.append(wrap, makeElement(doc, 'button', { className: 'bb-ws-button', text: '
|
|
349
|
+
form.append(wrap, makeElement(doc, 'button', { className: 'bb-ws-button', text: '名前・別名で探す', attrs: { type: 'submit' } }));
|
|
313
350
|
return form;
|
|
314
351
|
}
|
|
315
352
|
|
|
316
353
|
function body() {
|
|
317
|
-
const notice = ownShareStateNotice(doc, state.search, { onRetry: () => controller.search(), loadingText: '
|
|
354
|
+
const notice = ownShareStateNotice(doc, state.search, { onRetry: () => controller.search(), loadingText: '持ち込んだ記録を探しています。' });
|
|
318
355
|
if (notice) return { children: [notice], handover: null };
|
|
319
356
|
const { payload } = state.search;
|
|
320
357
|
const asOf = payload.query?.asOf ?? now().toISOString();
|
|
321
358
|
const children = [searchForm()];
|
|
322
359
|
if (payload.graphEmpty === true) {
|
|
323
|
-
children.push(makeElement(doc, 'p', { className: 'bb-graph-empty', text: '
|
|
360
|
+
children.push(makeElement(doc, 'p', { className: 'bb-graph-empty', text: '持ち込んだ記録はありません。' }));
|
|
324
361
|
return { children, handover: payload.handover };
|
|
325
362
|
}
|
|
326
363
|
children.push(makeElement(doc, 'p', {
|
|
327
364
|
className: 'bb-graph-own-caption',
|
|
328
|
-
text:
|
|
365
|
+
text: `持ち込んだ記録 ${Number.isInteger(payload.total) ? `${payload.total}件` : `${payload.results.length}件を表示`}${payload.truncated ? `(うち${payload.results.length}件を表示)` : ''}`,
|
|
329
366
|
}));
|
|
330
367
|
children.push(workspaceLedger(doc, {
|
|
331
368
|
className: 'bb-graph-entity-ledger bb-graph-own-ledger',
|
|
332
369
|
ariaLabel: `${source.label}の一覧`,
|
|
333
370
|
columns: GRAPH_OWN_SHARE_LEDGER_COLUMNS,
|
|
334
|
-
empty: '
|
|
371
|
+
empty: '条件に合う記録は、持ち込んだ記録の中にありません。',
|
|
335
372
|
rows: payload.results.map((entity) => ({
|
|
336
373
|
key: entity.id,
|
|
337
374
|
selected: entity.id === state.detail?.id,
|
|
@@ -359,6 +396,7 @@ export function createOwnShareView({
|
|
|
359
396
|
get state() { return state; },
|
|
360
397
|
render() {
|
|
361
398
|
if (destroyed) return controller;
|
|
399
|
+
if (detailsOnly) { renderDrawer(); return controller; }
|
|
362
400
|
const { children, handover } = body();
|
|
363
401
|
root.replaceChildren(ownShareSection(doc, { label: source.label, lead, handover, children, className: 'bb-graph-own-view' }));
|
|
364
402
|
return controller;
|
|
@@ -371,40 +409,58 @@ export function createOwnShareView({
|
|
|
371
409
|
state.applied = state.query.trim();
|
|
372
410
|
state.search = { state: 'loading' };
|
|
373
411
|
controller.render();
|
|
412
|
+
if (detailsOnly) onState?.(state.search);
|
|
413
|
+
if (destroyed || requestGeneration !== generation) return state.search;
|
|
374
414
|
const result = await source.client.read('/search', { q: state.applied, limit: GRAPH_OWN_SHARE_SEARCH_LIMIT });
|
|
375
415
|
if (destroyed || requestGeneration !== generation) return state.search;
|
|
376
416
|
// An empty answer is an answer here: the host confirms the whole snapshot was searched.
|
|
377
417
|
state.search = result.state === 'ok' && !(Array.isArray(result.payload?.results) && result.payload.results.every(isOwnEntity)) ? INVALID : result;
|
|
378
418
|
const openId = state.detail?.id;
|
|
379
|
-
if (openId && !(state.search.state === 'ok' && state.search.payload.results.some((entity) => entity.id === openId))) state.detail = null;
|
|
419
|
+
if (!detailsOnly && openId && !(state.search.state === 'ok' && state.search.payload.results.some((entity) => entity.id === openId))) state.detail = null;
|
|
420
|
+
if (detailsOnly && state.detail && (state.search.state !== 'ok' || !sameSnapshot(state.detail.expectedHandover, state.search.payload.handover))) {
|
|
421
|
+
controller.closeDetail({ restoreFocus: false, immediate: true });
|
|
422
|
+
drawer?.setContent();
|
|
423
|
+
}
|
|
380
424
|
controller.render();
|
|
425
|
+
if (detailsOnly) onState?.(state.search);
|
|
381
426
|
return state.search;
|
|
382
427
|
},
|
|
383
428
|
/** Opens (or with null closes) a record of the snapshot below the list. */
|
|
384
|
-
async openEntity(id) {
|
|
429
|
+
async openEntity(id, { opener, expectedHandover } = {}) {
|
|
385
430
|
if (destroyed) return null;
|
|
386
431
|
const target = textOrNull(id);
|
|
387
432
|
if (!target) {
|
|
433
|
+
if (detailsOnly) { controller.closeDetail(); return null; }
|
|
388
434
|
state.detail = null;
|
|
389
435
|
controller.render();
|
|
390
436
|
return null;
|
|
391
437
|
}
|
|
392
|
-
const
|
|
393
|
-
const
|
|
438
|
+
const requestGeneration = detailsOnly ? ++detailGeneration : null;
|
|
439
|
+
const expected = detailsOnly ? expectedHandover ?? (state.search.state === 'ok' ? state.search.payload.handover : null) : null;
|
|
440
|
+
const expectedIdentity = expected && { graphId: textOrNull(expected.graphId), digest: textOrNull(expected.digest) };
|
|
441
|
+
if (detailsOnly) {
|
|
442
|
+
if (opener !== undefined) detailOpener = opener;
|
|
443
|
+
else if (!drawer?.dialog.open) detailOpener = doc.activeElement;
|
|
444
|
+
}
|
|
445
|
+
const listed = state.search.state === 'ok' && (!detailsOnly || sameSnapshot(state.search.payload.handover, expectedIdentity)) ? state.search.payload.results.find((entity) => entity.id === target) : null;
|
|
446
|
+
const pending = listed ?? (state.detail?.state === 'ok' && (!detailsOnly || sameSnapshot(state.detail.payload.handover, expectedIdentity)) ? [...state.detail.payload.outgoing, ...state.detail.payload.incoming]
|
|
394
447
|
.map((edge) => edge.counterpart).find((counterpart) => counterpart.id === target) : null) ?? null;
|
|
395
|
-
state.detail = { id: target, state: 'loading', pending: pending ? { id: target, name: pending.name, type: pending.type } : null };
|
|
448
|
+
state.detail = { id: target, state: 'loading', pending: pending ? { id: target, name: pending.name, type: pending.type } : null, ...(detailsOnly ? { expectedHandover: expectedIdentity } : {}) };
|
|
396
449
|
controller.render();
|
|
450
|
+
if (detailsOnly) ensureDrawer().open();
|
|
397
451
|
const result = await source.client.read(`/entities/${encodeURIComponent(target)}`);
|
|
398
|
-
if (destroyed || state.detail?.id !== target) return state.detail;
|
|
399
|
-
const base = { id: target, pending: state.detail.pending };
|
|
400
|
-
if (result.state === 'error' && result.status === 404) state.detail = { ...base, state: 'not_found', reason: '
|
|
452
|
+
if (destroyed || state.detail?.id !== target || detailsOnly && requestGeneration !== detailGeneration) return state.detail;
|
|
453
|
+
const base = { id: target, pending: state.detail.pending, ...(detailsOnly ? { expectedHandover: expectedIdentity } : {}) };
|
|
454
|
+
if (result.state === 'error' && result.status === 404) state.detail = { ...base, state: 'not_found', reason: 'この記録は、持ち込んだ記録の中に見つかりません。' };
|
|
401
455
|
else if (result.state !== 'ok') state.detail = { ...base, ...result };
|
|
402
|
-
else if (!isOwnEntity(result.payload?.entity) || !Array.isArray(result.payload.outgoing) || !Array.isArray(result.payload.incoming)) state.detail = { ...base, ...INVALID };
|
|
456
|
+
else if (!isOwnEntity(result.payload?.entity) || !Array.isArray(result.payload.outgoing) || !Array.isArray(result.payload.incoming) || detailsOnly && result.payload.entity.id !== target) state.detail = { ...base, ...INVALID };
|
|
457
|
+
else if (detailsOnly && (!sameSnapshot(expectedIdentity, result.payload.handover) || state.search.state === 'ok' && !sameSnapshot(state.search.payload.handover, expectedIdentity))) state.detail = { ...base, state: 'unknown' };
|
|
403
458
|
else state.detail = { ...base, state: 'ok', payload: result.payload };
|
|
404
459
|
controller.render();
|
|
405
460
|
return state.detail;
|
|
406
461
|
},
|
|
407
|
-
|
|
462
|
+
closeDetail(options) { if (!detailsOnly) return controller.openEntity(null); state.detail = null; detailGeneration++; drawer?.close(options); },
|
|
463
|
+
destroy() { destroyed = true; generation++; detailGeneration++; drawer?.dispose(); drawer = null; root.replaceChildren(); },
|
|
408
464
|
};
|
|
409
465
|
controller.render();
|
|
410
466
|
if (autoLoad) void controller.search('');
|
|
@@ -412,7 +468,7 @@ export function createOwnShareView({
|
|
|
412
468
|
}
|
|
413
469
|
|
|
414
470
|
// ---------------------------------------------------------------------------
|
|
415
|
-
//
|
|
471
|
+
// 持ち込んだ目的
|
|
416
472
|
|
|
417
473
|
function isObjectiveView(value) {
|
|
418
474
|
return isRecord(value) && typeof value.id === 'string' && typeof value.meaning === 'string'
|
|
@@ -445,7 +501,7 @@ function periodText(period) {
|
|
|
445
501
|
}
|
|
446
502
|
|
|
447
503
|
/**
|
|
448
|
-
* Mounts
|
|
504
|
+
* Mounts 「持ち込んだ目的」: the objectives of the owner's latest
|
|
449
505
|
* snapshot, read-only, from `GET {basePath}/objectives`.
|
|
450
506
|
*
|
|
451
507
|
* @param {object} options
|
|
@@ -453,7 +509,7 @@ function periodText(period) {
|
|
|
453
509
|
* @param {Document} [options.document]
|
|
454
510
|
* @param {Function} [options.fetcher] `fetch`-compatible function.
|
|
455
511
|
* @param {string} [options.basePath='/api/graph/own'] The host's owner-private routes.
|
|
456
|
-
* @param {string} [options.label] The section label (default
|
|
512
|
+
* @param {string} [options.label] The section label (default 持ち込んだ目的).
|
|
457
513
|
* @param {boolean} [options.autoLoad=true]
|
|
458
514
|
* @returns The controller: `state`, `render()`, `load()`, `select(id)`.
|
|
459
515
|
*/
|
|
@@ -475,9 +531,9 @@ export function createOwnObjectivesView({
|
|
|
475
531
|
let destroyed = false, generation = 0;
|
|
476
532
|
|
|
477
533
|
function detail(objective) {
|
|
478
|
-
const wrap = makeElement(doc, 'div', { className: 'bb-graph-own-detail', attrs: { 'aria-label': '
|
|
534
|
+
const wrap = makeElement(doc, 'div', { className: 'bb-graph-own-detail', attrs: { 'aria-label': '選んだ目的(持ち込んだ記録)' } });
|
|
479
535
|
wrap.append(
|
|
480
|
-
workspaceRailHead(doc, { kicker: '
|
|
536
|
+
workspaceRailHead(doc, { kicker: '持ち込んだ記録・目的', title: objective.meaning }),
|
|
481
537
|
closeButton(doc, () => controller.select(null)),
|
|
482
538
|
);
|
|
483
539
|
const criteria = makeElement(doc, 'ul', { className: 'bb-graph-plain-list' });
|
|
@@ -492,7 +548,7 @@ export function createOwnObjectivesView({
|
|
|
492
548
|
['責任を持つ人', personText(objective.accountable)],
|
|
493
549
|
['受益者', objective.beneficiaries.length > 0 ? objective.beneficiaries.map(personText).join('、') : null],
|
|
494
550
|
['状態', ownLabel(ADOPTION_LABELS, objective.adoptionState) ?? textOrNull(objective.adoptionState)],
|
|
495
|
-
['
|
|
551
|
+
['公開範囲(自分のBrainbaseでの設定)', ownLabel(VISIBILITY_LABELS, objective.visibility) ?? textOrNull(objective.visibility)],
|
|
496
552
|
]),
|
|
497
553
|
recordDetails(doc, [
|
|
498
554
|
['目的ID', objective.id],
|
|
@@ -505,21 +561,21 @@ export function createOwnObjectivesView({
|
|
|
505
561
|
}
|
|
506
562
|
|
|
507
563
|
function body() {
|
|
508
|
-
const notice = ownShareStateNotice(doc, state.list, { onRetry: () => controller.load(), loadingText: '
|
|
564
|
+
const notice = ownShareStateNotice(doc, state.list, { onRetry: () => controller.load(), loadingText: '持ち込んだ目的を読み込んでいます。' });
|
|
509
565
|
if (notice) {
|
|
510
566
|
if (compact && state.list.state !== 'loading' && state.list.state !== 'not_handed_over') {
|
|
511
|
-
onNotice?.({ title: label, message: `${state.list.reason ?? '
|
|
567
|
+
onNotice?.({ title: label, message: `${state.list.reason ?? '持ち込んだ目的を取得できません。'} 0件ではありません。`, onRetry: () => controller.load() });
|
|
512
568
|
return [makeElement(doc, 'p', { className: 'bb-ws-inline-error', text: '取得できません' })];
|
|
513
569
|
}
|
|
514
570
|
if (compact && state.list.state === 'not_handed_over') {
|
|
515
|
-
const guide = makeElement(doc, 'details'); guide.append(makeElement(doc, 'summary', { text: '
|
|
516
|
-
return [makeElement(doc, 'p', { text: '
|
|
571
|
+
const guide = makeElement(doc, 'details'); guide.append(makeElement(doc, 'summary', { text: '持ち込むための案内' }), notice);
|
|
572
|
+
return [makeElement(doc, 'p', { text: '目的はまだ持ち込まれていません。' }), guide];
|
|
517
573
|
}
|
|
518
574
|
return [notice];
|
|
519
575
|
}
|
|
520
576
|
const { payload } = state.list;
|
|
521
577
|
if (payload.objectives.length === 0) {
|
|
522
|
-
return [makeElement(doc, 'p', { className: 'bb-graph-empty', text: payload.foundation === 'none' ? '
|
|
578
|
+
return [makeElement(doc, 'p', { className: 'bb-graph-empty', text: payload.foundation === 'none' ? '持ち込んだ記録には、目的の定義がありません。' : '持ち込んだ記録には、目的がありません。' })];
|
|
523
579
|
}
|
|
524
580
|
const children = [workspaceLedger(doc, {
|
|
525
581
|
className: 'bb-graph-own-ledger bb-graph-own-objective-ledger',
|
|
@@ -551,7 +607,7 @@ export function createOwnObjectivesView({
|
|
|
551
607
|
if (compact) {
|
|
552
608
|
const facts = makeElement(doc, 'p', { className: 'bb-graph-own-facts', text: '読み取りのみ' });
|
|
553
609
|
const refs = makeElement(doc, 'details');
|
|
554
|
-
refs.append(makeElement(doc, 'summary', { text: '出典' }), makeElement(doc, 'p', { text: ownShareHandoverText(handover) ?? (state.list.state === 'not_handed_over' ? '
|
|
610
|
+
refs.append(makeElement(doc, 'summary', { text: '出典' }), makeElement(doc, 'p', { text: ownShareHandoverText(handover) ?? (state.list.state === 'not_handed_over' ? 'まだ何も持ち込まれていません。' : '出典は確認できません。') }), handoverDetails(doc, handover));
|
|
555
611
|
root.replaceChildren(facts, ...body(), refs);
|
|
556
612
|
}
|
|
557
613
|
else root.replaceChildren(ownShareSection(doc, { label: source.label, lead: OBJECTIVES_LEAD, handover, children: body(), className: 'bb-graph-own-objectives' }));
|
|
@@ -313,7 +313,7 @@ function normalizeProjectSummary(value) {
|
|
|
313
313
|
* @param {{ basePath: string, fetcher?: Function, label?: string }} [options.ownShare]
|
|
314
314
|
* The owner's own snapshot the host keeps for them (`graph-own-share.js`): its projects are read
|
|
315
315
|
* from `{basePath}/projects` and shown read-only in a separate section after the host's content,
|
|
316
|
-
* labelled
|
|
316
|
+
* labelled 「持ち込んだ記録」 unless `label` says otherwise. They are never
|
|
317
317
|
* added to the ledger, the metrics or the rail, and a failed read shows only in that section.
|
|
318
318
|
* Without it nothing of the kind is drawn or read.
|
|
319
319
|
* @param {(projectId: string, options?: { onProgress?: (snapshot: object) => void }) => Promise<object>} [options.loadProjectContext]
|
|
@@ -620,12 +620,12 @@ export function createGraphProjectsView({
|
|
|
620
620
|
|
|
621
621
|
function renderOwnShare() {
|
|
622
622
|
const ownState = state.own;
|
|
623
|
-
const notice = ownShareStateNotice(doc, ownState.list, { onRetry: () => controller.loadOwn(), loadingText: '
|
|
623
|
+
const notice = ownShareStateNotice(doc, ownState.list, { onRetry: () => controller.loadOwn(), loadingText: '持ち込んだ記録を読み込んでいます。' });
|
|
624
624
|
if (notice) return ownShareSection(doc, { label: own.label, children: [notice] });
|
|
625
625
|
const { payload } = ownState.list;
|
|
626
626
|
const children = [];
|
|
627
627
|
if (payload.projects.length === 0) {
|
|
628
|
-
children.push(makeElement(doc, 'p', { className: 'bb-graph-empty', text: '
|
|
628
|
+
children.push(makeElement(doc, 'p', { className: 'bb-graph-empty', text: '持ち込んだ記録には、プロジェクトの情報がありません。' }));
|
|
629
629
|
} else {
|
|
630
630
|
children.push(workspaceLedger(doc, {
|
|
631
631
|
className: 'bb-graph-project-ledger bb-graph-own-ledger',
|
|
@@ -1353,7 +1353,7 @@ export function createGraphProjectsView({
|
|
|
1353
1353
|
const result = await own.client.read(`/projects/${encodeURIComponent(target)}`);
|
|
1354
1354
|
if (state.own.selectedId !== target) return state.own.detail;
|
|
1355
1355
|
state.own.detail = result.state === 'error' && result.status === 404
|
|
1356
|
-
? { id: target, state: 'not_found', reason: '
|
|
1356
|
+
? { id: target, state: 'not_found', reason: 'このプロジェクトは、持ち込んだ記録の中に見つかりません。' }
|
|
1357
1357
|
: { id: target, ...normalizeProjectDetail(result) };
|
|
1358
1358
|
controller.render();
|
|
1359
1359
|
return state.own.detail;
|
package/ui/graph-view-shared.css
CHANGED
|
@@ -608,3 +608,6 @@
|
|
|
608
608
|
display: none;
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
+
.bb-graph-own-drawer .bb-graph-own-detail { margin:0; padding:0; border:0; background:none; }
|
|
612
|
+
.bb-graph-own-drawer .bb-ws-definition { grid-template-columns:112px minmax(0,1fr); gap:9px 12px; font-size:12.5px; line-height:normal; }
|
|
613
|
+
.bb-graph-own-drawer .bb-ws-definition dd { line-height:1.7; }
|
package/ui/judgment-history.css
CHANGED
|
@@ -776,3 +776,16 @@
|
|
|
776
776
|
color: var(--bb-color-accent-strong);
|
|
777
777
|
font-weight: var(--bb-font-weight-medium);
|
|
778
778
|
}
|
|
779
|
+
|
|
780
|
+
/* Explicit small warning/error treatments; details retain all coverage metadata. */
|
|
781
|
+
.bb-jh-banner.is-warning {
|
|
782
|
+
padding: 6px 10px;
|
|
783
|
+
border-left: 3px solid var(--bb-color-notice-warning);
|
|
784
|
+
background: linear-gradient(90deg, color-mix(in srgb, var(--bb-color-notice-warning) 18%, transparent), transparent), var(--bb-color-notice-background);
|
|
785
|
+
}
|
|
786
|
+
.bb-jh-notifications .bb-jh-banner.is-warning {
|
|
787
|
+
background: linear-gradient(90deg, color-mix(in srgb, var(--bb-color-notice-warning) 18%, transparent), transparent), var(--bb-color-notice-background);
|
|
788
|
+
}
|
|
789
|
+
.bb-jh-notifications .bb-jh-banner.is-danger {
|
|
790
|
+
background: linear-gradient(90deg, color-mix(in srgb, var(--bb-color-notice-danger) 18%, transparent), transparent), var(--bb-color-notice-background);
|
|
791
|
+
}
|
package/ui/objective-editor.css
CHANGED
|
@@ -242,9 +242,9 @@ textarea.objective-editor-input { min-height: 5.4rem; resize: vertical; }
|
|
|
242
242
|
.bb-objective-judgment.is-draft { color: var(--bb-color-warning); }
|
|
243
243
|
.bb-objective-judgment.is-unresolved { color: var(--bb-color-quiet); font-weight: 500; }
|
|
244
244
|
.bb-objective-story { margin-top: var(--bb-space-6); }
|
|
245
|
-
.bb-objective-notice-body { display:
|
|
245
|
+
.bb-objective-notice-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
|
|
246
246
|
.bb-objective-notice-body p { margin: 0; overflow-wrap: anywhere; }
|
|
247
|
-
.bb-objective-notice-body .bb-ws-button {
|
|
247
|
+
.bb-objective-notice-body .bb-ws-button { min-height: 20px; padding: 0 5px; font-size: 11px; }
|
|
248
248
|
|
|
249
249
|
.bb-objective-rail { display: block; }
|
|
250
250
|
.bb-objective-rail > .bb-ws-notice { margin: var(--bb-space-4) 0 0; }
|
|
@@ -292,3 +292,20 @@ textarea.objective-editor-input { min-height: 5.4rem; resize: vertical; }
|
|
|
292
292
|
.objective-editor-criterion-row { grid-template-columns: 1fr 1fr; }
|
|
293
293
|
.objective-editor-criterion-row .objective-editor-button-danger { grid-column: 1 / -1; justify-self: start; }
|
|
294
294
|
}
|
|
295
|
+
|
|
296
|
+
/* Keep scope/status notices compact, including host-supplied source notices. */
|
|
297
|
+
.bb-objective-workspace .bb-ws-notice,
|
|
298
|
+
.bb-objective-rail .bb-ws-notice {
|
|
299
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
300
|
+
gap: 6px 10px;
|
|
301
|
+
width: fit-content;
|
|
302
|
+
max-width: 100%;
|
|
303
|
+
box-sizing: border-box;
|
|
304
|
+
margin: 8px 0;
|
|
305
|
+
padding: 6px 10px;
|
|
306
|
+
line-height: 1.5;
|
|
307
|
+
}
|
|
308
|
+
@media (max-width: 760px) {
|
|
309
|
+
.bb-objective-workspace .bb-ws-notice,
|
|
310
|
+
.bb-objective-rail .bb-ws-notice { grid-template-columns: minmax(0, 1fr); }
|
|
311
|
+
}
|
package/ui/objective-editor.js
CHANGED
|
@@ -1045,15 +1045,18 @@ function periodText(period, { compact = false } = {}) {
|
|
|
1045
1045
|
return `${ledgerDate(period?.from) ?? '未設定'}〜${ledgerDate(period?.until, startYear) ?? '未設定'}`;
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
1048
|
-
/**
|
|
1048
|
+
/** Recoverable states are warnings; blocked operations are errors, never zero items. */
|
|
1049
1049
|
function workspaceStatusNotice(doc, value, { label, onRetry, retryLabel = '再試行' } = {}) {
|
|
1050
1050
|
const normalized = typeof value === 'string' ? { state: value } : value ?? {};
|
|
1051
1051
|
const status = normalizeState(normalized.state);
|
|
1052
1052
|
const tone = status === 'verified' ? 'info'
|
|
1053
|
-
: ['unknown', 'saved_unverified'].includes(status) ? 'warning'
|
|
1053
|
+
: ['unknown', 'saved_unverified', 'error_retryable'].includes(status) ? 'warning'
|
|
1054
1054
|
: 'danger';
|
|
1055
1055
|
const body = makeElement('div', { className: 'bb-objective-notice-body' });
|
|
1056
1056
|
body.append(makeElement('p', { text: `${STATUS_LABELS[status] ?? STATUS_LABELS.unknown}:${normalized.message ?? STATUS_LABELS[status] ?? '状態を確認できません。'}` }));
|
|
1057
|
+
if (['unknown', 'error_retryable'].includes(status)) {
|
|
1058
|
+
body.append(makeElement('p', { text: 'データが0件とは確認できていません。再読込して確かめてください。' }));
|
|
1059
|
+
}
|
|
1057
1060
|
if (status === 'conflict' && normalized.currentRevision) {
|
|
1058
1061
|
body.append(makeElement('p', { text: `現在の版: ${normalized.currentRevision}。入力は残しています。現在の版を確かめてから編集してください。` }));
|
|
1059
1062
|
}
|
|
@@ -1366,7 +1369,7 @@ function portMethod(port, name) {
|
|
|
1366
1369
|
* Host options used only in the workspace layout (when `rail` is given); the
|
|
1367
1370
|
* tabs layout without `rail` ignores them:
|
|
1368
1371
|
* - `title` / `lead`: replace the page head's 目的と現状 and its lead.
|
|
1369
|
-
* - `sourceNotice: { label, text }`: a notice right after the page head
|
|
1372
|
+
* - `sourceNotice: { label, text, tone? }`: a notice right after the page head
|
|
1370
1373
|
* (`text` is a string or an element). Default: none.
|
|
1371
1374
|
* - `pageActions: [{ text, variant, onClick, disabled }]`: host-owned buttons in
|
|
1372
1375
|
* the page head after 再読込 / 新しい目的.
|