entity tooltip for active scene characters shouldn't show add detail op

This commit is contained in:
vegu-ai-tools
2026-05-31 13:37:09 +03:00
parent 31f2a7f92e
commit 201e274ca5
3 changed files with 26 additions and 11 deletions

View File

@@ -126,8 +126,22 @@ export default {
this.openEntityTooltip(span, entity);
},
// True when `name` is a live Scene actor (active or inactive roster).
characterIsKnown(name) {
return isKnownSceneCharacter(this.scene?.data, name);
},
openEntityTooltip(activator, entity) {
this.entityTooltip = { open: true, activator, entity };
// Stamp whether a character entity is a live Scene actor. Existing
// characters have their own detail surfaces (sheet, attributes,
// progression), so Add Detail is hidden for them — but background
// characters (named in narrative, not actors) have no other
// fleshing-out path, so they keep it like items and places do.
const enriched =
entity?.kind === 'character'
? { ...entity, isKnownCharacter: this.characterIsKnown(entity.name) }
: entity;
this.entityTooltip = { open: true, activator, entity: enriched };
},
// Flip the menu closed but keep `activator` and `entity` populated —
@@ -180,10 +194,7 @@ export default {
dispatchLookAtEntity(this.getWebsocket(), {
name: entity.name,
kind: entity.kind,
isKnownCharacter: isKnownSceneCharacter(
this.scene?.data,
entity.name,
),
isKnownCharacter: this.characterIsKnown(entity.name),
});
},
},

View File

@@ -57,7 +57,7 @@
Look at
</v-btn>
<v-btn
v-if="entity?.snapshot"
v-if="entity?.snapshot && !(entity?.kind === 'character' && entity?.isKnownCharacter)"
size="small"
variant="tonal"
color="primary"

View File

@@ -54,7 +54,7 @@
</template>
</v-tooltip>
<v-tooltip v-if="character.snapshot" :text="'Add detail to '+name">
<v-tooltip v-if="character.snapshot && !characterIsKnown(name)" :text="'Add detail to '+name">
<template v-slot:activator="{ props }">
<v-btn size="x-small" class="mr-1" v-bind="props" variant="tonal" density="comfortable" rounded="sm" @click.stop="examineCharacter(name, character.snapshot)" icon="mdi-plus"></v-btn>
@@ -318,10 +318,7 @@ export default {
dispatchLookAtEntity(this.getWebsocket(), {
name,
kind: 'character',
isKnownCharacter: isKnownSceneCharacter(
this.sceneData?.data,
name,
),
isKnownCharacter: this.characterIsKnown(name),
});
},
persistCharacter(name) {
@@ -436,6 +433,13 @@ export default {
}
return false;
},
// Exact-match roster check (active + inactive) for the Add Detail gate.
// Distinct from characterExists (fuzzy/active-only), which the
// persist/manage buttons rely on; the Add Detail gate needs the precise
// "is this the same character that already has a sheet" answer.
characterIsKnown(name) {
return isKnownSceneCharacter(this.sceneData?.data, name);
},
getCharacterData(name) {
if (!this.sceneData || !this.sceneData.data || !this.sceneData.data.characters) {
return null;