feat(editor): board 01 annotation card, side column from 1 024 px

Annotations of the view move from under the drawing to the overview card
(grouped by category, name filter, all rows); side column from lg.
Properties panel gains « Toutes les annotations ».

E2E mapping (R-24): after a creation the card is hidden (the new annotation is
selected), so list(...).getByText(name) became selectionTag toContainText
(annotations, geometry, journey); row clicks go through pickAnnotation
(annotations, geometry, journey, structures); geometry's list count 0 while a
creation is pending became selectionTag count 0.
This commit is contained in:
bchanot committed 2026-11-06 21:40:25 +01:00
1 parent 51fd3db608
commit 6131225288
16 files changed
+404 -94

No files matched your search

@@ -1,4 +1,5 @@
import { useState, type Dispatch } from 'react'
import { flushSync } from 'react-dom'
import type {
AnatomicalSheetDocument,
Annotation,
@@ -15,6 +16,7 @@ import {
import { isEditable } from '@/editor/annotations/geometryEdit'
import type { UiAction } from '@/editor/annotations/uiState'
import { geometryErrorsById } from '@/editor/issues'
import { focusRow } from '@/editor/focusRequest'
import { targetOfKey } from '@/editor/navigation'
import type { EditorPlaceProps } from '@/editor/tabs'
import { useEditCommand } from '@/editor/useEditCommand'
@@ -37,6 +39,8 @@ export interface PropertiesPanelProps {
dispatch: Dispatch<UiAction>
context: CommitContext
navigate: EditorPlaceProps['navigate']
/** Clears the selection: the overview shows again. */
onShowAll: () => void
/** Put before every id, for a twin of the panel that lives beside another one. */
idPrefix?: string
}
@@ -60,6 +64,7 @@ export default function PropertiesPanel(props: PropertiesPanelProps) {
data-testid="annotation-properties"
className="space-y-4 rounded-xl border border-[var(--color-border)] p-4"
>
<ShowAll id={annotation.id} onShowAll={props.onShowAll} />
<header className="flex items-start justify-between gap-2">
<h3
tabIndex={-1}
@@ -84,6 +89,24 @@ export default function PropertiesPanel(props: PropertiesPanelProps) {
)
}
/** Back to the overview, focus on the row of the annotation that was open. */
function ShowAll({ id, onShowAll }: { id: string; onShowAll: () => void }) {
const t = useT()
return (
<Button
type="button"
variant="secondary"
size="sm"
onClick={() => {
flushSync(onShowAll)
focusRow({ kind: 'annotation', id })
}}
>
{t('editor.annotations.show_all')}
</Button>
)
}
function GeometrySection(props: PropertiesPanelProps) {
const t = useT()
const { annotation, readOnly, geometryLocked } = props