v1.0.0: Add version display in footer
This commit is contained in:
@@ -26,6 +26,14 @@
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.footer-version {
|
||||
font-size: 0.75rem;
|
||||
color: #555;
|
||||
padding: 0.15rem 0.5rem;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.footer-copyright {
|
||||
font-size: 0.8rem;
|
||||
color: #555;
|
||||
|
||||
@@ -30,6 +30,7 @@ export function Footer() {
|
||||
<div className="footer-content">
|
||||
<div className="footer-left">
|
||||
<span className="footer-brand">⚔️ ReSekai</span>
|
||||
<span className="footer-version">v{__APP_VERSION__}</span>
|
||||
<span className="footer-copyright">© 2026</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -88,11 +88,11 @@ export default function GamePage() {
|
||||
const handleBeforeUnload = (e: BeforeUnloadEvent) => {
|
||||
if (hasUnsavedChangesRef.current || isLoading) {
|
||||
e.preventDefault();
|
||||
e.returnValue = '';
|
||||
e.returnValue = "";
|
||||
}
|
||||
};
|
||||
window.addEventListener('beforeunload', handleBeforeUnload);
|
||||
return () => window.removeEventListener('beforeunload', handleBeforeUnload);
|
||||
window.addEventListener("beforeunload", handleBeforeUnload);
|
||||
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
||||
}, [isLoading]);
|
||||
|
||||
// Throttled streaming update (every 50ms instead of every chunk)
|
||||
|
||||
@@ -271,7 +271,10 @@ ${story.plot}`;
|
||||
/**
|
||||
* Builds dynamic context (state + summary + rule reminders)
|
||||
*/
|
||||
export function buildDynamicContext(session: GameSession, messageCount?: number): string {
|
||||
export function buildDynamicContext(
|
||||
session: GameSession,
|
||||
messageCount?: number,
|
||||
): string {
|
||||
const state = session.currentState;
|
||||
const summary = session.storySummary || "The story just began.";
|
||||
const keyEvents = session.keyEvents?.length
|
||||
@@ -279,13 +282,16 @@ export function buildDynamicContext(session: GameSession, messageCount?: number)
|
||||
: "No significant events yet.";
|
||||
|
||||
// Add rule reminders after 10+ messages to prevent drift
|
||||
const ruleReminder = (messageCount && messageCount >= 10) ? `
|
||||
const ruleReminder =
|
||||
messageCount && messageCount >= 10
|
||||
? `
|
||||
|
||||
=== REMINDER ===
|
||||
• Do NOT act for the player — only describe reactions and consequences
|
||||
• Do NOT ask "What do you do?" — end with atmosphere, not questions
|
||||
• Format dialogue: **"text"** (double asterisks = bold)
|
||||
• React to player's words explicitly` : '';
|
||||
• React to player's words explicitly`
|
||||
: "";
|
||||
|
||||
return `
|
||||
=== CURRENT STATE ===
|
||||
@@ -327,7 +333,9 @@ export async function generateStoryResponse(
|
||||
const worldContext = buildWorldContext(story);
|
||||
|
||||
// 3. Dynamic context (state + summary + rule reminders after 10+ messages)
|
||||
const dynamicContext = session ? buildDynamicContext(session, chatHistory.length) : "";
|
||||
const dynamicContext = session
|
||||
? buildDynamicContext(session, chatHistory.length)
|
||||
: "";
|
||||
|
||||
// 4. Last N messages (not the full history!)
|
||||
const recentMessages = chatHistory.slice(-RECENT_MESSAGES_COUNT);
|
||||
@@ -362,7 +370,9 @@ export async function generateStoryResponseStream(
|
||||
): Promise<string> {
|
||||
const styleRules = buildStyleRules(story, player);
|
||||
const worldContext = buildWorldContext(story);
|
||||
const dynamicContext = session ? buildDynamicContext(session, chatHistory.length) : "";
|
||||
const dynamicContext = session
|
||||
? buildDynamicContext(session, chatHistory.length)
|
||||
: "";
|
||||
const recentMessages = chatHistory.slice(-RECENT_MESSAGES_COUNT);
|
||||
const systemPrompt = styleRules + "\n" + worldContext + "\n" + dynamicContext;
|
||||
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
declare const __APP_VERSION__: string;
|
||||
Reference in New Issue
Block a user