@astra-spec/ui 0.0.5 → 0.0.7

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 (172) hide show
  1. package/README.md +47 -4
  2. package/blocks.css +1 -0
  3. package/components.css +6 -0
  4. package/dist/blocks/analysis-tree.d.ts.map +1 -1
  5. package/dist/blocks/analysis-tree.js +4 -7
  6. package/dist/blocks/analysis-tree.js.map +1 -1
  7. package/dist/blocks/decisions-list.d.ts.map +1 -1
  8. package/dist/blocks/decisions-list.js +1 -1
  9. package/dist/blocks/decisions-list.js.map +1 -1
  10. package/dist/blocks/findings-list.d.ts.map +1 -1
  11. package/dist/blocks/findings-list.js +2 -4
  12. package/dist/blocks/findings-list.js.map +1 -1
  13. package/dist/blocks/index.d.ts +2 -4
  14. package/dist/blocks/index.d.ts.map +1 -1
  15. package/dist/blocks/index.js +1 -2
  16. package/dist/blocks/index.js.map +1 -1
  17. package/dist/blocks/outputs-list.d.ts +2 -7
  18. package/dist/blocks/outputs-list.d.ts.map +1 -1
  19. package/dist/blocks/outputs-list.js +11 -21
  20. package/dist/blocks/outputs-list.js.map +1 -1
  21. package/dist/blocks/papers-list.d.ts.map +1 -1
  22. package/dist/blocks/papers-list.js +3 -3
  23. package/dist/blocks/papers-list.js.map +1 -1
  24. package/dist/components/figure-zoom.d.ts +6 -0
  25. package/dist/components/figure-zoom.d.ts.map +1 -0
  26. package/dist/components/figure-zoom.js +28 -0
  27. package/dist/components/figure-zoom.js.map +1 -0
  28. package/dist/components/finding-detail.d.ts +4 -2
  29. package/dist/components/finding-detail.d.ts.map +1 -1
  30. package/dist/components/finding-detail.js +41 -25
  31. package/dist/components/finding-detail.js.map +1 -1
  32. package/dist/components/index.d.ts +9 -0
  33. package/dist/components/index.d.ts.map +1 -1
  34. package/dist/components/index.js +5 -0
  35. package/dist/components/index.js.map +1 -1
  36. package/dist/components/insight-trigger.js +2 -2
  37. package/dist/components/insight-trigger.js.map +1 -1
  38. package/dist/components/output-card.d.ts +13 -0
  39. package/dist/components/output-card.d.ts.map +1 -0
  40. package/dist/components/output-card.js +12 -0
  41. package/dist/components/output-card.js.map +1 -0
  42. package/dist/components/output-detail.d.ts +6 -2
  43. package/dist/components/output-detail.d.ts.map +1 -1
  44. package/dist/components/output-detail.js +49 -13
  45. package/dist/components/output-detail.js.map +1 -1
  46. package/dist/components/output-dialog.d.ts +6 -1
  47. package/dist/components/output-dialog.d.ts.map +1 -1
  48. package/dist/components/output-dialog.js +2 -2
  49. package/dist/components/output-dialog.js.map +1 -1
  50. package/dist/components/output-entry.d.ts +17 -0
  51. package/dist/components/output-entry.d.ts.map +1 -0
  52. package/dist/components/output-entry.js +21 -0
  53. package/dist/components/output-entry.js.map +1 -0
  54. package/dist/components/output-provenance.d.ts +6 -0
  55. package/dist/components/output-provenance.d.ts.map +1 -0
  56. package/dist/components/output-provenance.js +16 -0
  57. package/dist/components/output-provenance.js.map +1 -0
  58. package/dist/components/output-status.d.ts +8 -0
  59. package/dist/components/output-status.d.ts.map +1 -0
  60. package/dist/components/output-status.js +17 -0
  61. package/dist/components/output-status.js.map +1 -0
  62. package/dist/components/paper-detail.d.ts.map +1 -1
  63. package/dist/components/paper-detail.js +11 -15
  64. package/dist/components/paper-detail.js.map +1 -1
  65. package/dist/components/paper-row.d.ts +9 -0
  66. package/dist/components/paper-row.d.ts.map +1 -0
  67. package/dist/components/paper-row.js +11 -0
  68. package/dist/components/paper-row.js.map +1 -0
  69. package/dist/components/record-dialog.d.ts +5 -1
  70. package/dist/components/record-dialog.d.ts.map +1 -1
  71. package/dist/components/record-dialog.js +7 -4
  72. package/dist/components/record-dialog.js.map +1 -1
  73. package/dist/lib/labels.d.ts +34 -2
  74. package/dist/lib/labels.d.ts.map +1 -1
  75. package/dist/lib/labels.js +35 -4
  76. package/dist/lib/labels.js.map +1 -1
  77. package/dist/model/index.d.ts +4 -2
  78. package/dist/model/index.d.ts.map +1 -1
  79. package/dist/model/index.js +1 -1
  80. package/dist/model/index.js.map +1 -1
  81. package/dist/model/kind.d.ts +1 -1
  82. package/dist/model/kind.d.ts.map +1 -1
  83. package/dist/model/kind.js +0 -1
  84. package/dist/model/kind.js.map +1 -1
  85. package/dist/model/output-provenance.d.ts +17 -0
  86. package/dist/model/output-provenance.d.ts.map +1 -0
  87. package/dist/model/output-provenance.js +2 -0
  88. package/dist/model/output-provenance.js.map +1 -0
  89. package/dist/model/output-status.d.ts +17 -0
  90. package/dist/model/output-status.d.ts.map +1 -0
  91. package/dist/model/output-status.js +2 -0
  92. package/dist/model/output-status.js.map +1 -0
  93. package/dist/model/relations.d.ts +37 -12
  94. package/dist/model/relations.d.ts.map +1 -1
  95. package/dist/model/relations.js +76 -23
  96. package/dist/model/relations.js.map +1 -1
  97. package/dist/primitives/dialog.d.ts.map +1 -1
  98. package/dist/primitives/dialog.js +9 -1
  99. package/dist/primitives/dialog.js.map +1 -1
  100. package/dist/primitives/index.d.ts +2 -0
  101. package/dist/primitives/index.d.ts.map +1 -1
  102. package/dist/primitives/index.js +1 -0
  103. package/dist/primitives/index.js.map +1 -1
  104. package/dist/primitives/output-status-glyph.d.ts +8 -0
  105. package/dist/primitives/output-status-glyph.d.ts.map +1 -0
  106. package/dist/primitives/output-status-glyph.js +13 -0
  107. package/dist/primitives/output-status-glyph.js.map +1 -0
  108. package/dist/primitives/tooltip.d.ts +7 -0
  109. package/dist/primitives/tooltip.d.ts.map +1 -0
  110. package/dist/primitives/tooltip.js +31 -0
  111. package/dist/primitives/tooltip.js.map +1 -0
  112. package/dist/views/inventory.d.ts +12 -1
  113. package/dist/views/inventory.d.ts.map +1 -1
  114. package/dist/views/inventory.js +23 -17
  115. package/dist/views/inventory.js.map +1 -1
  116. package/package.json +3 -2
  117. package/primitives.css +1 -0
  118. package/src/blocks/analysis-tree.tsx +4 -30
  119. package/src/blocks/decisions-list.tsx +5 -3
  120. package/src/blocks/findings-list.tsx +8 -7
  121. package/src/blocks/index.ts +2 -4
  122. package/src/blocks/outputs-list.tsx +43 -106
  123. package/src/blocks/papers-list.tsx +2 -18
  124. package/src/components/figure-zoom.tsx +72 -0
  125. package/src/components/finding-detail.tsx +106 -30
  126. package/src/components/index.ts +13 -0
  127. package/src/components/insight-trigger.tsx +2 -2
  128. package/src/components/output-card.tsx +51 -0
  129. package/src/components/output-detail.tsx +69 -21
  130. package/src/components/output-dialog.tsx +9 -0
  131. package/src/components/output-entry.tsx +61 -0
  132. package/src/components/output-provenance.tsx +86 -0
  133. package/src/components/output-status.tsx +38 -0
  134. package/src/components/paper-detail.tsx +52 -54
  135. package/src/components/paper-row.tsx +41 -0
  136. package/src/components/record-dialog.tsx +13 -1
  137. package/src/lib/labels.tsx +69 -6
  138. package/src/model/index.ts +6 -2
  139. package/src/model/kind.ts +1 -2
  140. package/src/model/output-provenance.ts +18 -0
  141. package/src/model/output-status.ts +18 -0
  142. package/src/model/relations.ts +92 -26
  143. package/src/primitives/dialog.tsx +7 -1
  144. package/src/primitives/index.ts +2 -0
  145. package/src/primitives/output-status-glyph.tsx +37 -0
  146. package/src/primitives/tooltip.tsx +51 -0
  147. package/src/views/inventory.tsx +54 -22
  148. package/styles/base.css +2 -1
  149. package/styles/blocks/analysis-tree.css +22 -25
  150. package/styles/blocks/findings-list.css +50 -0
  151. package/styles/blocks/outputs-list.css +0 -421
  152. package/styles/blocks/papers-list.css +4 -70
  153. package/styles/components/evidence.css +1 -18
  154. package/styles/components/figure-zoom.css +62 -0
  155. package/styles/components/finding-detail.css +62 -0
  156. package/styles/components/insight-list.css +0 -4
  157. package/styles/components/insight-trigger.css +8 -6
  158. package/styles/components/output-card.css +290 -0
  159. package/styles/components/output-detail.css +91 -3
  160. package/styles/components/output-entry.css +141 -0
  161. package/styles/components/output-provenance.css +94 -0
  162. package/styles/components/output-status.css +31 -0
  163. package/styles/components/paper-detail.css +112 -59
  164. package/styles/components/paper-row.css +72 -0
  165. package/styles/primitives/dialog.css +4 -22
  166. package/styles/primitives/tooltip.css +22 -0
  167. package/styles/views/inventory.css +35 -2
  168. package/dist/blocks/prior-insights-list.d.ts +0 -9
  169. package/dist/blocks/prior-insights-list.d.ts.map +0 -1
  170. package/dist/blocks/prior-insights-list.js +0 -29
  171. package/dist/blocks/prior-insights-list.js.map +0 -1
  172. package/src/blocks/prior-insights-list.tsx +0 -52
@@ -0,0 +1,37 @@
1
+ import { forwardRef, type SVGAttributes } from 'react';
2
+ import type { OutputStatus } from '../model/output-status.js';
3
+
4
+ export interface OutputStatusGlyphProps extends SVGAttributes<SVGSVGElement> {
5
+ state: OutputStatus['state'];
6
+ }
7
+
8
+ /** One 16×16 glyph per state, so every surface that draws a status draws the same mark. */
9
+ const paths: Record<OutputStatus['state'], string> = {
10
+ current: 'm3.5 8 3 3 6-6',
11
+ behind: 'M12.5 5A5 5 0 1 0 13 9M12.5 1.5V5H9',
12
+ stale: 'm4.5 4.5 7 7m0-7-7 7',
13
+ };
14
+
15
+ /** Decorative execution-state mark; the surface around it supplies colour and the accessible name. */
16
+ export const OutputStatusGlyph = forwardRef<SVGSVGElement, OutputStatusGlyphProps>(function OutputStatusGlyph({
17
+ state, ...props
18
+ }, ref) {
19
+ return (
20
+ <svg
21
+ data-slot="output-status-glyph"
22
+ width="14"
23
+ height="14"
24
+ viewBox="0 0 16 16"
25
+ fill="none"
26
+ stroke="currentColor"
27
+ strokeWidth="1.5"
28
+ aria-hidden="true"
29
+ focusable="false"
30
+ {...props}
31
+ ref={ref}
32
+ data-state={state}
33
+ >
34
+ <path d={paths[state]} strokeLinecap="round" strokeLinejoin="round" />
35
+ </svg>
36
+ );
37
+ });
@@ -0,0 +1,51 @@
1
+ /* eslint-disable react-hooks/refs, @typescript-eslint/unbound-method -- Floating UI uses callback refs during render. */
2
+ import {
3
+ FloatingPortal, autoUpdate, flip, offset, shift,
4
+ useDismiss, useFloating, useFocus, useHover, useInteractions, useRole,
5
+ } from '@floating-ui/react';
6
+ import { useCallback, useState, type ReactElement } from 'react';
7
+ import { Slot } from './slot.js';
8
+
9
+ /** A small, non-interactive explanation. Preserves the trigger's tab order. */
10
+ export function Tooltip({ children, content }: { children: ReactElement; content: string }) {
11
+ const [open, setOpen] = useState(false);
12
+ const [portalRoot, setPortalRoot] = useState<HTMLElement | null>(null);
13
+ const { refs, floatingStyles, context } = useFloating({
14
+ open,
15
+ onOpenChange: setOpen,
16
+ placement: 'top',
17
+ strategy: 'fixed',
18
+ whileElementsMounted: autoUpdate,
19
+ middleware: [offset(6), flip({ padding: 8 }), shift({ padding: 8 })],
20
+ });
21
+ const hover = useHover(context, { move: false, delay: { open: 150, close: 100 } });
22
+ const focus = useFocus(context);
23
+ const dismiss = useDismiss(context);
24
+ const role = useRole(context, { role: 'tooltip' });
25
+ const { getReferenceProps, getFloatingProps } = useInteractions([hover, focus, dismiss, role]);
26
+ const setFloatingReference = refs.setReference;
27
+ // Preserve host theme tokens and native-dialog stacking, outside clipped previews.
28
+ const setReference = useCallback((element: HTMLElement | null) => {
29
+ setFloatingReference(element);
30
+ setPortalRoot(element?.closest<HTMLElement>('dialog, .astra-ui') ?? null);
31
+ }, [setFloatingReference]);
32
+ return (
33
+ <>
34
+ <Slot ref={setReference} {...getReferenceProps()}>{children}</Slot>
35
+ {open ? (
36
+ <FloatingPortal root={portalRoot ?? undefined}>
37
+ <div className={portalRoot ? undefined : 'astra-ui'}>
38
+ <div
39
+ {...getFloatingProps()}
40
+ ref={refs.setFloating}
41
+ style={floatingStyles}
42
+ className="astra-tooltip"
43
+ >
44
+ {content}
45
+ </div>
46
+ </div>
47
+ </FloatingPortal>
48
+ ) : null}
49
+ </>
50
+ );
51
+ }
@@ -6,42 +6,53 @@ import {
6
6
  type ResolvedOutput,
7
7
  type ResolvedRecord,
8
8
  } from '@astra-spec/sdk';
9
- import { forwardRef, useEffect, useMemo, useRef, type HTMLAttributes, type ReactNode } from 'react';
9
+ import { forwardRef, useEffect, useMemo, useRef, useState, type HTMLAttributes, type ReactNode } from 'react';
10
10
  import { collectInventoryPapers, findPaper, paperForDoi, type InventoryPaper, type InventoryPaperMetadataMap } from '../model/papers.js';
11
11
  import { locateRecord } from '../model/locate-record.js';
12
12
  import { cn } from '../lib/cn.js';
13
13
  import { LabelsProvider, useLabels, type AstraLabelOverrides } from '../lib/labels.js';
14
14
  import type { OpenPaperFileHandler } from '../components/paper-detail.js';
15
15
  import type { PdfJsLoader } from '../lib/pdf-runtime.js';
16
+ import type { OutputStatusLookup } from '../model/output-status.js';
16
17
  import { RecordDialog } from '../components/record-dialog.js';
17
18
  import { useDetailStack, type DetailEntry } from '../lib/detail-stack.js';
18
19
  import type { ArtifactRenderer } from '../components/artifact-preview.js';
19
20
  import { DialogProvider, type DialogMode } from '../primitives/dialog.js';
20
21
  import type { TextRenderer } from '../lib/prose.js';
21
22
  import { DecisionsList } from '../blocks/decisions-list.js';
23
+ import { AnalysisTree } from '../blocks/analysis-tree.js';
22
24
  import { FindingsList } from '../blocks/findings-list.js';
23
25
  import { InputsList } from '../blocks/inputs-list.js';
24
26
  import { OutputsList } from '../blocks/outputs-list.js';
25
27
  import { PapersList } from '../blocks/papers-list.js';
26
- import { PriorInsightsList } from '../blocks/prior-insights-list.js';
27
28
  import { InventoryOutline, InventorySection } from '../blocks/section.js';
28
29
  import { sectionKind, type InventorySectionId } from '../model/kind.js';
29
30
 
30
- export const DEFAULT_SECTIONS: readonly InventorySectionId[] = ['outputs', 'decisions', 'inputs', 'findings', 'prior_insights', 'papers'];
31
+ export const DEFAULT_SECTIONS: readonly InventorySectionId[] = ['outputs', 'decisions', 'inputs', 'findings', 'papers'];
31
32
 
32
33
  export interface InventoryProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
33
34
  document: ResolvedAnalysisDocument;
34
35
  /** Pass a prebuilt index to share it with the host; otherwise one is derived from `document`. */
35
36
  index?: AnalysisIndex | undefined;
36
- /** Canonical analysis path; `$` selects the project root. A path the document does not contain shows the root. */
37
+ /** Controlled analysis selection; pair with `onSelectAnalysis`. Omit to let Inventory navigate internally. Unknown paths show the root. */
37
38
  analysisPath?: string | undefined;
39
+ /** Observe navigation, or update `analysisPath` when controlling selection. */
40
+ onSelectAnalysis?: ((canonicalPath: string) => void) | undefined;
38
41
  /** Which sections to show, in order. */
39
42
  sections?: readonly InventorySectionId[] | undefined;
40
43
  /** Prefix for section anchor ids, so several explorers can share a page. */
41
44
  idPrefix?: string | undefined;
42
45
  showOutline?: boolean | undefined;
46
+ /** Show project navigation below the outline (default true). Hosts controlling `analysisPath` must pair it with `onSelectAnalysis`. */
47
+ showHierarchy?: boolean | undefined;
43
48
  labels?: AstraLabelOverrides | undefined;
44
49
  renderArtifact?: ArtifactRenderer | undefined;
50
+ /** Host renderer for recorded output provenance, shown below Recipe. */
51
+ renderProvenance?: ((output: ResolvedOutput) => ReactNode) | undefined;
52
+ /** Optional execution status, keyed by the host to the selected universe. */
53
+ getOutputStatus?: OutputStatusLookup | undefined;
54
+ /** Host-provided link to the current code file, shown beside Recipe. */
55
+ renderCodeLink?: ((output: ResolvedOutput) => ReactNode) | undefined;
45
56
  renderText?: TextRenderer | undefined;
46
57
  loadPdfJs?: PdfJsLoader | undefined;
47
58
  onOpenPaperFile?: OpenPaperFileHandler | undefined;
@@ -83,11 +94,16 @@ export const Inventory = forwardRef<HTMLDivElement, InventoryProps>(function Inv
83
94
  const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(function ExplorerBody({
84
95
  document,
85
96
  index: providedIndex,
86
- analysisPath = '$',
97
+ analysisPath,
98
+ onSelectAnalysis,
87
99
  sections = DEFAULT_SECTIONS,
88
100
  idPrefix = '',
89
101
  showOutline = true,
102
+ showHierarchy = true,
90
103
  renderArtifact,
104
+ renderProvenance,
105
+ getOutputStatus,
106
+ renderCodeLink,
91
107
  renderText,
92
108
  loadPdfJs,
93
109
  onOpenPaperFile,
@@ -105,7 +121,16 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
105
121
  }, ref) {
106
122
  const labels = useLabels();
107
123
  const index = useMemo(() => providedIndex ?? indexAnalysis(document), [document, providedIndex]);
108
- const analysis = index.analysisByPath.get(analysisPath) ?? document.analysis;
124
+ const [internalAnalysisPath, setInternalAnalysisPath] = useState('$');
125
+ // Reset a removed selection so reintroducing that path does not navigate back.
126
+ if (analysisPath === undefined && internalAnalysisPath !== '$' && !index.analysisByPath.has(internalAnalysisPath)) {
127
+ setInternalAnalysisPath('$');
128
+ }
129
+ const analysis = index.analysisByPath.get(analysisPath ?? internalAnalysisPath) ?? document.analysis;
130
+ const selectAnalysis = (path: string) => {
131
+ if (analysisPath === undefined) setInternalAnalysisPath(path);
132
+ onSelectAnalysis?.(path);
133
+ };
109
134
  const papers = useMemo(
110
135
  () => collectInventoryPapers(document, index, analysis, paperMetadata),
111
136
  [analysis, document, index, paperMetadata],
@@ -141,7 +166,7 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
141
166
  const sectionContent: Record<InventorySectionId, { count: number; content: ReactNode }> = {
142
167
  outputs: {
143
168
  count: analysis.outputs.length,
144
- content: <OutputsList analysis={analysis} renderArtifact={renderArtifact} onOpenRecord={openRecord} />,
169
+ content: <OutputsList analysis={analysis} getOutputStatus={getOutputStatus} renderArtifact={renderArtifact} onOpenRecord={openRecord} />,
145
170
  },
146
171
  decisions: {
147
172
  count: analysis.decisions.length,
@@ -155,10 +180,6 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
155
180
  count: analysis.findings.length,
156
181
  content: <FindingsList analysis={analysis} onOpenRecord={openRecord} />,
157
182
  },
158
- prior_insights: {
159
- count: analysis.prior_insights.length,
160
- content: <PriorInsightsList analysis={analysis} onOpenRecord={openRecord} />,
161
- },
162
183
  papers: {
163
184
  count: papers.length,
164
185
  content: (
@@ -170,11 +191,11 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
170
191
  ),
171
192
  },
172
193
  };
173
- const anchorId = (section: InventorySectionId) => `${idPrefix}${section.replace('_', '-')}`;
194
+ const anchorId = (section: InventorySectionId) => `${idPrefix}${section}`;
174
195
 
175
196
  return (
176
197
  <div data-slot="inventory" {...rest} ref={ref} className={cn('astra-inventory', className)}>
177
- <div className="astra-inventory__layout">
198
+ <div className="astra-inventory__layout" data-sidebar={showOutline || showHierarchy ? '' : undefined}>
178
199
  <div className="astra-inventory__sections">
179
200
  {sections.map((section) => (
180
201
  <InventorySection
@@ -190,15 +211,24 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
190
211
  ))}
191
212
  {children}
192
213
  </div>
193
- {showOutline ? (
194
- <InventoryOutline
195
- entries={sections.map((section) => ({
196
- id: anchorId(section),
197
- label: labels.sections[section],
198
- count: sectionContent[section].count,
199
- kind: sectionKind(section),
200
- }))}
201
- />
214
+ {showOutline || showHierarchy ? (
215
+ <div className="astra-inventory__sidebar" data-has-tree={showHierarchy ? '' : undefined}>
216
+ {showOutline ? <InventoryOutline
217
+ entries={sections.map((section) => ({
218
+ id: anchorId(section),
219
+ label: labels.sections[section],
220
+ count: sectionContent[section].count,
221
+ kind: sectionKind(section),
222
+ }))}
223
+ /> : null}
224
+ {showHierarchy ? (
225
+ <AnalysisTree
226
+ document={document}
227
+ analysisPath={analysis.canonicalPath}
228
+ onSelectAnalysis={selectAnalysis}
229
+ />
230
+ ) : null}
231
+ </div>
202
232
  ) : null}
203
233
  </div>
204
234
  {stack.active ? (
@@ -211,6 +241,8 @@ const ExplorerBody = forwardRef<HTMLDivElement, Omit<InventoryProps, 'labels'>>(
211
241
  papers={papers}
212
242
  paperMetadata={paperMetadata}
213
243
  renderArtifact={renderArtifact}
244
+ renderProvenance={renderProvenance}
245
+ renderCodeLink={renderCodeLink}
214
246
  renderText={renderText}
215
247
  loadPdfJs={loadPdfJs}
216
248
  onOpenPaperFile={onOpenPaperFile}
package/styles/base.css CHANGED
@@ -37,7 +37,8 @@
37
37
 
38
38
  @media print {
39
39
  :where(.astra-ui) .astra-dialog:not([data-mode="embedded"]),
40
- :where(.astra-ui) .astra-inventory-outline {
40
+ :where(.astra-ui) .astra-inventory-outline,
41
+ :where(.astra-ui) .astra-inventory__sidebar {
41
42
  display: none;
42
43
  }
43
44
 
@@ -2,7 +2,6 @@
2
2
  @layer astra.tokens, astra.base, astra.components, astra.views;
3
3
  @layer astra.views {
4
4
  :where(.astra-ui) .astra-analysis-tree {
5
- overflow: visible;
6
5
  font-family: var(--astra-font-ui);
7
6
  }
8
7
 
@@ -21,44 +20,42 @@
21
20
  list-style: none;
22
21
  }
23
22
 
24
- :where(.astra-ui) .astra-analysis-tree button {
25
- display: flex;
23
+ :where(.astra-ui) .astra-analysis-tree ul ul {
24
+ margin-inline-start: 20px;
25
+ }
26
+
27
+ /* Indent four levels at most, so deep projects keep room for their labels. */
28
+ :where(.astra-ui) .astra-analysis-tree ul ul ul ul ul ul {
29
+ margin-inline-start: 0;
30
+ }
31
+
32
+ :where(.astra-ui) .astra-analysis-tree__select {
33
+ display: block;
26
34
  width: 100%;
27
- align-items: center;
28
- gap: 8px;
35
+ min-width: 0;
36
+ padding: 7px 0;
29
37
  cursor: pointer;
30
38
  border: 0;
31
- border-radius: 4px;
39
+ border-radius: 0;
32
40
  background: transparent;
33
- color: var(--astra-color-text-muted);
34
- padding: 6px 8px;
41
+ color: var(--astra-color-text-subtle);
35
42
  font: inherit;
36
43
  font-size: var(--astra-font-size-sm);
37
- line-height: 1.3;
44
+ line-height: 1.4;
38
45
  text-align: start;
39
46
  }
40
47
 
41
- :where(.astra-ui) .astra-analysis-tree button svg {
42
- flex: 0 0 auto;
43
- color: var(--astra-color-kind-analysis);
44
- }
45
-
46
- :where(.astra-ui) .astra-analysis-tree button span {
48
+ :where(.astra-ui) .astra-analysis-tree__select span {
47
49
  min-width: 0;
48
- overflow: hidden;
49
- text-overflow: ellipsis;
50
- white-space: nowrap;
50
+ overflow-wrap: anywhere;
51
51
  }
52
52
 
53
- :where(.astra-ui) .astra-analysis-tree button:hover,
54
- :where(.astra-ui) .astra-analysis-tree button:focus-visible {
55
- background: var(--astra-color-surface-muted);
56
- color: var(--astra-color-text);
53
+ :where(.astra-ui) .astra-analysis-tree__select:where([aria-current="page"]) {
54
+ font-weight: 700;
57
55
  }
58
56
 
59
- :where(.astra-ui) .astra-analysis-tree button[aria-current="page"] {
60
- background: var(--astra-color-kind-analysis-soft);
57
+ :where(.astra-ui) .astra-analysis-tree__select:hover,
58
+ :where(.astra-ui) .astra-analysis-tree__select:focus-visible {
61
59
  color: var(--astra-color-text);
62
- font-weight: 700;
63
60
  }
64
61
  }
@@ -0,0 +1,50 @@
1
+ /* findings-list — emitted by src/blocks/findings-list.tsx */
2
+ @layer astra.tokens, astra.base, astra.components, astra.views;
3
+ @layer astra.views {
4
+ /* A finding is a sentence, not a name: the row gives it the width to be
5
+ read, and hangs its identity and evidence count underneath. */
6
+ :where(.astra-ui) .astra-findings-list__entry {
7
+ align-items: start;
8
+ }
9
+
10
+ :where(.astra-ui) .astra-findings-list__copy {
11
+ display: grid;
12
+ min-width: 0;
13
+ gap: 5px;
14
+ }
15
+
16
+ :where(.astra-ui) .astra-findings-list__entry .astra-findings-list__claim {
17
+ overflow: visible;
18
+ color: var(--astra-color-text);
19
+ font: 400 var(--astra-font-size-sm)/1.45 var(--astra-font-body);
20
+ text-overflow: clip;
21
+ white-space: normal;
22
+ }
23
+
24
+ :where(.astra-ui) .astra-findings-list__meta {
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+ align-items: baseline;
28
+ gap: 4px 10px;
29
+ color: var(--astra-color-text-subtle);
30
+ font: 400 var(--astra-font-size-2xs)/1.3 var(--astra-font-ui);
31
+ }
32
+
33
+ :where(.astra-ui) .astra-findings-list__entry .astra-findings-list__name {
34
+ overflow: visible;
35
+ color: var(--astra-color-kind-finding);
36
+ font-family: var(--astra-font-mono);
37
+ text-overflow: clip;
38
+ white-space: normal;
39
+ }
40
+
41
+ /* The evidence count now belongs to the metadata line, not a fixed column. */
42
+ :where(.astra-ui) .astra-findings-list__meta .astra-record-list__count {
43
+ overflow: visible;
44
+ color: inherit;
45
+ font: inherit;
46
+ text-overflow: clip;
47
+ white-space: normal;
48
+ }
49
+
50
+ }