dsh-mnemon-source-documents 0.6.0 → 0.6.2

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/lib/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { Context } from "@deepseek-ai/cordis";
6
6
  interface Config {
7
7
  dataDir?: string;
8
8
  limitBytes?: number;
9
+ bm25Recall?: boolean;
9
10
  }
10
11
  declare const Config: z<Config>;
11
12
  //#endregion
package/lib/index.js CHANGED
@@ -9,6 +9,7 @@ import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, re
9
9
  //#region src/config.ts
10
10
  const Config = z.object({
11
11
  dataDir: z.string(),
12
+ bm25Recall: z.boolean(),
12
13
  limitBytes: z.number().step(1).min(1).max(1073741824)
13
14
  });
14
15
  function documentsSourceConfig(value, instanceKey) {
@@ -17,7 +18,8 @@ function documentsSourceConfig(value, instanceKey) {
17
18
  if (!isAbsolute(dataDir)) throw new Error("Documents Source dataDir must be absolute");
18
19
  return {
19
20
  dataDir,
20
- limitBytes: config.limitBytes ?? 10485760
21
+ limitBytes: config.limitBytes ?? 10485760,
22
+ bm25Recall: config.bm25Recall ?? false
21
23
  };
22
24
  }
23
25
  //#endregion
@@ -295,8 +297,17 @@ var DocumentController = class {
295
297
  const includeArchived = options.includeArchived === true;
296
298
  const limit = Math.max(1, Math.min(50, Math.trunc(options.limit ?? 20)));
297
299
  const allowedIds = options.allowedIds === void 0 ? void 0 : new Set(options.allowedIds);
298
- const ranked = index.documents.filter((record) => allowedIds === void 0 || allowedIds.has(record.id)).filter((record) => includeArchived || record.status === "active").map((record) => {
299
- const view = this.view(record);
300
+ const ranked = index.documents.filter((record) => allowedIds === void 0 || allowedIds.has(record.id)).filter((record) => includeArchived || record.status === "active").flatMap((record) => {
301
+ let view;
302
+ try {
303
+ view = this.view(record);
304
+ } catch (error) {
305
+ if (error.code === "ENOENT") {
306
+ this.excerpts.delete(this.pathFor(record));
307
+ return [];
308
+ }
309
+ throw error;
310
+ }
300
311
  const title = view.title.normalize("NFKC").toLocaleLowerCase();
301
312
  const description = view.description.normalize("NFKC").toLocaleLowerCase();
302
313
  const content = view.content.normalize("NFKC").toLocaleLowerCase();
@@ -309,13 +320,13 @@ var DocumentController = class {
309
320
  if (titleMatch || descriptionMatch || contentMatch) tokenMatches += 1;
310
321
  score += titleMatch ? 4 : descriptionMatch ? 2 : contentMatch ? 1 : 0;
311
322
  }
312
- return {
323
+ return [{
313
324
  result: {
314
325
  ...view,
315
326
  score
316
327
  },
317
328
  tokenMatches
318
- };
329
+ }];
319
330
  }).filter((candidate) => normalized === "" || candidate.result.score > 0 && candidate.tokenMatches >= requiredTokenMatches).sort((left, right) => right.result.score - left.result.score || Date.parse(right.result.updatedAt) - Date.parse(left.result.updatedAt)).slice(0, limit).map(({ result }) => ({
320
331
  ...result,
321
332
  excerpt: excerpt(result.content)
@@ -375,15 +386,16 @@ var DocumentController = class {
375
386
  const rendered = renderDocument(updated, content);
376
387
  updated.sizeBytes = Buffer.byteLength(rendered, "utf8");
377
388
  const destination = this.pathFor(updated);
378
- renameSync(source, destination);
389
+ this.atomicWrite(destination, rendered);
379
390
  try {
380
- writeFileSync(destination, rendered, "utf8");
381
391
  index.documents = index.documents.map((record) => record.id === id ? updated : record);
382
392
  this.persistIndex(index);
383
393
  } catch (error) {
384
- if (existsSync(destination)) renameSync(destination, source);
394
+ rmSync(destination, { force: true });
385
395
  throw error;
386
396
  }
397
+ rmSync(source, { force: true });
398
+ this.excerpts.delete(source);
387
399
  return {
388
400
  success: true,
389
401
  action: "archived",
@@ -657,11 +669,16 @@ var DocumentController = class {
657
669
  }
658
670
  atomicWrite(path, content) {
659
671
  const temporary = `${path}.${process.pid}.${crypto.randomUUID()}.tmp`;
660
- writeFileSync(temporary, content, {
661
- encoding: "utf8",
662
- mode: 384
663
- });
664
- renameSync(temporary, path);
672
+ try {
673
+ if (typeof content === "string") writeFileSync(temporary, content, {
674
+ encoding: "utf8",
675
+ mode: 384
676
+ });
677
+ else writeFileSync(temporary, content, { mode: 384 });
678
+ renameSync(temporary, path);
679
+ } finally {
680
+ rmSync(temporary, { force: true });
681
+ }
665
682
  }
666
683
  withLock(callback) {
667
684
  const deadline = Date.now() + LOCK_TIMEOUT_MS;
@@ -935,7 +952,15 @@ function createDocumentsMemorySource(config = {}) {
935
952
  value: {
936
953
  workspaceRoot: root,
937
954
  documentIds: active.map((document) => document.id),
938
- archivedDocumentIds: current.documents.filter((document) => document.status === "archived" && document.healthy).map((document) => document.id).sort()
955
+ archivedDocumentIds: current.documents.filter((document) => document.status === "archived" && document.healthy).map((document) => document.id).sort(),
956
+ ...request.includeProjection && effective.bm25Recall ? { bm25: {
957
+ scope: createHash("sha256").update(JSON.stringify([effective.dataDir, root])).digest("hex"),
958
+ text: truncateMemoryText("Project Documents can be searched by title or topic.", request.maxCharacters),
959
+ titles: active.map((document) => ({
960
+ id: document.id,
961
+ title: document.title
962
+ }))
963
+ } } : {}
939
964
  },
940
965
  revision: current.revision,
941
966
  consistency: "namespace-pinned-live-read"
@@ -3,7 +3,9 @@ import type { DocumentMutation, DocumentMutationResult, DocumentSearchResult, Do
3
3
  export interface DocumentsPageClient {
4
4
  documents(): Promise<DocumentSnapshot>;
5
5
  document(id: string): Promise<DocumentView>;
6
- searchDocuments(query: string, includeArchived?: boolean, limit?: number): Promise<DocumentSearchResult>;
6
+ searchDocuments(query: string, includeArchived?: boolean, limit?: number): Promise<DocumentSearchResult & {
7
+ revision?: string;
8
+ }>;
7
9
  mutateDocument(request: DocumentMutation): Promise<DocumentMutationResult>;
8
10
  archiveDocument(id: string): Promise<DocumentMutationResult>;
9
11
  deleteDocument?(id: string, expectedRevision: string, fileRevision: string): Promise<DocumentMutationResult>;
@@ -7,5 +7,5 @@ export declare function DocumentsPage(props: {
7
7
  sessionId?: string;
8
8
  canCreate?: boolean;
9
9
  documentId?: string;
10
- onMutate: () => void;
10
+ onMutate?: () => void;
11
11
  }): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mnemon-source-documents",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Self-contained documents Source for Composable View Memory.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -47,8 +47,7 @@
47
47
  "verify": "pnpm typecheck && pnpm test && pnpm build"
48
48
  },
49
49
  "dependencies": {
50
- "@deepseek-ai/schemastery": "^3.18.4",
51
- "markdown-to-jsx": "^7.7.0"
50
+ "@deepseek-ai/schemastery": "^3.18.4"
52
51
  },
53
52
  "peerDependencies": {
54
53
  "@deepseek-ai/cordis": "^4.0.1",
@@ -61,7 +60,7 @@
61
60
  "@types/node": "^22.0.0",
62
61
  "@types/react": "^18.3.0",
63
62
  "@types/react-dom": "^18.3.0",
64
- "dsh-mnemon": "^0.5.42",
63
+ "dsh-mnemon": "^0.5.49",
65
64
  "jsdom": "^26.0.0",
66
65
  "react": "^18.2.0",
67
66
  "react-dom": "^18.2.0",
@@ -2,7 +2,7 @@
2
2
  "zh": {
3
3
  "nav.documents": "档案",
4
4
  "documents.title": "项目档案",
5
- "documents.description": "当前工作区的项目文档:先检索,再按需阅读全文;接近容量上限时,最久未用的档案会归档。",
5
+ "documents.description": "按需检索的工作区文档,超限时自动归档。",
6
6
  "documents.capacity": "{used} / {limit}",
7
7
  "documents.summary": "档案存储摘要",
8
8
  "documents.active": "活跃档案",
@@ -12,13 +12,13 @@
12
12
  "documents.activeCapacity": "活跃容量",
13
13
  "documents.capacityHint": "按实际 UTF-8 文件大小计算",
14
14
  "documents.searchAria": "检索项目档案",
15
- "documents.searchPlaceholder": "搜索设计、调查、流程或交接记录…",
15
+ "documents.searchPlaceholder": "搜索档案…",
16
16
  "documents.search": "检索",
17
17
  "documents.scope": "档案范围",
18
- "documents.new": "新建档案",
18
+ "documents.new": "新建",
19
19
  "documents.newTitle": "创建托管档案",
20
20
  "documents.editTitle": "编辑活跃档案",
21
- "documents.editorHint": "控制层会生成 frontmatter、哈希与修订号;原项目文件始终只读。",
21
+ "documents.editorHint": "自动维护元数据与修订号,不修改项目源文件。",
22
22
  "documents.managedCopy": "托管副本",
23
23
  "documents.name": "标题",
24
24
  "documents.routing": "检索说明",
@@ -26,8 +26,8 @@
26
26
  "documents.sourcesPlaceholder": "src/index.ts, docs/architecture.md",
27
27
  "documents.markdown": "Markdown 内容",
28
28
  "documents.saving": "保存中…",
29
- "documents.create": "创建档案",
30
- "documents.save": "保存修订",
29
+ "documents.create": "创建",
30
+ "documents.save": "保存",
31
31
  "documents.created": "已创建活跃档案。",
32
32
  "documents.createdAfterArchive": "已先迁移 {count} 份旧档案,再创建活跃档案。",
33
33
  "documents.updated": "已保存新的档案修订。",
@@ -50,8 +50,8 @@
50
50
  "documents.edit": "编辑",
51
51
  "documents.delete": "删除",
52
52
  "documents.deleteConfirm": "永久删除这份档案?",
53
- "documents.deleteDescription": "将永久移除档案记录和托管副本,无法撤销。不会建立记忆空间冷索引,也不会修改已有记忆空间条目或项目源文件。",
54
- "documents.deleteNow": "永久删除",
53
+ "documents.deleteDescription": "永久移除托管副本,项目源文件与记忆空间不受影响,且无法撤销。",
54
+ "documents.deleteNow": "确认删除",
55
55
  "documents.deleting": "删除中…",
56
56
  "documents.deleted": "档案已永久删除。",
57
57
  "documents.path": "托管路径",
@@ -61,17 +61,16 @@
61
61
  "documents.archiveReceipt": "Mnemon 冷索引回执",
62
62
  "documents.archiveNote": "归档说明",
63
63
  "documents.archiveTitle": "迁入归档",
64
- "documents.archiveDescription": "独立任务 Agent 先拟定摘要和目标空间;Host 校验后写入冷索引,再移动原文。没有已启用且支持精确写入与删除的记忆空间时,原文直接移入本地归档,不建立索引。",
64
+ "documents.archiveDescription": "生成摘要索引并移入归档,释放活跃容量。",
65
65
  "documents.archive": "归档",
66
66
  "documents.archiveConfirm": "确认归档这份档案?",
67
67
  "documents.archiving": "归档中…",
68
- "documents.archiveNow": "确认归档",
69
- "documents.footnote": "`.mnemon/documents/index.json` 是控制面事实源;active 总量固定不超过 10 MB,archived 不计入上限,项目源文件不会被修改。"
68
+ "documents.archiveNow": "确认归档"
70
69
  },
71
70
  "en": {
72
71
  "nav.documents": "Documents",
73
72
  "documents.title": "Project Documents",
74
- "documents.description": "Project documents for this workspace: searched first, read in full when needed; near the limit the least-used ones are archived.",
73
+ "documents.description": "Workspace documents searched on demand and archived when full.",
75
74
  "documents.capacity": "{used} / {limit}",
76
75
  "documents.summary": "Document storage summary",
77
76
  "documents.active": "Active",
@@ -81,13 +80,13 @@
81
80
  "documents.activeCapacity": "Active capacity",
82
81
  "documents.capacityHint": "Measured from actual UTF-8 files",
83
82
  "documents.searchAria": "Search project documents",
84
- "documents.searchPlaceholder": "Search designs, investigations, procedures, or handoffs…",
83
+ "documents.searchPlaceholder": "Search documents…",
85
84
  "documents.search": "Search",
86
85
  "documents.scope": "Document scope",
87
- "documents.new": "New document",
86
+ "documents.new": "New",
88
87
  "documents.newTitle": "Create managed document",
89
88
  "documents.editTitle": "Edit active document",
90
- "documents.editorHint": "The control plane generates frontmatter, hashes, and revisions. Project source files stay read only.",
89
+ "documents.editorHint": "Metadata and revisions are managed automatically; source files stay untouched.",
91
90
  "documents.managedCopy": "Managed copy",
92
91
  "documents.name": "Title",
93
92
  "documents.routing": "Retrieval description",
@@ -95,8 +94,8 @@
95
94
  "documents.sourcesPlaceholder": "src/index.ts, docs/architecture.md",
96
95
  "documents.markdown": "Markdown content",
97
96
  "documents.saving": "Saving…",
98
- "documents.create": "Create document",
99
- "documents.save": "Save revision",
97
+ "documents.create": "Create",
98
+ "documents.save": "Save",
100
99
  "documents.created": "Active document created.",
101
100
  "documents.createdAfterArchive": "Archived {count} older document(s), then created the active document.",
102
101
  "documents.updated": "New document revision saved.",
@@ -119,8 +118,8 @@
119
118
  "documents.edit": "Edit",
120
119
  "documents.delete": "Delete",
121
120
  "documents.deleteConfirm": "Permanently delete this document?",
122
- "documents.deleteDescription": "This permanently removes the document record and managed copy and cannot be undone. No Memory Space index is created. Existing Memory Space entries and original project files remain unchanged.",
123
- "documents.deleteNow": "Delete permanently",
121
+ "documents.deleteDescription": "Permanently removes the managed copy; project files and Memory Space notes stay untouched. This cannot be undone.",
122
+ "documents.deleteNow": "Confirm delete",
124
123
  "documents.deleting": "Deleting…",
125
124
  "documents.deleted": "Document permanently deleted.",
126
125
  "documents.path": "Managed path",
@@ -130,11 +129,10 @@
130
129
  "documents.archiveReceipt": "Mnemon cold-index receipt",
131
130
  "documents.archiveNote": "Archive note",
132
131
  "documents.archiveTitle": "Move to archive",
133
- "documents.archiveDescription": "An independent task Agent proposes a summary and destination. The Host validates and writes the cold index before moving the original. Without an active Memory Space that has exact writes and safe deletion, the original moves to the local archive without an index.",
132
+ "documents.archiveDescription": "Index a summary in Memory Spaces and move the full text to archive.",
134
133
  "documents.archive": "Archive",
135
134
  "documents.archiveConfirm": "Archive this document?",
136
135
  "documents.archiving": "Archiving…",
137
- "documents.archiveNow": "Confirm archive",
138
- "documents.footnote": "`.mnemon/documents/index.json` is the control-plane source of truth. active stays at or below 10 MB, archived is excluded, and project source files are never modified."
136
+ "documents.archiveNow": "Confirm archive"
139
137
  }
140
138
  }
@@ -6,18 +6,63 @@
6
6
  .documentCapacity > div { height: 4px; margin: 8px 0 6px; overflow: hidden; border-radius: 999px; background: var(--mn-fill); }
7
7
  .documentCapacity > div i { display: block; height: 100%; border-radius: inherit; background: var(--dsw-alias-brand-primary); transition: width .3s ease; }
8
8
 
9
- .documentToolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px; border: .5px solid var(--mn-card-line); border-radius: var(--dsw-radius-lg); }
9
+ .documentToolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border: .5px solid var(--mn-card-line); border-radius: var(--dsw-radius-lg); }
10
10
  .documentToolbar form { display: flex; min-width: 260px; flex: 1; align-items: center; gap: 8px; }
11
11
  .documentSearch { flex: 1; }
12
12
  .documentEditor input,
13
13
  .documentEditor textarea { width: 100%; border: .5px solid var(--mn-field-line); border-radius: var(--dsw-radius-md); outline: 0; padding: 6px 10px; color: var(--mn-text); background: var(--mn-input); font-size: 13px; line-height: 20px; }
14
14
  .documentEditor input:focus,
15
15
  .documentEditor textarea:focus { border-color: var(--mn-accent); }
16
- /* Filter, as the DSH SegmentedControl. */
17
- .documentToolbar > div { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--dsw-radius-md); background: var(--mn-hover); }
18
- .documentToolbar > div button { min-height: 28px; border: 0; border-radius: var(--dsw-radius-sm); padding: 0 12px; color: var(--mn-muted); background: transparent; font-size: 13px; font-weight: 500; line-height: 20px; cursor: pointer; }
19
- .documentToolbar > div button:hover { color: var(--mn-text); }
20
- .documentToolbar > div button[data-active] { color: var(--mn-text); background: var(--mn-layer-1); box-shadow: var(--dsw-elevation-soft); }
16
+ /* Filter, matching DSH SegmentedControl sliding indicator mechanics. */
17
+ .documentToolbar > div {
18
+ --dsh-segment-count: 2;
19
+ --dsh-segment-index: 0;
20
+ position: relative;
21
+ display: inline-grid;
22
+ grid-auto-flow: column;
23
+ grid-auto-columns: 1fr;
24
+ align-items: center;
25
+ gap: 2px;
26
+ padding: 4px;
27
+ border-radius: var(--dsw-radius-md);
28
+ background: var(--mn-hover);
29
+ }
30
+ .documentToolbar > div::before {
31
+ content: '';
32
+ position: absolute;
33
+ top: 4px;
34
+ left: 4px;
35
+ width: calc((100% - 8px - 2px * (var(--dsh-segment-count) - 1)) / var(--dsh-segment-count));
36
+ height: calc(100% - 8px);
37
+ border-radius: var(--dsw-radius-sm);
38
+ background: var(--mn-layer-1);
39
+ box-shadow: var(--dsw-elevation-soft);
40
+ transform: translateX(calc(var(--dsh-segment-index) * (100% + 2px)));
41
+ transition: transform 160ms cubic-bezier(.22, 1, .36, 1);
42
+ pointer-events: none;
43
+ }
44
+ .documentToolbar > div button {
45
+ position: relative;
46
+ z-index: 1;
47
+ display: inline-flex;
48
+ height: 28px;
49
+ align-items: center;
50
+ justify-content: center;
51
+ border: 0;
52
+ border-radius: var(--dsw-radius-sm);
53
+ padding: 0 12px;
54
+ color: var(--mn-muted);
55
+ background: transparent;
56
+ font-size: 13px;
57
+ font-weight: 500;
58
+ line-height: 20px;
59
+ white-space: nowrap;
60
+ cursor: pointer;
61
+ transition: color 120ms ease;
62
+ }
63
+ .documentToolbar > div button:hover,
64
+ .documentToolbar > div button[data-active] { color: var(--mn-text); }
65
+ .documentToolbar > div button:focus-visible { outline: var(--dsw-focus-ring-width, 2px) solid var(--mn-focus); outline-offset: -2px; }
21
66
  .documentToolbar > div b { margin-left: 6px; color: var(--mn-faint); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
22
67
 
23
68
  .documentWorkspace { display: grid; min-height: 590px; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); gap: 12px; }
@@ -25,7 +70,7 @@
25
70
  .documentReader { min-width: 0; overflow: hidden; border: .5px solid var(--mn-card-line); border-radius: var(--dsw-radius-lg); }
26
71
  .documentList { align-self: stretch; }
27
72
  .documentList > header { display: flex; min-height: 44px; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: .5px solid var(--mn-line); color: var(--mn-faint); font-size: 12px; line-height: 18px; }
28
- .documentList > header code { color: var(--mn-muted); }
73
+ .documentList > header code { color: var(--mn-muted); font-variant-numeric: tabular-nums; }
29
74
  .documentList > button { --mn-provider-color: var(--mn-faint); display: block; width: calc(100% - 12px); margin: 6px 6px 0; border: 0; border-radius: var(--dsw-radius-md); padding: 10px 12px; color: var(--mn-text); background: transparent; text-align: left; cursor: pointer; transition: background-color .15s; }
30
75
  .documentList > button:hover { background: var(--mn-hover); }
31
76
  .documentList > button[data-selected] { background: var(--mn-fill); }
@@ -33,7 +78,7 @@
33
78
  .documentList > button strong { overflow: hidden; font-size: 13px; font-weight: 500; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }
34
79
  .documentList > button time { flex: 0 0 auto; color: var(--mn-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
35
80
  .documentList > button p { display: -webkit-box; margin: 4px 0 6px; overflow: hidden; color: var(--mn-faint); font-size: 12px; line-height: 18px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
36
- .documentList > button footer { display: flex; align-items: center; gap: 8px; color: var(--mn-faint); font-size: 11px; line-height: 16px; }
81
+ .documentList > button footer { display: flex; align-items: center; gap: 8px; color: var(--mn-faint); font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; }
37
82
  .documentList > button footer code { margin-left: auto; }
38
83
  .documentList > button footer em { color: var(--mn-danger); font-style: normal; }
39
84
  .documentListEmpty { display: grid; min-height: 230px; place-items: center; align-content: center; gap: 4px; padding: 24px; color: var(--mn-muted); text-align: center; }
@@ -42,6 +87,8 @@
42
87
 
43
88
  .documentReader { padding: clamp(16px, 2vw, 24px); }
44
89
  .documentReader > .emptyState { height: 100%; border: 0; background: transparent; }
90
+ .documentReader > .loading { display: flex; height: 100%; min-height: 240px; align-items: center; justify-content: center; gap: 8px; }
91
+ .documentReader > .loading [class*='sectionSpinner'] { position: static; }
45
92
  .documentDetail > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: .5px solid var(--mn-line); }
46
93
  .documentDetail > header span { color: var(--mn-faint); font-size: 12px; line-height: 18px; }
47
94
  .documentDetail > header h3 { margin: 2px 0; font-size: 16px; font-weight: 500; line-height: 24px; }
@@ -51,11 +98,11 @@
51
98
  .documentDetail > dl > div { min-width: 0; padding: 8px 10px; }
52
99
  .documentDetail > dl > div + div { border-left: .5px solid var(--mn-line); }
53
100
  .documentDetail dt { margin-bottom: 2px; color: var(--mn-faint); font-size: 11px; line-height: 16px; }
54
- .documentDetail dd { margin: 0; overflow: hidden; font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
101
+ .documentDetail dd { margin: 0; overflow: hidden; font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
55
102
  .documentSources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; }
56
103
  .documentSources > span { margin-right: 4px; color: var(--mn-faint); font-size: 12px; }
57
104
  .documentSources code,
58
- .documentArchiveReceipt code { padding: 1px 8px; border-radius: 999px; color: var(--mn-muted); background: var(--mn-fill); font-size: 11px; line-height: 17px; }
105
+ .documentArchiveReceipt code { display: inline-flex; max-width: 100%; align-items: center; padding: 1px 8px; border-radius: 999px; color: var(--mn-muted); background: var(--mn-fill); font-size: 11px; line-height: 17px; }
59
106
  .markdownBody { min-height: 310px; margin: 16px 0 0; overflow-wrap: anywhere; padding: clamp(16px, 2.5vw, 28px); border: .5px solid var(--mn-line); border-radius: var(--dsw-radius-md); color: var(--mn-text); font-size: 14px; line-height: 1.75; }
60
107
  .markdownBody > :first-child { margin-top: 0; }
61
108
  .markdownBody > :last-child { margin-bottom: 0; }
@@ -108,6 +155,28 @@
108
155
  .documentEditorMeta label { margin: 0; }
109
156
  .documentEditor footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
110
157
 
158
+ @container mnemon-workbench (max-width: 880px) {
159
+ .documentWorkspace { grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); }
160
+ .documentDetail > dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
161
+ .documentDetail > dl > div + div { border-left: 0; }
162
+ .documentDetail > dl > div:nth-child(even) { border-left: .5px solid var(--mn-line); }
163
+ .documentDetail > dl > div:nth-child(n + 3) { border-top: .5px solid var(--mn-line); }
164
+ }
165
+
166
+ @container mnemon-workbench (max-width: 640px) {
167
+ .documentSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
168
+ .documentCapacity { grid-column: 1 / -1; }
169
+ .documentToolbar { align-items: stretch; flex-direction: column; }
170
+ .documentToolbar form { min-width: 0; }
171
+ .documentToolbar > div,
172
+ .documentToolbar > button { width: 100%; }
173
+ .documentToolbar > div button { flex: 1; }
174
+ .documentWorkspace { min-height: 0; grid-template-columns: 1fr; }
175
+ .documentList { max-height: 330px; overflow: auto; -webkit-overflow-scrolling: touch; }
176
+ .documentReader { min-height: 430px; }
177
+ .documentEditorMeta { grid-template-columns: 1fr; }
178
+ }
179
+
111
180
  @media (max-width: 1000px) {
112
181
  .documentWorkspace { grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); }
113
182
  .documentDetail > dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@@ -143,3 +212,10 @@
143
212
  .documentDetail > dl > div + div { border-top: .5px solid var(--mn-line); }
144
213
  .markdownBody { padding: 16px; font-size: 13px; }
145
214
  }
215
+
216
+ @media (prefers-reduced-motion: reduce) {
217
+ .documentCapacity > div i,
218
+ .documentToolbar > div::before,
219
+ .documentToolbar > div button,
220
+ .documentList > button { transition: none; }
221
+ }
@@ -1,4 +1,24 @@
1
+ .shell .modal {
2
+ display: flex;
3
+ flex-direction: column;
4
+ max-height: min(86vh, 760px);
5
+ max-height: min(86dvh, 760px);
6
+ overflow: hidden;
7
+ }
8
+ .shell .modal > [class*='modalBody'] {
9
+ flex: 1 1 auto;
10
+ min-height: 0;
11
+ overflow-y: auto;
12
+ overscroll-behavior: contain;
13
+ }
14
+ .shell .modal > [class*='modalFooter'] {
15
+ position: relative;
16
+ z-index: 1;
17
+ flex: 0 0 auto;
18
+ background: var(--dsw-alias-bg-layer-2, var(--mn-surface));
19
+ }
1
20
  .shell .modal form[class*='documentEditor'] {
21
+ flex-shrink: 0;
2
22
  margin: 0;
3
23
  padding: 0;
4
24
  border: 0;
@@ -8,8 +28,8 @@
8
28
  .shell .modal form[class*='documentEditor'] > header { display: none; }
9
29
 
10
30
  .shell [class*='documentWorkspace'] {
11
- height: clamp(520px, calc(100dvh - 220px), 760px);
12
- min-height: 520px;
31
+ height: clamp(420px, calc(100dvh - var(--dsh-frame-top-clearance, 0px) - 344px), 720px);
32
+ min-height: 420px;
13
33
  align-items: stretch;
14
34
  }
15
35
  .shell [class*='documentList'],
@@ -20,6 +40,12 @@
20
40
  scrollbar-gutter: stable;
21
41
  }
22
42
 
43
+ @container mnemon-workbench (max-width: 640px) {
44
+ .shell [class*='documentWorkspace'] { height: auto; min-height: 0; }
45
+ .shell [class*='documentList'] { overflow-y: auto; scrollbar-gutter: auto; }
46
+ .shell [class*='documentReader'] { overflow: visible; scrollbar-gutter: auto; }
47
+ }
48
+
23
49
  @media (max-width: 760px) {
24
50
  .shell [class*='documentWorkspace'] { height: auto; min-height: 0; }
25
51
  .shell [class*='documentList'] { overflow-y: auto; scrollbar-gutter: auto; }