Skip to content

feat: Menu enhancements and UI state updates - #8

Open
willthehuman wants to merge 1 commit into
mainfrom
feature/menu-enhancements
Open

feat: Menu enhancements and UI state updates#8
willthehuman wants to merge 1 commit into
mainfrom
feature/menu-enhancements

Conversation

@willthehuman

@willthehuman willthehuman commented Mar 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • title_prompt (menu search/filter): Add TitlePromptMessage to protocol and a search/filter TextField at the top of MenuOverlay when active. Typed characters are sent to the server as key presses for server-side filtering.
  • close_all_menus: Add CloseAllMenusMessage that clears the entire menu stack plus txt overlays, distinct from close_menu which pops only the top menu.
  • ui-state live updates: Enhance UiStateMessage handler to rebuild popup content (txt overlays and menu items) reactively, enabling live updates for god screens, item descriptions, etc.
  • ui-scroller-scroll: Add UiScrollerScrollMessage to track server-driven scroll positions for scrollable popups.
  • ui-stack (spectating): Add UiStackMessage that rebuilds the entire UI popup/menu stack from a list of items, used when a spectator joins mid-game.
  • Menu stack refactor: Replace single activeMenu field with menuStack (List<MenuState>) with a backward-compatible activeMenu getter. This properly supports nested menus and stack operations.

Key changes

File Change
lib/network/dcss_protocol.dart Add 4 new message types + factory cases
lib/game/game_state.dart TitlePromptState, menu stack, _handleUiState, _handleUiStack, new copyWith params
lib/ui/menu_overlay.dart Convert to StatefulWidget, add search/filter bar
lib/ui/game_screen.dart Pass titlePrompt to MenuOverlay

Test plan

  • Verify existing menu open/close/update/scroll still works (no regressions)
  • Test title_prompt: open an inventory menu and press Ctrl+F — search bar should appear and filter items
  • Test close_all_menus: nested menus should all dismiss at once
  • Test ui-state: open a god description screen and verify it updates if piety changes
  • Test ui-scroller-scroll: verify server-driven scroll position is tracked
  • Test ui-stack: join as a spectator mid-game and verify the UI stack is rebuilt correctly
  • Run flutter analyze to ensure no lint/type errors

🤖 Generated with Claude Code

- Add TitlePromptMessage for menu search/filter with text input at top of menu
- Add CloseAllMenusMessage to dismiss entire menu stack at once
- Add UiScrollerScrollMessage for server-driven scroll position sync
- Add UiStackMessage to rebuild entire UI popup stack (spectating support)
- Enhance UiStateMessage handling to live-update popup content reactively
- Refactor GameState from single activeMenu to menuStack (List<MenuState>)
  with backward-compatible activeMenu getter for top of stack
- Add TitlePromptState and popupScrollPosition to GameState
- Convert MenuOverlay to StatefulWidget with search/filter TextField
- Wire title_prompt state through GameScreen to MenuOverlay

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants