feat(editor): one tab order, vertical Plus list with the error count

This commit is contained in:
bchanot committed 2026-11-15 15:52:28 +01:00
1 parent b41c24b29d
commit ff21b0315e
11 files changed
+155 -75

No files matched your search

+5 -6
View File
@@ -14,11 +14,11 @@ export const EDITOR_TABS = [
] as const
export type EditorTabId = (typeof EDITOR_TABS)[number]
/** Board 05: the tabs shown beside « Plus » at each width; the rest sit under « Plus ». */
/** The tabs shown beside « Plus » at each width; the rest sit under « Plus », in tab order. */
const SHOWN: Record<TabTier, readonly EditorTabId[]> = {
wide: EDITOR_TABS,
medium: EDITOR_TABS,
small: ['annotations', 'verification'],
small: ['general', 'annotations'],
}
export function tabsFor(tier: TabTier): {
@@ -31,13 +31,12 @@ export function tabsFor(tier: TabTier): {
/**
* The tab a version opens on: Annotations once a view can be annotated, Général while
* there is nothing to annotate yet. A tier that does not list Général keeps Annotations.
* there is nothing to annotate yet. Both are shown at every width.
*/
export function initialTab(state: PreviewState, tier: TabTier): EditorTabId {
export function initialTab(state: PreviewState): EditorTabId {
const unmeasured = unmeasuredViews(state)
const measurable = state.document.views.some((v) => !unmeasured.has(v.id))
const wanted = measurable ? 'annotations' : 'general'
return SHOWN[tier].includes(wanted) ? wanted : 'annotations'
return measurable ? 'annotations' : 'general'
}
/**