@purview-dev/pm-docs-site 0.1.0-pre.1 → 0.1.0-pre.3
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/README.md +130 -18
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +91 -0
- package/dist/dev-env.d.ts +2 -0
- package/dist/dev-env.js +13 -0
- package/dist/fs-allow.d.ts +2 -0
- package/dist/fs-allow.js +11 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +152 -0
- package/dist/options.d.ts +5 -0
- package/dist/options.js +46 -0
- package/dist/repo-docs.d.ts +33 -0
- package/dist/repo-docs.js +94 -0
- package/dist/schema-version.d.ts +27 -0
- package/dist/schema-version.js +48 -0
- package/dist/sidebar.d.ts +10 -0
- package/dist/sidebar.js +32 -0
- package/dist/site-options.d.ts +9 -0
- package/dist/site-options.js +44 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.js +4 -0
- package/lib/{repo-docs.mjs → repo-docs.ts} +22 -46
- package/lib/schema-version.ts +59 -0
- package/{index.d.ts → lib/types.ts} +5 -6
- package/package.json +19 -9
- package/src/components/FeatureSummary.astro +30 -9
- package/src/components/FeatureTable.astro +1 -1
- package/src/components/ItemDetail.astro +1 -1
- package/src/components/ItemDialog.astro +12 -8
- package/src/components/PlanInteractions.astro +15 -3
- package/src/components/RefLink.astro +7 -4
- package/src/components/board/Board.tsx +252 -0
- package/src/components/board/KanbanItemCard.tsx +131 -0
- package/src/components/board/LinkRuns.tsx +21 -0
- package/src/components/board/TaskKanbanCard.tsx +83 -0
- package/src/components/board/useBoardUrlState.ts +41 -0
- package/src/components/decisions/Decisions.tsx +162 -0
- package/src/components/decisions/useDecisionsUrlState.ts +29 -0
- package/src/components/graph/Graph.tsx +290 -0
- package/src/components/graph/GraphNodes.tsx +120 -0
- package/src/components/graph/useGraphUrlState.ts +58 -0
- package/src/components/lib/KanbanItemCard.astro +7 -11
- package/src/components/lib/StatusTimelineFeed.astro +3 -2
- package/src/components/lib/TaskKanbanCard.astro +2 -1
- package/src/components/timeline/Timeline.tsx +192 -0
- package/src/components/timeline/useTimelineLayout.ts +39 -0
- package/src/content.config.ts +22 -6
- package/src/env.d.ts +2 -2
- package/src/lib/board-data.ts +84 -0
- package/src/lib/board.ts +209 -0
- package/src/lib/decisions.ts +100 -0
- package/src/lib/graph-layout.ts +270 -0
- package/src/lib/graph-state.ts +99 -0
- package/src/lib/graph.ts +194 -0
- package/src/lib/link-html.ts +39 -0
- package/src/lib/planning-types.ts +32 -3
- package/src/lib/planning.ts +94 -52
- package/src/lib/ref-boundary.ts +19 -0
- package/src/lib/references.ts +67 -8
- package/src/lib/timeline-state.ts +119 -0
- package/src/lib/timeline.ts +51 -0
- package/src/loaders/adrs.ts +43 -0
- package/src/loaders/repo-docs.ts +3 -3
- package/src/pages/404.astro +18 -0
- package/src/pages/index.astro +1 -1
- package/src/pages/plan/board.astro +14 -113
- package/src/pages/plan/log.astro +18 -1
- package/src/pages/plan/roadmap.astro +21 -3
- package/src/routes/plan/decisions/[id].astro +93 -0
- package/src/routes/plan/decisions.astro +52 -0
- package/src/routes/plan/graph.astro +80 -0
- package/src/routes/plan/milestones/index.astro +2 -2
- package/src/routes/plan/now.astro +2 -3
- package/src/scripts/plan.ts +32 -46
- package/src/styles/components.css +244 -13
- package/src/styles/graph.css +296 -0
- package/src/styles/kanban.css +277 -0
- package/src/styles/timeline.css +210 -0
- package/cli.mjs +0 -120
- package/index.mjs +0 -97
- package/lib/options.mjs +0 -67
- package/lib/schema-version.mjs +0 -29
- package/lib/sidebar.mjs +0 -47
- package/lib/site-options.mjs +0 -38
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
// One ADR from planning.json's `adrs`: its status, header fields, and its four
|
|
3
|
+
// sections rendered from Markdown (src/loaders/adrs.ts), with the IDs in them
|
|
4
|
+
// linked, and what links to it.
|
|
5
|
+
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
|
|
6
|
+
import { getCollection } from 'astro:content';
|
|
7
|
+
|
|
8
|
+
import ExportStamp from '../../../components/ExportStamp.astro';
|
|
9
|
+
import LinkedFrom from '../../../components/LinkedFrom.astro';
|
|
10
|
+
import LinkedText from '../../../components/LinkedText.astro';
|
|
11
|
+
import RefLink from '../../../components/RefLink.astro';
|
|
12
|
+
import { linkHtml } from '../../../lib/link-html';
|
|
13
|
+
import { loadPlanning } from '../../../lib/planning';
|
|
14
|
+
import { siteRefs } from '../../../lib/references';
|
|
15
|
+
import { ADR_SECTIONS, type RenderedAdr } from '../../../loaders/adrs';
|
|
16
|
+
import '../../../styles/components.css';
|
|
17
|
+
|
|
18
|
+
export async function getStaticPaths() {
|
|
19
|
+
// An empty collection is never looked up: Astro warns that it does not exist.
|
|
20
|
+
if (loadPlanning().adrs.length === 0) return [];
|
|
21
|
+
|
|
22
|
+
const entries = await getCollection('adrs');
|
|
23
|
+
|
|
24
|
+
return entries.map((entry: { id: string; data: unknown }) => ({ params: { id: entry.id }, props: { adr: entry.data as RenderedAdr } }));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const { adr } = Astro.props as { adr: RenderedAdr };
|
|
28
|
+
const { known } = siteRefs();
|
|
29
|
+
const status = adr.status ?? 'unknown';
|
|
30
|
+
const refs: { label: string; ref: string | null }[] = [
|
|
31
|
+
{ label: 'Item', ref: adr.item },
|
|
32
|
+
{ label: 'Supersedes', ref: adr.supersedes },
|
|
33
|
+
{ label: 'Superseded by', ref: adr.supersededBy },
|
|
34
|
+
];
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
<StarlightPage
|
|
38
|
+
frontmatter={{ title: `${adr.id} ${adr.title}`, description: `${status} decision${adr.category ? `, ${adr.category}` : ''}.`, tableOfContents: false }}
|
|
39
|
+
>
|
|
40
|
+
<ExportStamp kind="ADR" state={status} />
|
|
41
|
+
|
|
42
|
+
<p>
|
|
43
|
+
<span class={`adr-status adr-status--${status}`}>{status}</span>
|
|
44
|
+
{' '}
|
|
45
|
+
<a href="/plan/decisions/">All decisions</a>
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
<dl class="plan-facts">
|
|
49
|
+
{adr.date && (
|
|
50
|
+
<div>
|
|
51
|
+
<dt>Date</dt>
|
|
52
|
+
<dd>{adr.date}</dd>
|
|
53
|
+
</div>
|
|
54
|
+
)}
|
|
55
|
+
{adr.category && (
|
|
56
|
+
<div>
|
|
57
|
+
<dt>Category</dt>
|
|
58
|
+
<dd>{adr.category}</dd>
|
|
59
|
+
</div>
|
|
60
|
+
)}
|
|
61
|
+
{
|
|
62
|
+
refs
|
|
63
|
+
.filter((entry) => entry.ref)
|
|
64
|
+
.map((entry) => (
|
|
65
|
+
<div>
|
|
66
|
+
<dt>{entry.label}</dt>
|
|
67
|
+
<dd>
|
|
68
|
+
<RefLink ref={entry.ref} />
|
|
69
|
+
</dd>
|
|
70
|
+
</div>
|
|
71
|
+
))
|
|
72
|
+
}
|
|
73
|
+
{adr.source && (
|
|
74
|
+
<div>
|
|
75
|
+
<dt>Source</dt>
|
|
76
|
+
<dd>
|
|
77
|
+
<LinkedText text={adr.source} />
|
|
78
|
+
</dd>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</dl>
|
|
82
|
+
|
|
83
|
+
{
|
|
84
|
+
ADR_SECTIONS.filter(({ key }) => adr.html[key] !== null).map(({ key, label }) => (
|
|
85
|
+
<section>
|
|
86
|
+
<h2>{label}</h2>
|
|
87
|
+
{adr.html[key] === '' ? <p>None recorded.</p> : <Fragment set:html={linkHtml(adr.html[key]!, known)} />}
|
|
88
|
+
</section>
|
|
89
|
+
))
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
<LinkedFrom ref={adr.id} />
|
|
93
|
+
</StarlightPage>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The architecture decision records from planning.json's `adrs`, as a
|
|
3
|
+
// server-rendered React island (src/components/decisions/Decisions.tsx) that
|
|
4
|
+
// searches, filters by status and category, and groups them. Every ADR is in
|
|
5
|
+
// the HTML; the filters only hide rows, so the default view (superseded hidden)
|
|
6
|
+
// still links every ADR page.
|
|
7
|
+
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
|
|
8
|
+
|
|
9
|
+
import Decisions, { type DecisionRow } from '../../components/decisions/Decisions';
|
|
10
|
+
import ExportStamp from '../../components/ExportStamp.astro';
|
|
11
|
+
import { adrSearchText } from '../../lib/decisions';
|
|
12
|
+
import { adrHref, loadPlanning } from '../../lib/planning';
|
|
13
|
+
import { siteRefs } from '../../lib/references';
|
|
14
|
+
import '../../styles/components.css';
|
|
15
|
+
|
|
16
|
+
const planning = loadPlanning();
|
|
17
|
+
const { known } = siteRefs();
|
|
18
|
+
const named = (ref: string | null) => {
|
|
19
|
+
if (!ref) return null;
|
|
20
|
+
const target = known.get(ref);
|
|
21
|
+
|
|
22
|
+
return { label: target?.label ?? ref, href: target?.href ?? null };
|
|
23
|
+
};
|
|
24
|
+
const rows: DecisionRow[] = planning.adrs.map((adr) => ({
|
|
25
|
+
id: adr.id,
|
|
26
|
+
title: adr.title,
|
|
27
|
+
status: adr.status,
|
|
28
|
+
category: adr.category,
|
|
29
|
+
date: adr.date,
|
|
30
|
+
href: adrHref(adr.id),
|
|
31
|
+
text: adrSearchText(adr),
|
|
32
|
+
item: named(adr.item),
|
|
33
|
+
successor: named(adr.supersededBy),
|
|
34
|
+
}));
|
|
35
|
+
const categories = [...new Set(planning.adrs.map((adr) => adr.category).filter((category): category is string => !!category))].sort();
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<StarlightPage
|
|
39
|
+
frontmatter={{ title: 'Decisions', description: 'The architecture decision records: search, filter, and group them.', tableOfContents: false }}
|
|
40
|
+
>
|
|
41
|
+
<ExportStamp />
|
|
42
|
+
|
|
43
|
+
{
|
|
44
|
+
rows.length === 0 ? (
|
|
45
|
+
<p class="plan-empty">No ADRs yet. Record one with pm-adr new.</p>
|
|
46
|
+
) : (
|
|
47
|
+
<div data-pagefind-ignore>
|
|
48
|
+
<Decisions client:load rows={rows} categories={categories} />
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
</StarlightPage>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The dependency graph: open items and their Depends on and Revisits links,
|
|
3
|
+
// grouped by milestone, then the same links as a plain Dependencies list for
|
|
4
|
+
// search, screen readers, and pages without JavaScript. The graph's four
|
|
5
|
+
// layouts are computed here, at build time (graph-layout.ts imports dagre,
|
|
6
|
+
// which must never reach the browser); the island (Graph.tsx) only picks one.
|
|
7
|
+
// Its inline script runs as the page is parsed, before the graph paints: a
|
|
8
|
+
// `?lanes=off` or `?done=off` link hides the graph until the island has
|
|
9
|
+
// rendered that layout and deleted the mark (useGraphUrlState.ts), so it never
|
|
10
|
+
// flashes the default layout first. graph.css reveals the graph after 3s if
|
|
11
|
+
// the island never loads. It must stay in step with parseGraphQuery in
|
|
12
|
+
// src/lib/graph-state.ts.
|
|
13
|
+
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
|
|
14
|
+
import '@xyflow/react/dist/style.css';
|
|
15
|
+
|
|
16
|
+
import ExportStamp from '../../components/ExportStamp.astro';
|
|
17
|
+
import Graph from '../../components/graph/Graph';
|
|
18
|
+
import { dependencyRows, graphData } from '../../lib/graph';
|
|
19
|
+
import type { Ref } from '../../lib/graph';
|
|
20
|
+
import { graphLayouts } from '../../lib/graph-layout';
|
|
21
|
+
import { loadPlanning } from '../../lib/planning';
|
|
22
|
+
import { siteRefs } from '../../lib/references';
|
|
23
|
+
import '../../styles/components.css';
|
|
24
|
+
import '../../styles/graph.css';
|
|
25
|
+
|
|
26
|
+
const { known } = siteRefs();
|
|
27
|
+
const planning = loadPlanning();
|
|
28
|
+
const data = graphData(planning, known);
|
|
29
|
+
const layouts = graphLayouts(data, planning);
|
|
30
|
+
const rows = dependencyRows(data);
|
|
31
|
+
// The milestone pages the lane labels and the item meta lines link to (references.ts lists the Graph in their Linked from).
|
|
32
|
+
const milestoneKeys = new Set([...Object.values(layouts).flatMap((layout) => layout.lanes.map((lane) => lane.key)), ...data.nodes.flatMap((node) => (node.milestone ? [node.milestone] : []))]);
|
|
33
|
+
const milestoneHrefs = Object.fromEntries([...milestoneKeys].flatMap((key) => (known.get(key)?.href ? [[key, known.get(key)!.href!]] : [])));
|
|
34
|
+
|
|
35
|
+
/** A row's link lines, in order, with the empty ones left out. */
|
|
36
|
+
const lines = (row: (typeof rows)[number]): { label: string; refs: Ref[] }[] =>
|
|
37
|
+
[
|
|
38
|
+
{ label: 'Waits on', refs: row.waitsOn },
|
|
39
|
+
{ label: 'Waited on by', refs: row.waitedOnBy },
|
|
40
|
+
{ label: 'Revisits', refs: row.revisits ? [row.revisits] : [] },
|
|
41
|
+
{ label: 'Revised by', refs: row.revisedBy },
|
|
42
|
+
].filter((line) => line.refs.length > 0);
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
<StarlightPage frontmatter={{ title: 'Graph', description: 'Open items and their Depends on and Revisits links, by milestone.', tableOfContents: false }}>
|
|
46
|
+
<ExportStamp />
|
|
47
|
+
|
|
48
|
+
<script is:inline>
|
|
49
|
+
(function (params) {
|
|
50
|
+
if (params.get('lanes') === 'off' || params.get('done') === 'off') document.documentElement.dataset.graphPending = '';
|
|
51
|
+
})(new URLSearchParams(location.search));
|
|
52
|
+
</script>
|
|
53
|
+
{data.nodes.length > 0 ? <Graph client:load nodes={data.nodes} edges={data.edges} layouts={layouts} milestoneHrefs={milestoneHrefs} /> : <p class="plan-empty">No open items</p>}
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
rows.length > 0 && (
|
|
57
|
+
<>
|
|
58
|
+
<h2>Dependencies</h2>
|
|
59
|
+
<ul class="plan-deps">
|
|
60
|
+
{rows.map((row) => (
|
|
61
|
+
<li>
|
|
62
|
+
<p>{row.href ? <a href={row.href}>{`${row.id} ${row.title}`}</a> : `${row.id} ${row.title}`}</p>
|
|
63
|
+
{lines(row).map((line) => (
|
|
64
|
+
<p class="plan-deps__links">
|
|
65
|
+
{line.label}:{' '}
|
|
66
|
+
{line.refs.map((ref, index) => (
|
|
67
|
+
<>
|
|
68
|
+
{index > 0 && ', '}
|
|
69
|
+
{ref.href ? <a href={ref.href}>{ref.label}</a> : ref.label}
|
|
70
|
+
</>
|
|
71
|
+
))}
|
|
72
|
+
</p>
|
|
73
|
+
))}
|
|
74
|
+
</li>
|
|
75
|
+
))}
|
|
76
|
+
</ul>
|
|
77
|
+
</>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
</StarlightPage>
|
|
@@ -6,11 +6,11 @@ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
|
|
|
6
6
|
import ExportStamp from '../../../components/ExportStamp.astro';
|
|
7
7
|
import LinkedText from '../../../components/LinkedText.astro';
|
|
8
8
|
import RefLink from '../../../components/RefLink.astro';
|
|
9
|
-
import { FEATURE_STATES, loadPlanning,
|
|
9
|
+
import { FEATURE_STATES, loadPlanning, milestoneCards, type FeatureState } from '../../../lib/planning';
|
|
10
10
|
import '../../../styles/components.css';
|
|
11
11
|
|
|
12
12
|
const planning = loadPlanning();
|
|
13
|
-
const summaries =
|
|
13
|
+
const summaries = milestoneCards(planning);
|
|
14
14
|
const states = Object.keys(FEATURE_STATES) as FeatureState[];
|
|
15
15
|
const byState = (summary: (typeof summaries)[number]) =>
|
|
16
16
|
states
|
|
@@ -13,8 +13,7 @@ import '../../styles/components.css';
|
|
|
13
13
|
|
|
14
14
|
const planning = loadPlanning();
|
|
15
15
|
const { now, plan } = planning;
|
|
16
|
-
const
|
|
17
|
-
const priority = ({ low: 'low', medium: 'med', high: 'high' } as const)[sizeToPriority(card?.size ?? null)];
|
|
16
|
+
const priority = ({ low: 'low', medium: 'med', high: 'high' } as const)[sizeToPriority(now.item?.size ?? null)];
|
|
18
17
|
|
|
19
18
|
const paths = [
|
|
20
19
|
{ label: 'Brief', path: now.brief },
|
|
@@ -121,7 +120,7 @@ const checkpoint = now.checkpoint
|
|
|
121
120
|
<TaskKanbanCard
|
|
122
121
|
task={`Task ${task.number}: ${task.title}`}
|
|
123
122
|
date={`${task.checked}/${task.total} steps`}
|
|
124
|
-
assigneeInitials={initials(
|
|
123
|
+
assigneeInitials={initials(now.item?.owner ?? null)}
|
|
125
124
|
priority={priority}
|
|
126
125
|
progress={planProgress(task)}
|
|
127
126
|
/>
|
package/src/scripts/plan.ts
CHANGED
|
@@ -1,38 +1,18 @@
|
|
|
1
1
|
// The Board and Roadmap in the browser: a plain click on a card opens its item
|
|
2
|
-
// popup (any other click is the browser's)
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function writeCollapsed(names: Set<string>): void {
|
|
19
|
-
try {
|
|
20
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify([...names]));
|
|
21
|
-
} catch {
|
|
22
|
-
// No storage (private mode, a blocked origin): the state lasts until the page closes.
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function applyCollapsed(names: Set<string>): void {
|
|
27
|
-
document.documentElement.dataset.boardCollapsed = [...names].join(' ');
|
|
28
|
-
|
|
29
|
-
for (const column of document.querySelectorAll<HTMLElement>('[data-column]')) {
|
|
30
|
-
const collapsed = names.has(column.dataset.column ?? '');
|
|
31
|
-
|
|
32
|
-
column.toggleAttribute('data-collapsed', collapsed);
|
|
33
|
-
column.querySelector('.plan-column__toggle')?.setAttribute('aria-expanded', String(!collapsed));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
2
|
+
// popup (any other click is the browser's). Without this script every card is
|
|
3
|
+
// a link. A click on the dialog element itself (the backdrop; its content
|
|
4
|
+
// sits in `.plan-dialog__frame`, never directly in the dialog) closes the
|
|
5
|
+
// popup. The Board's column collapse lives in its island
|
|
6
|
+
// (src/components/board/Board.tsx).
|
|
7
|
+
//
|
|
8
|
+
// When a mousedown and the matching mouseup land on different elements (a
|
|
9
|
+
// drag, or a text selection released past the dialog's edge), the browser
|
|
10
|
+
// retargets the synthesised `click` event to their nearest common ancestor,
|
|
11
|
+
// which is the dialog itself whenever either end was the backdrop. So a
|
|
12
|
+
// click's own target cannot tell a genuine backdrop click from a drag that
|
|
13
|
+
// merely started or ended there: `pointerdown` and `pointerup` are not
|
|
14
|
+
// retargeted, so this records both separately and closes only when neither
|
|
15
|
+
// end of the gesture left the backdrop.
|
|
36
16
|
|
|
37
17
|
function openItem(link: HTMLAnchorElement): void {
|
|
38
18
|
const dialog = document.querySelector<HTMLDialogElement>('dialog[data-item-dialog]');
|
|
@@ -50,10 +30,22 @@ function openItem(link: HTMLAnchorElement): void {
|
|
|
50
30
|
dialog.showModal();
|
|
51
31
|
}
|
|
52
32
|
|
|
33
|
+
/** True for the dialog element itself (the backdrop), never its frame. */
|
|
34
|
+
function isDialogBackdrop(target: EventTarget | null): target is HTMLDialogElement {
|
|
35
|
+
return target instanceof HTMLDialogElement && target.matches('dialog[data-item-dialog]');
|
|
36
|
+
}
|
|
37
|
+
|
|
53
38
|
function start(): void {
|
|
54
|
-
|
|
39
|
+
let pointerDownOnBackdrop = false;
|
|
40
|
+
let pointerUpOnBackdrop = false;
|
|
55
41
|
|
|
56
|
-
|
|
42
|
+
document.addEventListener('pointerdown', (event) => {
|
|
43
|
+
pointerDownOnBackdrop = isDialogBackdrop(event.target);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
document.addEventListener('pointerup', (event) => {
|
|
47
|
+
pointerUpOnBackdrop = isDialogBackdrop(event.target);
|
|
48
|
+
});
|
|
57
49
|
|
|
58
50
|
document.addEventListener('click', (event) => {
|
|
59
51
|
const target = event.target as Element | null;
|
|
@@ -66,19 +58,13 @@ function start(): void {
|
|
|
66
58
|
return;
|
|
67
59
|
}
|
|
68
60
|
|
|
69
|
-
if (target
|
|
70
|
-
target.
|
|
61
|
+
if (isDialogBackdrop(target) && pointerDownOnBackdrop && pointerUpOnBackdrop) {
|
|
62
|
+
target.close();
|
|
71
63
|
return;
|
|
72
64
|
}
|
|
73
65
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (name) {
|
|
78
|
-
if (collapsed.has(name)) collapsed.delete(name);
|
|
79
|
-
else collapsed.add(name);
|
|
80
|
-
writeCollapsed(collapsed);
|
|
81
|
-
applyCollapsed(collapsed);
|
|
66
|
+
if (target?.closest('[data-item-dialog-close]')) {
|
|
67
|
+
target.closest('dialog')?.close();
|
|
82
68
|
}
|
|
83
69
|
});
|
|
84
70
|
}
|
|
@@ -15,18 +15,124 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/* A kanban board: always one row of five columns, scrolling sideways when the
|
|
18
|
-
page is narrower than the board, never wrapping a column onto a new line.
|
|
18
|
+
page is narrower than the board, never wrapping a column onto a new line.
|
|
19
|
+
The Board island (src/components/board/Board.tsx) puts the filter bar, the
|
|
20
|
+
five column headers, and every lane's five cells in this one grid, so a
|
|
21
|
+
lane's cells sit under their headers and a collapsed column is narrow in
|
|
22
|
+
every row. */
|
|
19
23
|
.plan-columns {
|
|
20
24
|
--plan-open: minmax(11rem, 1fr);
|
|
21
25
|
--plan-shut: 3rem;
|
|
22
26
|
display: grid;
|
|
23
27
|
grid-template-columns: var(--col-now, var(--plan-open)) var(--col-next, var(--plan-open)) var(--col-foryou, var(--plan-open)) var(--col-waiting, var(--plan-open)) var(--col-done, var(--plan-open));
|
|
24
|
-
gap: 1rem;
|
|
25
|
-
align-items:
|
|
28
|
+
column-gap: 1rem;
|
|
29
|
+
align-items: stretch;
|
|
26
30
|
overflow-x: auto;
|
|
27
31
|
padding-bottom: 0.5rem;
|
|
28
32
|
}
|
|
29
33
|
|
|
34
|
+
/* The filter bar spans the board; it stays hidden until the island hydrates. */
|
|
35
|
+
.plan-board__filters {
|
|
36
|
+
grid-column: 1 / -1;
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
align-items: end;
|
|
40
|
+
gap: 0.75rem 1rem;
|
|
41
|
+
margin-bottom: 1rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.plan-board__filters[hidden] {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.plan-board__filter {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 0.25rem;
|
|
52
|
+
font-size: var(--sl-text-sm);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.plan-board__filter select,
|
|
56
|
+
.plan-board__clear {
|
|
57
|
+
font: inherit;
|
|
58
|
+
font-size: var(--sl-text-sm);
|
|
59
|
+
padding: 0.3rem 0.5rem;
|
|
60
|
+
border: 1px solid var(--sl-color-hairline);
|
|
61
|
+
border-radius: 6px;
|
|
62
|
+
background: var(--sl-color-bg);
|
|
63
|
+
color: var(--sl-color-text);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.plan-board__clear {
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.plan-board__clear:disabled {
|
|
71
|
+
cursor: default;
|
|
72
|
+
opacity: 0.5;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* The header row and the lanes. It adds no box, so its children stay items of
|
|
76
|
+
the board's grid. While <html> has the pending mark (a board key in the URL,
|
|
77
|
+
PlanInteractions.astro) it is hidden, until the island has rendered that
|
|
78
|
+
state, so a filtered link never shows the unfiltered board. If the island
|
|
79
|
+
never loads and so never clears the mark, the board shows anyway after 3s,
|
|
80
|
+
unfiltered: never a blank board. */
|
|
81
|
+
.plan-board__body {
|
|
82
|
+
display: contents;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:root[data-board-pending] .plan-board__body {
|
|
86
|
+
visibility: hidden;
|
|
87
|
+
animation: plan-board-reveal 0s 3s forwards;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@keyframes plan-board-reveal {
|
|
91
|
+
to {
|
|
92
|
+
visibility: visible;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* A lane is a row of the board's grid: a header across every column, then one cell per column. */
|
|
97
|
+
.plan-lane {
|
|
98
|
+
display: contents;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.plan-lane__header {
|
|
102
|
+
grid-column: 1 / -1;
|
|
103
|
+
display: flex;
|
|
104
|
+
gap: 0.5rem;
|
|
105
|
+
margin-top: 1rem;
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.plan-lane__count {
|
|
110
|
+
color: var(--sl-color-gray-3);
|
|
111
|
+
font-weight: 400;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.plan-lane > .plan-column__cards {
|
|
115
|
+
margin-top: 0.5rem;
|
|
116
|
+
padding: 0.75rem;
|
|
117
|
+
border: 1px solid var(--sl-color-hairline);
|
|
118
|
+
border-radius: 12px;
|
|
119
|
+
background: var(--sl-color-bg);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Ungrouped, a column's header and its cards cell read as one column. The
|
|
123
|
+
doubled class outranks `.plan-column`, which is declared below. */
|
|
124
|
+
.plan-column.plan-column--joined {
|
|
125
|
+
border-bottom: 0;
|
|
126
|
+
border-radius: 12px 12px 0 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.plan-lane[data-lane='all'] > .plan-column__cards {
|
|
130
|
+
margin-top: 0;
|
|
131
|
+
padding-top: 0;
|
|
132
|
+
border-top: 0;
|
|
133
|
+
border-radius: 0 0 12px 12px;
|
|
134
|
+
}
|
|
135
|
+
|
|
30
136
|
.plan-column {
|
|
31
137
|
display: flex;
|
|
32
138
|
flex-direction: column;
|
|
@@ -56,17 +162,22 @@
|
|
|
56
162
|
justify-content: space-between;
|
|
57
163
|
gap: 0.5rem;
|
|
58
164
|
width: 100%;
|
|
59
|
-
cursor: pointer;
|
|
60
165
|
border-radius: 6px;
|
|
61
166
|
}
|
|
62
167
|
|
|
63
|
-
|
|
168
|
+
/* Only the hydrated button is clickable; the pre-hydration static span (plan-column__toggle--static) shares its layout but never looks interactive. */
|
|
169
|
+
button.plan-column__toggle {
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
button.plan-column__toggle:focus-visible {
|
|
64
174
|
outline: 2px solid var(--sl-color-accent);
|
|
65
175
|
outline-offset: 2px;
|
|
66
176
|
}
|
|
67
177
|
|
|
68
|
-
/* A collapsed column (
|
|
69
|
-
|
|
178
|
+
/* A collapsed column (the root attribute, set before paint by
|
|
179
|
+
PlanInteractions.astro and kept by the Board island) is a narrow strip with
|
|
180
|
+
its name and count written down it, and its cards hidden in every lane. */
|
|
70
181
|
:root[data-board-collapsed~='now'] .plan-columns {
|
|
71
182
|
--col-now: var(--plan-shut);
|
|
72
183
|
}
|
|
@@ -96,11 +207,21 @@
|
|
|
96
207
|
min-width: 0;
|
|
97
208
|
}
|
|
98
209
|
|
|
99
|
-
:root[data-board-collapsed~='now'] [data-column='now']
|
|
100
|
-
:root[data-board-collapsed~='next'] [data-column='next']
|
|
101
|
-
:root[data-board-collapsed~='foryou'] [data-column='foryou']
|
|
102
|
-
:root[data-board-collapsed~='waiting'] [data-column='waiting']
|
|
103
|
-
:root[data-board-collapsed~='done'] [data-column='done']
|
|
210
|
+
:root[data-board-collapsed~='now'] [data-lane-column='now'],
|
|
211
|
+
:root[data-board-collapsed~='next'] [data-lane-column='next'],
|
|
212
|
+
:root[data-board-collapsed~='foryou'] [data-lane-column='foryou'],
|
|
213
|
+
:root[data-board-collapsed~='waiting'] [data-lane-column='waiting'],
|
|
214
|
+
:root[data-board-collapsed~='done'] [data-lane-column='done'] {
|
|
215
|
+
padding-left: 0.25rem;
|
|
216
|
+
padding-right: 0.25rem;
|
|
217
|
+
min-width: 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:root[data-board-collapsed~='now'] [data-lane-column='now'] > *,
|
|
221
|
+
:root[data-board-collapsed~='next'] [data-lane-column='next'] > *,
|
|
222
|
+
:root[data-board-collapsed~='foryou'] [data-lane-column='foryou'] > *,
|
|
223
|
+
:root[data-board-collapsed~='waiting'] [data-lane-column='waiting'] > *,
|
|
224
|
+
:root[data-board-collapsed~='done'] [data-lane-column='done'] > * {
|
|
104
225
|
display: none;
|
|
105
226
|
}
|
|
106
227
|
|
|
@@ -143,17 +264,36 @@
|
|
|
143
264
|
.plan-dialog {
|
|
144
265
|
width: min(42rem, calc(100vw - 2rem));
|
|
145
266
|
max-height: calc(100vh - 4rem);
|
|
146
|
-
padding:
|
|
267
|
+
padding: 0;
|
|
147
268
|
border: 1px solid var(--sl-color-hairline);
|
|
148
269
|
border-radius: 12px;
|
|
149
270
|
background: var(--sl-color-bg);
|
|
150
271
|
color: var(--sl-color-text);
|
|
272
|
+
/* Not the default `auto`: with the rounded corners above, a browser clips
|
|
273
|
+
a child's hit box out of the corners, so a click just inside an edge
|
|
274
|
+
would miss .plan-dialog__frame and land on this element (the backdrop
|
|
275
|
+
click target in src/scripts/plan.ts) instead. The frame scrolls itself. */
|
|
276
|
+
overflow: visible;
|
|
151
277
|
}
|
|
152
278
|
|
|
153
279
|
.plan-dialog::backdrop {
|
|
154
280
|
background: rgb(0 0 0 / 0.45);
|
|
155
281
|
}
|
|
156
282
|
|
|
283
|
+
/* Fills the dialog's box, so only a click on the dialog element itself (the
|
|
284
|
+
backdrop, never this frame) closes the popup (src/scripts/plan.ts). Not
|
|
285
|
+
rounded, so it scrolls long content itself without the parent's corner
|
|
286
|
+
clipping taking its hit box away (see .plan-dialog's overflow above).
|
|
287
|
+
max-height is not `inherit`: that copies .plan-dialog's own max-height
|
|
288
|
+
value, which bounds its border box, not its content box; with the 1px
|
|
289
|
+
border on each side, inheriting it would let the frame (and its
|
|
290
|
+
scrollbar) run 2px past the dialog's border. */
|
|
291
|
+
.plan-dialog__frame {
|
|
292
|
+
padding: 1.25rem 1.5rem;
|
|
293
|
+
max-height: calc(100vh - 4rem - 2px);
|
|
294
|
+
overflow: auto;
|
|
295
|
+
}
|
|
296
|
+
|
|
157
297
|
.plan-dialog__head {
|
|
158
298
|
display: flex;
|
|
159
299
|
justify-content: space-between;
|
|
@@ -372,3 +512,94 @@
|
|
|
372
512
|
.plan-card p {
|
|
373
513
|
margin: 0.35rem 0 0;
|
|
374
514
|
}
|
|
515
|
+
|
|
516
|
+
/* An ADR's status (Decisions view and ADR pages): the word is always printed. */
|
|
517
|
+
.adr-status {
|
|
518
|
+
display: inline-block;
|
|
519
|
+
padding: 0.1rem 0.45rem;
|
|
520
|
+
border-radius: 4px;
|
|
521
|
+
border: 1px solid var(--sl-color-hairline);
|
|
522
|
+
font-size: var(--sl-text-xs);
|
|
523
|
+
font-weight: 600;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.adr-status--accepted {
|
|
527
|
+
color: #15803d;
|
|
528
|
+
background: #22c55e1a;
|
|
529
|
+
border-color: #22c55e66;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.adr-status--proposed {
|
|
533
|
+
color: #1d4ed8;
|
|
534
|
+
background: #3b82f61a;
|
|
535
|
+
border-color: #3b82f666;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.adr-status--superseded,
|
|
539
|
+
.adr-status--deprecated,
|
|
540
|
+
.adr-status--unknown {
|
|
541
|
+
color: var(--sl-color-gray-3);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/* The Decisions view: search, chips, grouping, and the rows. */
|
|
545
|
+
.decisions-controls {
|
|
546
|
+
display: flex;
|
|
547
|
+
flex-wrap: wrap;
|
|
548
|
+
gap: 0.75rem;
|
|
549
|
+
align-items: end;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.decisions-search,
|
|
553
|
+
.decisions-group {
|
|
554
|
+
display: flex;
|
|
555
|
+
flex-direction: column;
|
|
556
|
+
gap: 0.25rem;
|
|
557
|
+
font-size: var(--sl-text-sm);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.decisions-chips {
|
|
561
|
+
display: flex;
|
|
562
|
+
flex-wrap: wrap;
|
|
563
|
+
gap: 0.35rem;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.decisions-chip,
|
|
567
|
+
.decisions-clear {
|
|
568
|
+
padding: 0.2rem 0.6rem;
|
|
569
|
+
border: 1px solid var(--sl-color-hairline-shade);
|
|
570
|
+
border-radius: 999px;
|
|
571
|
+
background: transparent;
|
|
572
|
+
color: inherit;
|
|
573
|
+
font-size: var(--sl-text-sm);
|
|
574
|
+
cursor: pointer;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.decisions-chip[aria-pressed='true'] {
|
|
578
|
+
background: var(--sl-color-accent-low);
|
|
579
|
+
border-color: var(--sl-color-accent);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.decisions-clear:disabled {
|
|
583
|
+
opacity: 0.5;
|
|
584
|
+
cursor: default;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.decisions-count,
|
|
588
|
+
.decisions-meta,
|
|
589
|
+
.decisions-empty {
|
|
590
|
+
color: var(--sl-color-gray-3);
|
|
591
|
+
font-size: var(--sl-text-sm);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.decisions-list {
|
|
595
|
+
list-style: none;
|
|
596
|
+
padding-inline-start: 0;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.decisions-meta {
|
|
600
|
+
display: block;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.decisions [hidden] {
|
|
604
|
+
display: none;
|
|
605
|
+
}
|