- Added functionality to open a phenomenon selector and handle selection changes in StatusBar.
- Updated StatusWidget to support disabling the popover for direct click actions, enhancing user interaction.
- Cleaned up unused code in StatusBar for improved readability.
- Refactored misfortune theme identifiers for clarity and consistency.
- Introduced a new function `_get_misfortune_theme` to handle theme translations.
- Updated `_pick_misfortune_theme` to utilize theme IDs and improved localization for misfortune results.
- Added new entries in localization files for English and Chinese, covering various misfortune themes and result messages.
- Improved user experience by ensuring all misfortune-related texts are properly translated and formatted.
- Added `owned_regions` attribute to the Avatar class to track regions owned by avatars.
- Introduced `occupy_region` and `release_region` methods for managing region ownership and ensuring proper relationship handling.
- Updated AvatarManager to clear relationships when an avatar is released, ensuring no lingering references.
- Refactored region ownership logic in the Occupy action and Simulator to utilize the new methods for better clarity and maintainability.
- Enhanced game loading process to establish ownership relationships correctly during game state restoration.
- Added new hidden domain names and descriptions to the zh-TW translation files.
- Updated StatusWidget to display cooldown years with proper localization.
- Enhanced zh-TW JSON localization with new labels for hidden domains, improving user experience.
* fix(i18n): add zh-TW to language options in settings menu
* fix(i18n): add zh-TW to language options in splash layer
* fix(i18n): add zh-TW support to setLocale function
* feat(i18n): add zh-TW game config files (names)
* feat(i18n): add zh-TW AI prompt templates
* docs:修正 glossary 繁中欄位
* docs:解決 glossary 衝突
* fix(i18n):補齊 zh-TW world info 標題
- Updated `HiddenDomainInfo` interface to include `cd_years` and `open_prob` properties for better domain management.
- Modified `serialize_active_domains` function to serialize new properties.
- Enhanced `StatusWidget` to display additional information about hidden domains, including cooldown years and open probability.
- Updated localization files for English and Chinese to reflect new status labels for hidden domains.
- Updated `serialize_active_domains` to include both active and inactive hidden domains, adding an `is_open` property for each domain.
- Modified `StatusBar` and `StatusWidget` components to reflect the new domain state, displaying appropriate labels and colors based on the activation status.
- Adjusted localization files for English and Chinese to align with the updated hidden domain features.
- Implemented `serialize_active_domains` function to gather and format active hidden domains from the game world.
- Updated `game_loop` to include active domains in the broadcast state.
- Enhanced `StatusBar` component to display active domains with a new `StatusWidget`, including dynamic labels and colors based on the number of active domains.
- Added localization support for hidden domain messages in both English and Chinese.
- Updated the world store to manage active domains state and synchronize with the backend.
* feat: add draggable sidebar resizer
- Add resizer handle between map and event panel
- Sidebar width adjustable from 300px to 50% screen width
- Default width remains 400px
- Auto-adjust on window resize
* fix: preserve map zoom when resizing sidebar
Only update viewport screen size without re-fitting the map
* fix: use window size for canvas to prevent map scaling on resize
- Canvas size now based on window instead of container
- Sidebar resize only clips the visible area, map stays same size
- Remove CSS stretch on canvas element
* docs: update sidebar-resizer spec with canvas fix
* test(web): add comprehensive tests for all Pinia stores
* test(web): add edge case tests for Pinia stores
* test(web): document race condition bugs in ui and world stores
* fix(web): fix race condition bugs in ui and world stores
- ui.ts: Add detailRequestId counter to prevent stale responses from
overwriting fresh data when reselecting the same target
- world.ts: Add eventsRequestId counter to prevent stale responses
when filter changes rapidly via resetEvents
- Update tests to verify the fix works correctly
* fix(web): fix race condition in fetchInitStatus
- Add fetchStatusRequestId counter to prevent stale responses from
overwriting fresh data when fetchInitStatus is called rapidly
- Add test that first proves the bug exists, then verifies the fix
* fix(web): fix race condition in fetchState
Add fetchStateRequestId counter to prevent stale responses from
overwriting fresh data when fetchState is called rapidly.
* test(web): add missing edge case tests for world store
- Add changePhenomenon API failure test
- Add initialize concurrent calls test
- Add getPhenomenaList concurrent calls test
Total: 108 tests
* test(web): add comprehensive socket store tests
- Add init() duplicate call guard test
- Add setup listener tests
- Add message handling tests (tick, game_reinitialized)
- Add status change handling tests
Total: 118 tests
* test(web): add missing socket message handling tests
- Add llm_config_required message tests
- Add unknown message type test
Total: 121 tests
* test(web): add handleTick edge case tests
- Add test for avatars without id (ignored)
- Add test for empty events array
- Add test for events filtered to empty
Total: 124 tests
Use single-pass regex replacement instead of multiple replaceAll calls.
This prevents shorter names from matching inside already-replaced longer names.
For example, with names '张三' and '张三丰', the text '张三丰是大师' now
correctly highlights only '张三丰', not '张三' within it.
When avatars overlap (e.g., during sparring, talking, dual cultivation),
it's hard to click on them directly. This adds the ability to click on
colored avatar names in the event panel to open their detail view.
- Modify highlightAvatarNames to include data-avatar-id attribute
- Add click event delegation in EventPanel
- Add hover styles for clickable names
The pause indicator was showing 'paused' while the game was still running
because isManualPaused was being modified by both user actions (clicking
pause button) and system actions (opening menu).
Changes:
- systemStore: pause()/resume() no longer modify isManualPaused, only
togglePause() does (with optimistic update + rollback on failure)
- useGameControl: consolidate 3 overlapping watches into 1 clean watch
that only handles menu open/close without polluting manual pause state
- App.vue: explicitly call resumeGame() API when game initializes
Add splash layer, support game start, settings, exit
Modify settings layer, add "go back to splash" and "exit"
Add character threshold for history input
Closes#28