mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-24 16:03:02 +00:00
fix(assistant): a book page card draws the page after as the server's trial made it
The Studio drew the page after a held edit or cover change by running the card's operations on its own book, which knows nothing of the journey's photos, words and figures, so a caption from a photo, a text from an entry or a map from the route came out differently or not at all. The card now carries the page the server's trial made with the full context, read with the book's schema and within the card's size, and the Studio draws it while its book stands at the version the trial ran on. A book that moved on, a card from before and a page too heavy to carry still run the operations on the book on screen, the book the change will run on. The receipt leaves the page out, since an applied change is drawn from the book itself.
This commit is contained in:
@@ -133,7 +133,16 @@ export function StudioPageStage({ assistant }: { assistant: StudioAssistant }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default function StudioAssistantPanel({ assistant, title }: { assistant: StudioAssistant; title: string }) {
|
||||
export default function StudioAssistantPanel({
|
||||
assistant,
|
||||
title,
|
||||
bookVersion,
|
||||
}: {
|
||||
assistant: StudioAssistant;
|
||||
title: string;
|
||||
/** The stored book's version the open book stands on, for the book's cards in the chat. */
|
||||
bookVersion?: number | null;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const thread = useAssistantThread(assistant.chatKey);
|
||||
@@ -174,6 +183,7 @@ export default function StudioAssistantPanel({ assistant, title }: { assistant:
|
||||
variant="window"
|
||||
density="compact"
|
||||
onOpen={onOpen}
|
||||
bookVersion={bookVersion}
|
||||
/>
|
||||
</aside>
|
||||
);
|
||||
@@ -198,8 +208,16 @@ export function StudioAssistantToggle({ assistant }: { assistant: StudioAssistan
|
||||
}
|
||||
|
||||
/** The chat column at the end of the Studio's body, while it is open, named after the journey. */
|
||||
export function StudioAssistantColumn({ assistant, title }: { assistant: StudioAssistant; title?: string }) {
|
||||
export function StudioAssistantColumn({
|
||||
assistant,
|
||||
title,
|
||||
bookVersion,
|
||||
}: {
|
||||
assistant: StudioAssistant;
|
||||
title?: string;
|
||||
bookVersion?: number | null;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
if (!assistant.open) return null;
|
||||
return <StudioAssistantPanel assistant={assistant} title={title || t('journey.title')} />;
|
||||
return <StudioAssistantPanel assistant={assistant} title={title || t('journey.title')} bookVersion={bookVersion} />;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ export default function StudioShell() {
|
||||
t={s.t}
|
||||
locale={s.locale}
|
||||
/>
|
||||
<StudioAssistantColumn assistant={assistant} title={s.journey?.title} />
|
||||
<StudioAssistantColumn assistant={assistant} title={s.journey?.title} bookVersion={s.bookVersion} />
|
||||
</div>
|
||||
<StudioPageStage assistant={assistant} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user