Commit Graph

26 Commits

Author SHA1 Message Date
Alexej Wolff e8cd01c693 feat: banner generation, improved memory system, streaming text animation
- Add banner/cover generation for stories with character reference support
- Improve summary system: generate every 8 msgs or when context large
- Enhance summary prompt to preserve critical story info (promises, relationships)
- Add typewriter text animation during AI streaming
- Increase context to 20 messages, lower summary temperature to 0.1
- Server: auto-truncate long messages instead of rejecting
2026-05-09 06:39:10 +02:00
Alexej Wolff 77b2794eb1 feat: WorldState memory, increased context, better error handling
- Added WorldState types for character location tracking
- Increased RECENT_MESSAGES_COUNT from 6 to 15
- Increased server limits (50k/200k chars)
- Added language reminders to system prompts
- Better error logging for 400 errors
2026-05-06 21:57:22 +02:00
Alexej Wolff 68c2b129fa Major refactor: security, performance, and code organization
Security:
- DeepSeek API moved to server-side proxy with rate limiting (20 req/min)
- Whitelist validation for all POST/PUT routes
- Cookie security (secure, sameSite, httpOnly in production)
- Input validation for messages, tokens, temperature
- Sanitized hasOwnProperty to prevent prototype pollution

Performance:
- Lazy loading for chat messages (sliding window of 20)
- Streaming response throttling (50ms batches)
- Scroll optimization (only scroll on new messages)
- AbortController fix for stop button

Code organization:
- GamePage refactored from ~1170 to ~750 lines
- New hooks: useGameSession, useStreamingResponse, useCharacterDetection, useLazyMessages
- New components: MessageList, ChatInput, SessionSelector, CharacterPanel
- Fixed ESLint errors

Features:
- OOC mode button for direct AI instructions
- Message versions (aiResponse) now persist to DB
- playerId saved in sessions
2026-05-05 23:41:52 +02:00
Alexej Wolff bbefa114f8 feat: Show character avatar in chat - split view on desktop, background on mobile 2026-05-05 00:48:39 +02:00
Alexej Wolff efd2332875 v1.0.0: Add version display in footer 2026-05-04 18:56:56 +02:00
Alexej Wolff f73a218745 Fix AI rule drift and add auto-save during streaming
- Add rule reminders after 10+ messages to prevent AI drift
- Add auto-save every 5 seconds during streaming
- Add beforeunload warning for unsaved changes
- Save user message immediately before generating AI response
- Use refs for latest session data in async operations
- Reduce summary threshold from 20 to 15 messages
2026-05-04 18:44:10 +02:00
Alexej Wolff 302b56bd5f Fix memory leak: throttle streaming updates, remove console.logs 2026-05-04 01:13:28 +02:00
Alexej Wolff 1f7d13e44c Improve narrative rules, update temperature defaults, fix session character loading 2026-05-04 00:59:56 +02:00
Alexej Wolff f52c86b049 Increase mobile chat font size 2026-02-11 21:38:51 +01:00
Alexej Wolff 1a3f9af9c3 Add session delete button 2026-02-11 21:12:58 +01:00
Alexej Wolff c1fe0eaeba Fix mobile font size and enable smart keyboard features 2026-02-11 21:05:16 +01:00
Alexej Wolff d2b95d4ca4 fix: remove delete buttons from story cards and game page 2026-02-11 16:56:50 +01:00
Alexej Wolff 764c8c9e9f feat: move delete session to settings with confirmation, increase mobile font 2026-02-11 16:51:17 +01:00
Alexej Wolff f0e8a947ba fix: save AI response before switching versions, increase mobile font to 17px 2026-02-11 16:48:46 +01:00
Alexej Wolff dccc94132e feat: sync AI responses with message versions, increase font size 2026-02-11 16:43:44 +01:00
Alexej Wolff c9a0236be6 fix: remove unused variable 2026-02-11 16:35:42 +01:00
Alexej Wolff a0827caabd feat: message editing with version history and AI regeneration 2026-02-11 16:34:25 +01:00
Alexej Wolff dae3c88020 feat: add scroll to bottom button and auto-scroll on session load 2026-02-11 16:29:50 +01:00
Alexej Wolff e5c7bd1b0d fix: attempt to disable iOS QuickType bar with form wrapper 2026-02-11 16:26:15 +01:00
Alexej Wolff e2e7e211d5 fix: disable autocorrect/autocomplete on chat textarea 2026-02-11 16:24:22 +01:00
Alexej Wolff 863cf7f6b6 feat: auto-resize textarea, persistent token stats 2026-02-11 02:05:28 +01:00
Alexej Wolff 8c6d6591f8 feat: multiple sessions per story with streaming AI responses 2026-02-11 01:47:24 +01:00
Alexej Wolff 161ecd661e feat: streaming AI responses with stop button 2026-02-11 01:30:56 +01:00
Alexej Wolff 2bfe8d95cc fix: input alignment 2026-02-11 01:07:43 +01:00
Alexej Wolff a9f0ab225b fix: TypeScript build errors 2026-02-11 00:26:34 +01:00
Alexej Wolff cc003ffbd5 first commit 2026-02-11 00:15:59 +01:00