fix(editor): plurals, trimmed names, default tab, parent drawing confirmation

This commit is contained in:
bchanot committed 2026-11-04 19:40:43 +01:00
1 parent b42c6ae844
commit be4f468790
35 files changed
+385 -63

No files matched your search

+13 -1
View File
@@ -1,5 +1,6 @@
import type { ElementKey } from '@faunosteo/core-wasm/types'
import type { ElementKey, PreviewState } from '@faunosteo/core-wasm/types'
import type { FocusRequest } from './focusRequest'
import { unmeasuredViews } from './issues'
import type { TabTier } from './useViewport'
export const EDITOR_TABS = [
@@ -28,6 +29,17 @@ export function tabsFor(tier: TabTier): {
return { shown, more: EDITOR_TABS.filter((tab) => !shown.includes(tab)) }
}
/**
* 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.
*/
export function initialTab(state: PreviewState, tier: TabTier): 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'
}
/** Props of every tab body (Lots F-J fill them): read-only flag, tab jump, sheet reload. */
export interface EditorTabProps {
/** Not editable now: a mode that cannot save, or a recovery offer not answered yet. */