Limit images size, substitute variables in titles
This commit is contained in:
parent
f09fce3140
commit
3088675a39
|
|
@ -86,6 +86,7 @@
|
||||||
|
|
||||||
.image {
|
.image {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
max-height: 30dvh;
|
||||||
display: block;
|
display: block;
|
||||||
border-radius: var(--radius, 4px);
|
border-radius: var(--radius, 4px);
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
|
|
|
||||||
|
|
@ -128,10 +128,10 @@ export const Editor = () => {
|
||||||
const WorldIcon = isChatOnly ? MessagesSquare : Globe;
|
const WorldIcon = isChatOnly ? MessagesSquare : Globe;
|
||||||
const titleBar = currentStory
|
const titleBar = currentStory
|
||||||
? <div class={styles.title}>
|
? <div class={styles.title}>
|
||||||
<span class={styles.titleWorld}>{currentWorld?.title}</span>
|
<span class={styles.titleWorld}>{Prompt.substituteVars(appState, currentWorld!.title)}</span>
|
||||||
<span class={styles.titleSep}>/</span>{currentStory.title}</div>
|
<span class={styles.titleSep}>/</span>{Prompt.substituteVars(appState, currentStory.title)}</div>
|
||||||
: currentWorld
|
: currentWorld
|
||||||
? <div class={styles.title}><WorldIcon size={24} />{currentWorld.title}</div>
|
? <div class={styles.title}><WorldIcon size={24} />{Prompt.substituteVars(appState, currentWorld.title)}</div>
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import type { Story, World } from "../contexts/state";
|
||||||
import { isStory, isWorld, useAppState } from "../contexts/state";
|
import { isStory, isWorld, useAppState } from "../contexts/state";
|
||||||
import CharacterCard from "../utils/character-card";
|
import CharacterCard from "../utils/character-card";
|
||||||
import { SettingsModal } from "./settings-modal";
|
import { SettingsModal } from "./settings-modal";
|
||||||
|
import Prompt from "../utils/prompt";
|
||||||
|
|
||||||
// ─── Inline Rename Input ──────────────────────────────────────────────────────
|
// ─── Inline Rename Input ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
@ -56,6 +57,7 @@ interface StoryItemProps {
|
||||||
|
|
||||||
const StoryItem = ({ story, active, onSelect, onRename, onDelete, onDuplicate, onExport }: StoryItemProps) => {
|
const StoryItem = ({ story, active, onSelect, onRename, onDelete, onDuplicate, onExport }: StoryItemProps) => {
|
||||||
const isEditing = useBool(false);
|
const isEditing = useBool(false);
|
||||||
|
const appState = useAppState();
|
||||||
|
|
||||||
if (isEditing.value) {
|
if (isEditing.value) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -76,7 +78,7 @@ const StoryItem = ({ story, active, onSelect, onRename, onDelete, onDuplicate, o
|
||||||
onClick={onSelect}
|
onClick={onSelect}
|
||||||
onDblClick={isEditing.setTrue}
|
onDblClick={isEditing.setTrue}
|
||||||
>
|
>
|
||||||
{story.title}
|
{Prompt.substituteVars(appState, story.title)}
|
||||||
</button>
|
</button>
|
||||||
<div class={styles.actions}>
|
<div class={styles.actions}>
|
||||||
<button class={styles.actionButton} onClick={isEditing.setTrue} title="Rename">
|
<button class={styles.actionButton} onClick={isEditing.setTrue} title="Rename">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue