diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index ddba2d4..4c0638a 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -19,9 +19,9 @@ permissions: jobs: preview: - uses: LightconeResearch/astra-ui/.github/workflows/preview.yml@9c940ebd65c0d25c46f9dbc83c27c8635aa3eda2 + uses: LightconeResearch/astra-ui/.github/workflows/preview.yml@6248ae0bf1ca7b4ee45de52f0b9839c0e0d1d4e6 with: - ui: 9c940ebd65c0d25c46f9dbc83c27c8635aa3eda2 + ui: 6248ae0bf1ca7b4ee45de52f0b9839c0e0d1d4e6 theme: ${{ github.event.pull_request.head.sha }} secrets: VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 676d74a..7df3f58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -148,13 +148,14 @@ "link": true }, "node_modules/@astra-spec/ui": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@astra-spec/ui/-/ui-0.0.5.tgz", - "integrity": "sha512-6G7xY92rOM1yXb1EuSzSFj7MVsNZsbOz7EZlvn67XhxumlYl21orh52B8KRfPe8nfMbDRl5kL+MBQoRtbIOzXA==", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@astra-spec/ui/-/ui-0.0.6.tgz", + "integrity": "sha512-zrm7fPU7zo+XbUhZ5wiSllZinz4RPfEjPD7lp02AM9jXI+bPKAWa5ECQVv1DBM5mFuj+Av8RCmAXcpfUsBRWtA==", "license": "BSD-3-Clause", "dependencies": { "@floating-ui/react": "^0.27.20", - "katex": "^0.16.47" + "katex": "^0.16.47", + "react-zoom-pan-pinch": "^4.2.0" }, "engines": { "node": ">=20" @@ -24811,6 +24812,20 @@ "react": ">= 0.14.0" } }, + "node_modules/react-zoom-pan-pinch": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/react-zoom-pan-pinch/-/react-zoom-pan-pinch-4.2.0.tgz", + "integrity": "sha512-QSw1dvr6QGv5zHCUY7SEIY7EWRDbx1y6plylrWf2Nko9KOMW1MEoPC6oJ+Y/qOSeQjhvbkMV0m5bFF7pBxCH4A==", + "license": "MIT", + "engines": { + "node": ">=8", + "npm": ">=5" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -29966,7 +29981,7 @@ "license": "BSD-3-Clause", "dependencies": { "@astra-spec/sdk": "^0.1.2", - "@astra-spec/ui": "0.0.5", + "@astra-spec/ui": "0.0.6", "@lightcone-research/brand": "0.0.3", "@myst-theme/providers": "^1.3.1", "myst-common": "^1.8.1", diff --git a/packages/astra/package.json b/packages/astra/package.json index 8f32ef1..b1e6393 100644 --- a/packages/astra/package.json +++ b/packages/astra/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@astra-spec/sdk": "^0.1.2", - "@astra-spec/ui": "0.0.5", + "@astra-spec/ui": "0.0.6", "@lightcone-research/brand": "0.0.3", "@myst-theme/providers": "^1.3.1", "myst-common": "^1.8.1", diff --git a/packages/astra/src/inventory.tsx b/packages/astra/src/inventory.tsx index 947a1d1..5d86fd4 100644 --- a/packages/astra/src/inventory.tsx +++ b/packages/astra/src/inventory.tsx @@ -68,6 +68,9 @@ export function AstraInventory({ document={publication.document} index={publication.index} analysisPath={publication.activeAnalysis.canonicalPath} + // The page already fixes which analysis is read; sub-analyses are + // reached through their own pages, not by switching the inventory. + showHierarchy={false} idPrefix="astra-inventory-" /> diff --git a/packages/astra/styles/astra.css b/packages/astra/styles/astra.css index 9c0241e..ef20b55 100644 --- a/packages/astra/styles/astra.css +++ b/packages/astra/styles/astra.css @@ -109,10 +109,12 @@ /* Citation previews use the shared floating tree so pointer travel remains coordinated with their parent record card. Their inner document keeps the - stock MyST bibliography appearance; this only makes the shared shell inert. */ + stock MyST bibliography appearance; this only makes the shared shell inert. + The card portals beside its parent preview rather than inside it, so it + must stack above the shared preview level to be seen at all. */ .astra-ui.astra-preview-popover-portal.astra-citation-preview-portal .astra-citation-preview { - z-index: 70; + z-index: calc(var(--astra-z-preview, 1100) + 1); width: 500px; max-width: calc(100vw - 1rem); color: inherit; diff --git a/packages/astra/tests/inventory.test.tsx b/packages/astra/tests/inventory.test.tsx index 754fd72..1cfe50a 100644 --- a/packages/astra/tests/inventory.test.tsx +++ b/packages/astra/tests/inventory.test.tsx @@ -54,6 +54,8 @@ describe('publication inventory', () => { const inventory = await screen.findByRole('dialog', { name: 'Demo' }); expect(inventory.closest('article')).toBeNull(); expect(within(inventory).getByRole('heading', { name: 'Outputs' })).toBeVisible(); + expect(within(inventory).queryByRole('navigation', { name: 'Project hierarchy' })).toBeNull(); + expect(within(inventory).queryByRole('button', { name: 'Calibration' })).toBeNull(); expect(within(inventory).getByRole('img', { name: 'Shear correlation plot' })).toHaveAttribute( 'src', '/myst-assets/shear_plot.png', ); diff --git a/packages/astra/tests/styles-contract.test.ts b/packages/astra/tests/styles-contract.test.ts index 6ea7607..6d86b69 100644 --- a/packages/astra/tests/styles-contract.test.ts +++ b/packages/astra/tests/styles-contract.test.ts @@ -102,6 +102,14 @@ describe('shared ASTRA stylesheet contract', () => { expect(orphans).toEqual([]); }); + it('stacks a nested citation card above the shared preview it opens from', () => { + // Both cards portal beside each other, so the citation must outrank the + // shared preview level rather than a fixed number below it. + expect(css).toMatch( + /\.astra-citation-preview-portal\s+\.astra-citation-preview \{[^}]*z-index: calc\(var\(--astra-z-preview(?:, ?\d+)?\) \+ 1\);/, + ); + }); + it('keeps registry identifiers visually identical when no anchor is available', () => { expect(css).toMatch( /\.astra-inputs \.astra-id,\s*\.astra-outputs \.astra-id \{[^}]*font-weight: 500;[^}]*text-decoration: underline;/,