Skip to content

Conversation

@frizzle-chan
Copy link
Owner

Summary

  • Introduces effects.set_focus() and effects.clear_focus() template functions, allowing any handler to control focus state instead of relying on the focus_mode schema column
  • Makes rooms proper entities (room:<room_id>) with unified resolution path, eliminating hardcoded [Close X] Room escape logic
  • Adds RoomContext for lazy room data access in templates with room.description() and room.entities() functions
  • Simplifies focus lifecycle by removing redundant focus-clearing logic from /look and /interact cogs
  • Disables open/close actions on inventory items (they use implicit focus via thread context)

See ADR 0006 for detailed rationale and migration path.

Test plan

  • Verify /look with no target shows room description via room entity
  • Verify containers establish focus via effects.set_focus() in on_open
  • Verify closing containers clears focus via effects.clear_focus() in on_close
  • Verify room entity appears first in autocomplete when focused
  • Verify inventory items cannot be opened/closed
  • Run existing integration tests

🤖 Generated with Claude Code

frizzle-chan and others added 4 commits January 29, 2026 03:12
Inventory containers now use implicit focus only:
- Remove escape option from inventory thread autocomplete
- Remove handle_escape() function from shared.py
- Block open/close verbs on inventory items with clear message
- Remove "escape" source from entity resolution

Inventory containers are always "open" when viewed in their thread,
with no explicit focus state to manage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@frizzle-chan frizzle-chan force-pushed the refactor-focus-effect branch from d132c2e to 63400b6 Compare January 29, 2026 03:12
frizzle-chan and others added 6 commits January 29, 2026 03:27
Update base-room entity to handle all verbs (touch, attack, use, take,
open, close, drop) by clearing focus and showing room description. This
ensures rooms respond consistently to any action directed at them.

Add documentation in CLAUDE.md explaining the pattern for adding new
triggers.

Co-Authored-By: Claude Opus 4.5 <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