feat(editor): « Citer » button and family labels in references

This commit is contained in:
bchanot committed 2026-11-15 19:40:47 +01:00
1 parent 240c2ba0e7
commit 8c3fcca0b9
16 files changed
+507 -53

No files matched your search

+10
View File
@@ -198,6 +198,16 @@ export function isCitable(key: ElementKey): boolean {
return key.kind === 'finding' && key.path.length > 0
}
/** A family: a finding key of one id (read from the key, so a vanished family is one too). */
export function isFamilyKey(key: ElementKey): boolean {
return key.kind === 'finding' && key.path.length === 1
}
/** The label key that names `key`: its `_family` variant for a family (Rev 6). */
export function elementLabel(label: string, key: ElementKey | null): string {
return key && isFamilyKey(key) ? `${label}_family` : label
}
/** Only a citable element has a citations dialog: any other key leaves the state as it is. */
function openCitations(state: NavigationState, citedBy: ElementKey) {
const finding = { key: citedBy, citations: true }