@hippo-digital/hippocampus 1.0.0-rc.8 → 2.0.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +141 -3
  2. package/README.md +36 -0
  3. package/agents/README.md +6 -6
  4. package/agents/accessibility-tester.md +2 -2
  5. package/agents/ingestion-curator.md +9 -9
  6. package/agents/knowledge-builder.md +9 -9
  7. package/agents/prototype-builder.md +3 -3
  8. package/agents/screenshot-runner.md +2 -2
  9. package/agents/workflow-orchestrator.md +16 -16
  10. package/assets/dist/hippocampus.css +1 -1
  11. package/assets/hippocampus.scss +994 -133
  12. package/assets/javascript/blueprint.js +21 -0
  13. package/assets/javascript/trace.js +54 -0
  14. package/bin/hippocampus.js +9 -3
  15. package/docs/agent-roadmap.md +2 -2
  16. package/docs/custom-agents-usage.md +1 -1
  17. package/docs/repeatable-research-round-ingestion.md +3 -3
  18. package/docs/research-knowledge-graph.md +5 -5
  19. package/index.js +2 -1
  20. package/lib/breadcrumb.js +80 -0
  21. package/lib/create-router.js +246 -6
  22. package/lib/discover-projects.js +5 -0
  23. package/lib/filter.js +81 -0
  24. package/lib/flow-map.js +214 -0
  25. package/lib/lint-knowledge.js +31 -0
  26. package/lib/load-knowledge.js +335 -34
  27. package/lib/record-links.js +51 -0
  28. package/lib/templates.js +174 -0
  29. package/package.json +1 -1
  30. package/scripts/doctor.js +10 -0
  31. package/scripts/install-skills.js +93 -3
  32. package/scripts/lib/make-blueprint-template.py +107 -0
  33. package/scripts/smoke-routes.js +19 -0
  34. package/scripts/validate-skills.js +64 -5
  35. package/skills/README.md +18 -18
  36. package/skills/SKILL-FORMAT.md +24 -5
  37. package/skills/{add-prototype-screen.skill.md → add-prototype-screen/SKILL.md} +2 -0
  38. package/skills/{add-scenario.skill.md → add-scenario/SKILL.md} +2 -0
  39. package/skills/{add-user-needs.skill.md → add-user-needs/SKILL.md} +2 -0
  40. package/skills/{audit-knowledge-source.skill.md → audit-knowledge-source/SKILL.md} +2 -0
  41. package/skills/{capture-route-review-pack.skill.md → capture-route-review-pack/SKILL.md} +2 -0
  42. package/skills/{create-journey-from-scenario.skill.md → create-journey-from-scenario/SKILL.md} +2 -0
  43. package/skills/{deliver-service-slice.skill.md → deliver-service-slice/SKILL.md} +2 -0
  44. package/skills/examples/README.md +1 -1
  45. package/skills/examples/non-copilot-research-ingestion.md +1 -1
  46. package/skills/examples/non-copilot-service-slice.md +1 -1
  47. package/skills/{generate-service-slice.skill.md → generate-service-slice/SKILL.md} +2 -0
  48. package/skills/{ingest-project-context.skill.md → ingest-project-context/SKILL.md} +2 -0
  49. package/skills/{ingest-research-round.skill.md → ingest-research-round/SKILL.md} +2 -0
  50. package/skills/{ingest-user-personas.skill.md → ingest-user-personas/SKILL.md} +2 -0
  51. package/skills/{map-research-to-graph.skill.md → map-research-to-graph/SKILL.md} +2 -0
  52. package/skills/{onboard-team-member.skill.md → onboard-team-member/SKILL.md} +2 -0
  53. package/skills/{record-accessibility-review.skill.md → record-accessibility-review/SKILL.md} +2 -0
  54. package/skills/{record-design-decision.skill.md → record-design-decision/SKILL.md} +2 -0
  55. package/skills/{review-research-import-draft.skill.md → review-research-import-draft/SKILL.md} +2 -0
  56. package/skills/skills.json +21 -21
  57. package/skills/skills.schema.json +1 -1
  58. package/skills/{structure-project-context-draft.skill.md → structure-project-context-draft/SKILL.md} +2 -0
  59. package/skills/{structure-research-draft.skill.md → structure-research-draft/SKILL.md} +2 -0
  60. package/skills/{triage-research-corpus.skill.md → triage-research-corpus/SKILL.md} +2 -0
  61. package/skills/{write-delivery-summary.skill.md → write-delivery-summary/SKILL.md} +2 -0
  62. package/skills/{write-route-review-summary.skill.md → write-route-review-summary/SKILL.md} +2 -0
  63. package/templates/service-blueprint.xlsx +0 -0
  64. package/views/hippocampus/_layout.html +116 -3
  65. package/views/hippocampus/blueprint-classic.html +0 -1
  66. package/views/hippocampus/blueprint.html +0 -1
  67. package/views/hippocampus/components/_blueprint-cell.njk +6 -3
  68. package/views/hippocampus/components/_blueprint-controls.njk +2 -1
  69. package/views/hippocampus/components/_breadcrumb.njk +29 -0
  70. package/views/hippocampus/components/_connections.njk +38 -0
  71. package/views/hippocampus/components/_filters.njk +56 -0
  72. package/views/hippocampus/components/_journey-step.njk +11 -7
  73. package/views/hippocampus/components/_screen-preview.njk +41 -0
  74. package/views/hippocampus/doc.html +0 -1
  75. package/views/hippocampus/docs.html +67 -6
  76. package/views/hippocampus/evidence-impact.html +66 -33
  77. package/views/hippocampus/graph.html +137 -31
  78. package/views/hippocampus/handover-empty.html +0 -1
  79. package/views/hippocampus/handover.html +0 -1
  80. package/views/hippocampus/index.html +102 -13
  81. package/views/hippocampus/journey-flow.html +0 -1
  82. package/views/hippocampus/journey.html +21 -6
  83. package/views/hippocampus/journeys.html +63 -0
  84. package/views/hippocampus/project.html +19 -2
  85. package/views/hippocampus/record.html +33 -0
  86. package/views/hippocampus/research.html +14 -2
  87. package/views/hippocampus/route-review.html +0 -1
  88. package/views/hippocampus/scenarios.html +21 -3
  89. package/views/hippocampus/screens.html +45 -0
  90. package/views/hippocampus/trace.html +35 -22
  91. package/views/hippocampus/user-needs.html +55 -19
  92. package/views/hippocampus/user.html +131 -79
  93. package/views/hippocampus/users.html +33 -19
@@ -1,4 +1,6 @@
1
1
  ---
2
+ name: record-accessibility-review
3
+ description: "Records a dated accessibility review for changed routes or templates, separating blockers from follow-up improvements. Use after an accessibility pass, or when someone asks to write up accessibility findings."
2
4
  id: record-accessibility-review
3
5
  title: Record accessibility review
4
6
  purpose: Record a dated accessibility review for changed routes or templates.
@@ -1,4 +1,6 @@
1
1
  ---
2
+ name: record-design-decision
3
+ description: "Turns agreed design actions, and the options weighed against them, into decision records. Use when the team has settled on an action from research insights, or when someone asks to record a design decision."
2
4
  id: record-design-decision
3
5
  title: Record design decision
4
6
  purpose: Turn agreed design actions and the options weighed against them into source records.
@@ -1,4 +1,6 @@
1
1
  ---
2
+ name: review-research-import-draft
3
+ description: "Assesses whether a research draft is ready for a human to promote into canonical source. Use before promoting a research import, to find what is unsupported, thin or mislinked."
2
4
  id: review-research-import-draft
3
5
  title: Review research import draft
4
6
  purpose: Assess whether a research draft is ready for human promotion.
@@ -8,7 +8,7 @@
8
8
  "id": "add-prototype-screen",
9
9
  "title": "Add prototype screen",
10
10
  "purpose": "Add a source-backed prototype screen with matching route and view.",
11
- "file": "add-prototype-screen.skill.md",
11
+ "file": "add-prototype-screen/SKILL.md",
12
12
  "owners": [
13
13
  "prototype-builder",
14
14
  "workflow-orchestrator"
@@ -31,7 +31,7 @@
31
31
  "id": "add-scenario",
32
32
  "title": "Add scenario",
33
33
  "purpose": "Add a concrete scenario that links existing users and needs to journey work.",
34
- "file": "add-scenario.skill.md",
34
+ "file": "add-scenario/SKILL.md",
35
35
  "owners": [
36
36
  "knowledge-builder",
37
37
  "workflow-orchestrator"
@@ -53,7 +53,7 @@
53
53
  "id": "add-user-needs",
54
54
  "title": "Add user needs",
55
55
  "purpose": "Add or sharpen traceable need records for an existing user group.",
56
- "file": "add-user-needs.skill.md",
56
+ "file": "add-user-needs/SKILL.md",
57
57
  "owners": [
58
58
  "knowledge-builder",
59
59
  "workflow-orchestrator"
@@ -75,7 +75,7 @@
75
75
  "id": "audit-knowledge-source",
76
76
  "title": "Audit knowledge source",
77
77
  "purpose": "Review traceability, route coverage, and evidence quality before handover.",
78
- "file": "audit-knowledge-source.skill.md",
78
+ "file": "audit-knowledge-source/SKILL.md",
79
79
  "owners": [
80
80
  "knowledge-builder",
81
81
  "workflow-orchestrator"
@@ -98,7 +98,7 @@
98
98
  "id": "capture-route-review-pack",
99
99
  "title": "Capture route review pack",
100
100
  "purpose": "Create a dated screenshot or notes pack for changed routes after smoke testing.",
101
- "file": "capture-route-review-pack.skill.md",
101
+ "file": "capture-route-review-pack/SKILL.md",
102
102
  "owners": [
103
103
  "screenshot-runner",
104
104
  "workflow-orchestrator"
@@ -120,7 +120,7 @@
120
120
  "id": "create-journey-from-scenario",
121
121
  "title": "Create journey from scenario",
122
122
  "purpose": "Turn an existing scenario into a blueprint-ready journey.",
123
- "file": "create-journey-from-scenario.skill.md",
123
+ "file": "create-journey-from-scenario/SKILL.md",
124
124
  "owners": [
125
125
  "knowledge-builder",
126
126
  "workflow-orchestrator"
@@ -142,7 +142,7 @@
142
142
  "id": "deliver-service-slice",
143
143
  "title": "Deliver service slice",
144
144
  "purpose": "Deliver an end-to-end fictional service slice across source data, optional prototype routes/views, audit, and handover.",
145
- "file": "deliver-service-slice.skill.md",
145
+ "file": "deliver-service-slice/SKILL.md",
146
146
  "owners": [
147
147
  "workflow-orchestrator",
148
148
  "knowledge-builder",
@@ -174,7 +174,7 @@
174
174
  "id": "generate-service-slice",
175
175
  "title": "Generate service slice",
176
176
  "purpose": "Create a coherent fictional Hippocampus slice across linked source records.",
177
- "file": "generate-service-slice.skill.md",
177
+ "file": "generate-service-slice/SKILL.md",
178
178
  "owners": [
179
179
  "knowledge-builder",
180
180
  "workflow-orchestrator"
@@ -196,7 +196,7 @@
196
196
  "id": "ingest-project-context",
197
197
  "title": "Ingest project context",
198
198
  "purpose": "Run the no-promote project-context ingestion workflow from inbox artefact to review-ready draft.",
199
- "file": "ingest-project-context.skill.md",
199
+ "file": "ingest-project-context/SKILL.md",
200
200
  "owners": [
201
201
  "ingestion-curator",
202
202
  "workflow-orchestrator"
@@ -222,7 +222,7 @@
222
222
  "id": "ingest-user-personas",
223
223
  "title": "Ingest user personas",
224
224
  "purpose": "Turn persona documents into user records, the needs they state, and the evidence that backs both.",
225
- "file": "ingest-user-personas.skill.md",
225
+ "file": "ingest-user-personas/SKILL.md",
226
226
  "owners": [
227
227
  "ingestion-curator",
228
228
  "knowledge-builder"
@@ -248,7 +248,7 @@
248
248
  "id": "ingest-research-round",
249
249
  "title": "Ingest research round",
250
250
  "purpose": "Run the no-promote research ingestion workflow from inbox artefact to review-ready draft.",
251
- "file": "ingest-research-round.skill.md",
251
+ "file": "ingest-research-round/SKILL.md",
252
252
  "owners": [
253
253
  "ingestion-curator",
254
254
  "workflow-orchestrator"
@@ -276,7 +276,7 @@
276
276
  "id": "map-research-to-graph",
277
277
  "title": "Map research to graph",
278
278
  "purpose": "Add only supported links between a reviewed research draft and existing Hippocampus entities.",
279
- "file": "map-research-to-graph.skill.md",
279
+ "file": "map-research-to-graph/SKILL.md",
280
280
  "owners": [
281
281
  "ingestion-curator",
282
282
  "knowledge-builder",
@@ -299,7 +299,7 @@
299
299
  "id": "record-accessibility-review",
300
300
  "title": "Record accessibility review",
301
301
  "purpose": "Record a dated accessibility review for changed routes or templates.",
302
- "file": "record-accessibility-review.skill.md",
302
+ "file": "record-accessibility-review/SKILL.md",
303
303
  "owners": [
304
304
  "accessibility-tester",
305
305
  "workflow-orchestrator"
@@ -321,7 +321,7 @@
321
321
  "id": "record-design-decision",
322
322
  "title": "Record design decision",
323
323
  "purpose": "Turn agreed design actions and the options weighed against them into source records.",
324
- "file": "record-design-decision.skill.md",
324
+ "file": "record-design-decision/SKILL.md",
325
325
  "owners": [
326
326
  "ingestion-curator",
327
327
  "knowledge-builder"
@@ -345,7 +345,7 @@
345
345
  "id": "review-research-import-draft",
346
346
  "title": "Review research import draft",
347
347
  "purpose": "Assess whether a research draft is ready for human promotion.",
348
- "file": "review-research-import-draft.skill.md",
348
+ "file": "review-research-import-draft/SKILL.md",
349
349
  "owners": [
350
350
  "ingestion-curator",
351
351
  "workflow-orchestrator"
@@ -367,7 +367,7 @@
367
367
  "id": "structure-project-context-draft",
368
368
  "title": "Structure project context draft",
369
369
  "purpose": "Improve a deterministic project-context import draft using extracted source text only.",
370
- "file": "structure-project-context-draft.skill.md",
370
+ "file": "structure-project-context-draft/SKILL.md",
371
371
  "owners": [
372
372
  "ingestion-curator",
373
373
  "workflow-orchestrator"
@@ -390,7 +390,7 @@
390
390
  "id": "structure-research-draft",
391
391
  "title": "Structure research draft",
392
392
  "purpose": "Improve a deterministic research import draft using extracted text only.",
393
- "file": "structure-research-draft.skill.md",
393
+ "file": "structure-research-draft/SKILL.md",
394
394
  "owners": [
395
395
  "ingestion-curator",
396
396
  "workflow-orchestrator"
@@ -413,7 +413,7 @@
413
413
  "id": "triage-research-corpus",
414
414
  "title": "Triage research corpus",
415
415
  "purpose": "Rank a large research folder into ingestion contenders before any artefact is imported.",
416
- "file": "triage-research-corpus.skill.md",
416
+ "file": "triage-research-corpus/SKILL.md",
417
417
  "owners": [
418
418
  "ingestion-curator",
419
419
  "workflow-orchestrator"
@@ -438,7 +438,7 @@
438
438
  "id": "write-delivery-summary",
439
439
  "title": "Write delivery summary",
440
440
  "purpose": "Capture a durable handover note for multi-step Hippocampus work.",
441
- "file": "write-delivery-summary.skill.md",
441
+ "file": "write-delivery-summary/SKILL.md",
442
442
  "owners": [
443
443
  "workflow-orchestrator"
444
444
  ],
@@ -462,7 +462,7 @@
462
462
  "id": "write-route-review-summary",
463
463
  "title": "Write route review summary",
464
464
  "purpose": "Combine smoke, screenshot, and accessibility evidence into one route-review handover note.",
465
- "file": "write-route-review-summary.skill.md",
465
+ "file": "write-route-review-summary/SKILL.md",
466
466
  "owners": [
467
467
  "workflow-orchestrator",
468
468
  "screenshot-runner",
@@ -490,7 +490,7 @@
490
490
  "id": "onboard-team-member",
491
491
  "title": "Onboard a team member",
492
492
  "purpose": "Orient someone new to the project from what the knowledge base already knows, and leave them a dated briefing they can read without an agent.",
493
- "file": "onboard-team-member.skill.md",
493
+ "file": "onboard-team-member/SKILL.md",
494
494
  "owners": [
495
495
  "knowledge-builder",
496
496
  "workflow-orchestrator"
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "file": {
60
60
  "type": "string",
61
- "pattern": "^[^\\0]+\\.skill\\.md$"
61
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*/SKILL\\.md$"
62
62
  },
63
63
  "owners": {
64
64
  "type": "array",
@@ -1,4 +1,6 @@
1
1
  ---
2
+ name: structure-project-context-draft
3
+ description: "Improves a deterministic project-context import draft using only the extracted source text. Use after `hippocampus import project-context`, before human review."
2
4
  id: structure-project-context-draft
3
5
  title: Structure project context draft
4
6
  purpose: Improve a deterministic project-context import draft using extracted source text only.
@@ -1,4 +1,6 @@
1
1
  ---
2
+ name: structure-research-draft
3
+ description: "Improves a script-generated research draft - participants, insights, actions and supported links - using only the extracted text. Use after `hippocampus import research-deck`, before review."
2
4
  id: structure-research-draft
3
5
  title: Structure research draft
4
6
  purpose: Improve a deterministic research import draft using extracted text only.
@@ -1,4 +1,6 @@
1
1
  ---
2
+ name: triage-research-corpus
3
+ description: "Ranks a large folder of research material into ingestion contenders before anything is imported. Use when a shared drive or SharePoint export holds far more than one round's worth and you need to choose what is worth the review effort."
2
4
  id: triage-research-corpus
3
5
  title: Triage research corpus
4
6
  purpose: Rank a large research folder into ingestion contenders before any artefact is imported.
@@ -1,4 +1,6 @@
1
1
  ---
2
+ name: write-delivery-summary
3
+ description: "Captures a durable, dated handover note for multi-step work across source data, views, drafts and artefacts. Use when finishing orchestrated work that someone else will pick up."
2
4
  id: write-delivery-summary
3
5
  title: Write delivery summary
4
6
  purpose: Capture a durable handover note for multi-step Hippocampus work.
@@ -1,4 +1,6 @@
1
1
  ---
2
+ name: write-route-review-summary
3
+ description: "Combines smoke-test, screenshot and accessibility evidence into one route-review handover note. Use when a route or view change has scattered findings that need a single summary."
2
4
  id: write-route-review-summary
3
5
  title: Write route review summary
4
6
  purpose: Combine smoke, screenshot, and accessibility evidence into one route-review handover note.
Binary file
@@ -8,6 +8,7 @@
8
8
  no sass entry point and no stylesheet link to the host project.
9
9
  #}
10
10
  {% extends "prototype-kit-template.njk" %}
11
+ {% from "hippocampus/components/_breadcrumb.njk" import breadcrumb as breadcrumbTrail %}
11
12
 
12
13
  {% block head %}
13
14
  <link href="/nhsuk-frontend/nhsuk-frontend.min.css" rel="stylesheet">
@@ -17,14 +18,112 @@
17
18
  {% block header %}
18
19
  {{ header({
19
20
  service: {
20
- text: serviceName or knowledge.project.name or "Knowledge base",
21
+ text: serviceName or serviceTitle or "Knowledge base",
21
22
  href: basePath
22
23
  }
23
24
  }) }}
24
25
  {% endblock %}
25
26
 
27
+ {#
28
+ A navigation bar on every page.
29
+
30
+ Until now the only way between sections was back to the landing page and out
31
+ again - two clicks and a lost train of thought for every sideways move. The
32
+ current section is marked with aria-current so it is announced, not only
33
+ coloured.
34
+ #}
35
+ {% block main %}
36
+ <nav class="knowledge-nav" aria-label="Knowledge base sections">
37
+ <div class="nhsuk-width-container-fluid knowledge-nav__inner">
38
+ {#
39
+ Which tool you are in, kept on screen at all times.
40
+
41
+ The header names the SERVICE, which is also what the prototype's own
42
+ pages are called - so without this, a page of needs and a patient
43
+ search screen carry the same banner. This says which of the two you are
44
+ looking at, and it rides with the navigation so it never scrolls away.
45
+ #}
46
+ <a class="knowledge-nav__wordmark" href="{{ basePath }}">Knowledge base</a>
47
+ <ul class="knowledge-nav__list">
48
+ {#
49
+ `match` lists the URL prefixes that belong to a section. A detail page
50
+ lives at a different path from its list - a need is /needs/:id while
51
+ the list is /user-needs - so matching on the list's own href alone
52
+ leaves every detail page with nothing marked.
53
+ #}
54
+ {% for item in [
55
+ { href: "", text: "Overview", match: [] },
56
+ { href: "/project", text: "Project", match: ["/project"] },
57
+ { href: "/users", text: "Users", match: ["/users"] },
58
+ { href: "/user-needs", text: "Needs", match: ["/user-needs", "/needs"] },
59
+ { href: "/scenarios", text: "Scenarios", match: ["/scenarios"] },
60
+ { href: "/journeys", text: "Journeys", match: ["/journeys", "/handover"] },
61
+ { href: "/screens", text: "Screens", match: ["/screens"] },
62
+ { href: "/research", text: "Research", match: ["/research", "/insights"] },
63
+ { href: "/graph", text: "Graph", match: ["/graph"] },
64
+ { href: "/trace", text: "Trace", match: ["/trace"] },
65
+ { href: "/docs", text: "Docs", match: ["/docs"] }
66
+ ] %}
67
+ {% set target = basePath + item.href %}
68
+ {% set isCurrent = currentPage == target %}
69
+ {% for prefix in item.match %}
70
+ {% if currentPage == basePath + prefix or currentPage.startsWith(basePath + prefix + "/") %}
71
+ {% set isCurrent = true %}
72
+ {% endif %}
73
+ {% endfor %}
74
+ <li class="knowledge-nav__item">
75
+ <a class="knowledge-nav__link{% if isCurrent %} knowledge-nav__link--current{% endif %}"
76
+ href="{{ target }}"
77
+ {% if isCurrent %}aria-current="page"{% endif %}>{{ item.text }}</a>
78
+ </li>
79
+ {% endfor %}
80
+ </ul>
81
+ </div>
82
+ </nav>
83
+ {{ super() }}
84
+ {% endblock %}
85
+
86
+ {#
87
+ The breadcrumb goes in `beforeContent`, the block the NHS template provides
88
+ just inside the container for exactly this. Putting it here rather than in
89
+ `content` matters: every view overrides `content`, so a breadcrumb placed
90
+ there would be replaced by each page and never render.
91
+
92
+ Rendering it once, centrally, is also the point - the per-page back links it
93
+ replaces were written one at a time and had drifted into saying five
94
+ different things.
95
+
96
+ The locals are called `breadcrumbItems`, not `breadcrumb`, because the kit's
97
+ template-with-imports.njk does `import breadcrumb` at its top level, which
98
+ shadows any context value of that name for every template extending it. A
99
+ `breadcrumb` passed from a route silently arrives here as the NHS macro, and
100
+ the trail renders as nothing at all with no error to explain it.
101
+ #}
102
+ {% block beforeContent %}
103
+ {{ breadcrumbTrail(breadcrumbItems) }}
104
+ {% endblock %}
105
+
106
+ {#
107
+ Integrity belongs in the footer, not on the landing page.
108
+
109
+ A green "validation passed" panel at the top of the home page took the most
110
+ prominent slot on the site to say that nothing was wrong - and only ever said
111
+ it to whoever opened the home page. As a footer line it rides every page, it
112
+ costs no room above the fold, and the date tells you whether the tick is
113
+ about the data you are actually looking at.
114
+
115
+ Failure keeps its callout on the landing page, where the list of what broke
116
+ is; the footer only carries the flag and the way back to it.
117
+ #}
26
118
  {% block footer %}
27
- {{ footer({
119
+ {#
120
+ An empty `copyright` removes the line rather than overriding it. "© NHS
121
+ England" is the macro's default and it is wrong here twice over: these
122
+ pages are a design tool, not an NHS.UK page, and the notice belongs to
123
+ whatever the prototype itself publishes - which is a different footer.
124
+ #}
125
+ {% call footer({
126
+ copyright: "",
28
127
  meta: {
29
128
  items: [
30
129
  {
@@ -37,7 +136,21 @@
37
136
  }
38
137
  ]
39
138
  }
40
- }) }}
139
+ }) %}
140
+ {% if knowledgeValidation.valid %}
141
+ <p class="nhsuk-body-s knowledge-integrity">
142
+ {{ nhsukIcon("tick", { classes: "knowledge-integrity__icon" }) }}
143
+ Knowledge checked{% if knowledgeSourcesUpdated %} · sources updated {{ knowledgeSourcesUpdated }}{% endif %}
144
+ </p>
145
+ {% else %}
146
+ <p class="nhsuk-body-s knowledge-integrity knowledge-integrity--failed">
147
+ <a class="nhsuk-footer__list-item-link" href="{{ basePath }}">
148
+ Knowledge validation failed: {{ knowledgeValidation.errors | length }}
149
+ problem{% if knowledgeValidation.errors | length != 1 %}s{% endif %}
150
+ </a>
151
+ </p>
152
+ {% endif %}
153
+ {% endcall %}
41
154
  {% endblock %}
42
155
 
43
156
  {% block bodyEnd %}
@@ -4,7 +4,6 @@
4
4
  {% block pageTitle %}{{ blueprint.meta.journeyTitle }} matrix{% endblock %}
5
5
 
6
6
  {% block content %}
7
- <a class="nhsuk-back-link" href="{{ basePath }}/journeys/{{ blueprint.journey.id }}/blueprint">Back to stacked blueprint</a>
8
7
  <span class="nhsuk-caption-l">Classic service blueprint</span>
9
8
  <h1>{{ blueprint.meta.journeyTitle }}</h1>
10
9
 
@@ -6,7 +6,6 @@
6
6
  {% block pageTitle %}{{ blueprint.meta.journeyTitle }} blueprint{% endblock %}
7
7
 
8
8
  {% block content %}
9
- <a class="nhsuk-back-link" href="{{ basePath }}/journeys/{{ blueprint.journey.id }}">Back to journey</a>
10
9
  <span class="nhsuk-caption-l">Stacked service blueprint</span>
11
10
  <h1>{{ blueprint.meta.journeyTitle }}</h1>
12
11
  <p class="nhsuk-lede-text">{{ blueprint.meta.scenarioTitle }}</p>
@@ -1,13 +1,16 @@
1
+ {% from "hippocampus/components/_screen-preview.njk" import screenPreview %}
1
2
  {% from "hippocampus/components/_list.njk" import bulletList %}
2
3
 
3
4
  {% macro renderCell(step, laneKey) %}
4
5
  {% if laneKey == "screens" %}
5
6
  {% if step.screens.length %}
6
- <ul class="nhsuk-list">
7
+ {# The screens lane is where a reader is most often trying to picture the
8
+ screen, and a title is the one thing that does not help them do it. #}
9
+ <div class="knowledge-screen-preview-row">
7
10
  {% for screen in step.screens %}
8
- <li><a href="{{ screen.route }}">{{ screen.title }}</a></li>
11
+ {{ screenPreview(screen, "inline") }}
9
12
  {% endfor %}
10
- </ul>
13
+ </div>
11
14
  {% else %}
12
15
  <span class="knowledge-muted">No linked screens</span>
13
16
  {% endif %}
@@ -1,6 +1,7 @@
1
1
  {% macro renderBlueprintControls(lanes) %}
2
2
  <div class="knowledge-blueprint-controls" data-blueprint-controls>
3
- <div class="knowledge-blueprint-controls__lenses" role="group" aria-label="Blueprint lens presets">
3
+ <div class="knowledge-blueprint-controls__lenses" role="group" aria-labelledby="blueprint-lens-legend">
4
+ <p class="knowledge-blueprint-controls__legend" id="blueprint-lens-legend">Show a view for</p>
4
5
  <button type="button" class="knowledge-lens-btn" data-lens="all" aria-pressed="true">All</button>
5
6
  <button type="button" class="knowledge-lens-btn" data-lens="executive" aria-pressed="false">Executive</button>
6
7
  <button type="button" class="knowledge-lens-btn" data-lens="technical" aria-pressed="false">Technical</button>
@@ -0,0 +1,29 @@
1
+ {# The trail, on every page.
2
+
3
+ NHS.UK's own breadcrumb component renders ancestors only and has no crumb
4
+ for the page you are on, so this uses its classes with a final, unlinked
5
+ crumb carrying aria-current. That is the part that answers "where am I",
6
+ which a row of ancestors alone does not. #}
7
+ {# On the overview there is one crumb and it is the page you are on, so the
8
+ trail says nothing a sighted reader cannot see from the h1 below it. It stays
9
+ in the markup rather than being dropped: a screen reader user arriving by
10
+ landmark still gets told where this page sits, and a breadcrumb that exists
11
+ on every page but one is a landmark that disappears without explanation. #}
12
+ {% macro breadcrumb(items) %}
13
+ {% if items.length %}
14
+ {% set soleCrumb = items.length < 2 %}
15
+ <nav class="nhsuk-breadcrumb knowledge-breadcrumb{% if soleCrumb %} knowledge-breadcrumb--quiet nhsuk-u-visually-hidden{% endif %}" aria-label="Breadcrumb">
16
+ <ol class="nhsuk-breadcrumb__list">
17
+ {% for item in items %}
18
+ <li class="nhsuk-breadcrumb__list-item">
19
+ {% if item.href and not loop.last %}
20
+ <a class="nhsuk-breadcrumb__link" href="{{ item.href }}">{{ item.text }}</a>
21
+ {% else %}
22
+ <span aria-current="page">{{ item.text }}</span>
23
+ {% endif %}
24
+ </li>
25
+ {% endfor %}
26
+ </ol>
27
+ </nav>
28
+ {% endif %}
29
+ {% endmacro %}
@@ -0,0 +1,38 @@
1
+ {# The connections panel every detail page shares.
2
+
3
+ Each group says what the relationship means from this record's point of
4
+ view, so a reader knows why a thing is listed rather than inferring it.
5
+ A record type with no page of its own renders as plain text - a dead link
6
+ is worse than an honest one. #}
7
+ {% macro connections(groups) %}
8
+ {% if groups.length %}
9
+ {# A grid rather than fixed halves: a record with one group left half the
10
+ row empty, and one with three wrapped a lone third onto its own line. #}
11
+ <div class="knowledge-card-grid knowledge-card-grid--wide">
12
+ {% for group in groups %}
13
+ <div>
14
+ <section class="knowledge-section nhsuk-u-margin-bottom-0">
15
+ <h2 class="nhsuk-heading-s">{{ group.label }} <span class="nhsuk-u-font-weight-normal nhsuk-u-secondary-text-color">({{ group.items.length }})</span></h2>
16
+ <ul class="nhsuk-list nhsuk-list--bullet knowledge-connection-list">
17
+ {% for item in group.items %}
18
+ <li>
19
+ {% if item.href %}
20
+ <a href="{{ item.href }}">{{ item.label }}</a>
21
+ {% else %}
22
+ {{ item.label }}
23
+ {% endif %}
24
+ <span class="nhsuk-u-secondary-text-color nhsuk-body-s">{{ item.type }}</span>
25
+ </li>
26
+ {% endfor %}
27
+ </ul>
28
+ </section>
29
+ </div>
30
+ {% endfor %}
31
+ </div>
32
+ {% else %}
33
+ <div class="nhsuk-inset-text">
34
+ <p>This record has no connections recorded. That is usually a gap in the
35
+ graph rather than a fact about the record.</p>
36
+ </div>
37
+ {% endif %}
38
+ {% endmacro %}
@@ -0,0 +1,56 @@
1
+ {# The find bar every list page shares.
2
+
3
+ A plain GET form, so it works without JavaScript, the browser remembers it,
4
+ and a filtered list has a URL worth sending to somebody. The result count is
5
+ always shown: with 132 records, "showing 9" is the difference between
6
+ trusting the page and wondering what it is hiding. #}
7
+
8
+ {% macro findBar(action, searchLabel, searchHint, query, facets, shown, total, activeFilters, clearHref) %}
9
+ <form class="knowledge-find" method="get" action="{{ action }}" role="search">
10
+ <div class="nhsuk-form-group nhsuk-u-margin-bottom-3">
11
+ <label class="nhsuk-label" for="find-q">{{ searchLabel }}</label>
12
+ {% if searchHint %}<div class="nhsuk-hint" id="find-q-hint">{{ searchHint }}</div>{% endif %}
13
+ <input class="nhsuk-input" id="find-q" name="q" type="search"
14
+ value="{{ query.q or '' }}"
15
+ {% if searchHint %}aria-describedby="find-q-hint"{% endif %}>
16
+ </div>
17
+
18
+ {% for facet in facets %}
19
+ {% if facet.options.length > 1 %}
20
+ <div class="nhsuk-form-group nhsuk-u-margin-bottom-3">
21
+ <label class="nhsuk-label" for="find-{{ facet.key }}">{{ facet.label }}</label>
22
+ <select class="nhsuk-select" id="find-{{ facet.key }}" name="{{ facet.key }}">
23
+ <option value="">All</option>
24
+ {% for option in facet.options %}
25
+ <option value="{{ option.value }}" {% if option.selected %}selected{% endif %}>
26
+ {{ option.label }} ({{ option.count }})
27
+ </option>
28
+ {% endfor %}
29
+ </select>
30
+ </div>
31
+ {% endif %}
32
+ {% endfor %}
33
+
34
+ <button class="nhsuk-button nhsuk-u-margin-bottom-3" type="submit">Apply</button>
35
+ {% if activeFilters.length %}
36
+ <a class="nhsuk-u-margin-left-3" href="{{ clearHref }}">Clear all</a>
37
+ {% endif %}
38
+ </form>
39
+
40
+ <p class="nhsuk-body-s knowledge-find__count" role="status">
41
+ {% if shown == total %}
42
+ Showing all {{ total }}
43
+ {% else %}
44
+ Showing <strong>{{ shown }}</strong> of {{ total }}
45
+ {% endif %}
46
+ </p>
47
+ {% endmacro %}
48
+
49
+ {# Shown instead of the list when nothing matches. Says what to do next rather
50
+ than only what went wrong. #}
51
+ {% macro noMatches(clearHref, what) %}
52
+ <div class="nhsuk-inset-text">
53
+ <h2 class="nhsuk-heading-s">No {{ what }} match those filters</h2>
54
+ <p>Try fewer words, or <a href="{{ clearHref }}">clear all filters</a>.</p>
55
+ </div>
56
+ {% endmacro %}
@@ -1,15 +1,19 @@
1
+ {% from "hippocampus/components/_screen-preview.njk" import screenPreview %}
1
2
  {% macro journeyStep(step, knowledge) %}
2
3
  <li class="knowledge-timeline__item">
3
4
  <h2 class="nhsuk-heading-m">{{ step.label }}</h2>
4
5
  <p>{{ step.userAction }}</p>
5
6
 
6
- <h3 class="nhsuk-heading-s">Linked screens</h3>
7
- <ul class="nhsuk-list">
8
- {% for screenId in step.screenIds %}
9
- {% set screen = knowledge.index.screens[screenId] %}
10
- <li><a href="{{ screen.route }}">{{ screen.title }}</a></li>
11
- {% endfor %}
12
- </ul>
7
+ {% if step.screenIds.length %}
8
+ {# What the user is actually looking at during this step. #}
9
+ <h3 class="nhsuk-heading-s">Linked screens</h3>
10
+ <div class="knowledge-screen-preview-row">
11
+ {% for screenId in step.screenIds %}
12
+ {% set screen = knowledge.index.screens[screenId] %}
13
+ {% if screen %}{{ screenPreview(screen, "inline") }}{% endif %}
14
+ {% endfor %}
15
+ </div>
16
+ {% endif %}
13
17
 
14
18
  <h3 class="nhsuk-heading-s">User needs</h3>
15
19
  <ul class="nhsuk-list nhsuk-list--bullet">