From 16171dc34a849b5f24a610414430b1255c4b3707 Mon Sep 17 00:00:00 2001 From: Phillip Tarrant Date: Tue, 25 Nov 2025 22:16:33 -0600 Subject: [PATCH] fix(web): restore 3-column NPC chat modal layout for desktop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed grid layout not applying to modal content (grid was on wrong parent element) - Applied grid to .npc-chat-container instead of .npc-modal-body--three-col - Removed htmx-indicator class from history panel (was causing content to disappear) - Made history loading indicator visible by default - Updated responsive breakpoints to target correct selectors - Added warning to HTMX_PATTERNS.md about htmx-indicator hidden behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- public_web/docs/HTMX_PATTERNS.md | 6 ++- public_web/static/css/play.css | 44 ++++++++++++------- .../game/partials/npc_chat_content.html | 2 +- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/public_web/docs/HTMX_PATTERNS.md b/public_web/docs/HTMX_PATTERNS.md index f73df65..eae439d 100644 --- a/public_web/docs/HTMX_PATTERNS.md +++ b/public_web/docs/HTMX_PATTERNS.md @@ -564,6 +564,8 @@ def create_character(): ``` +> **IMPORTANT:** The `htmx-indicator` class is **hidden by default** (opacity: 0) and only shown during active requests. Never put this class on a container that should remain visible - only use it on loading spinners/messages that should appear during requests and disappear after. + ### 4. Debounce Search Inputs ```html { --- -**Document Version:** 1.1 +**Document Version:** 1.2 **Created:** November 18, 2025 -**Last Updated:** November 21, 2025 +**Last Updated:** November 26, 2025 diff --git a/public_web/static/css/play.css b/public_web/static/css/play.css index 333992b..d31ee54 100644 --- a/public_web/static/css/play.css +++ b/public_web/static/css/play.css @@ -1436,10 +1436,28 @@ /* 3-column layout for chat modal with history sidebar */ .npc-modal-body--three-col { + padding: 0; /* Let container handle padding */ + max-height: 70vh; +} + +/* Apply grid to the actual container holding the three columns */ +.npc-modal-body--three-col .npc-chat-container { display: grid; grid-template-columns: 200px 1fr 280px; /* Profile | Chat | History */ gap: 1rem; - max-height: 70vh; + padding: 1rem 1.25rem; + height: 100%; +} + +/* Override hardcoded widths for grid children - let grid define sizes */ +.npc-modal-body--three-col .npc-profile { + width: auto; +} + +/* Ensure history panel is visible in modal grid */ +.npc-modal-body--three-col .npc-history-panel { + min-height: 200px; + overflow-y: auto; } /* NPC Profile (Left Column) */ @@ -1699,24 +1717,13 @@ font-style: italic; } -/* HTMX Loading Indicator */ +/* HTMX Loading Indicator - visible by default, replaced by HTMX response */ .history-loading { text-align: center; color: var(--text-muted); font-size: 0.875rem; padding: 1rem 0; font-style: italic; - display: none; -} - -/* Show loading indicator when HTMX is making a request */ -.htmx-indicator.htmx-request .history-loading { - display: block; -} - -/* Hide other content while loading */ -.htmx-indicator.htmx-request > *:not(.history-loading) { - opacity: 0.5; } /* Responsive NPC Modal */ @@ -1763,20 +1770,23 @@ /* Responsive: 3-column modal stacks on smaller screens */ @media (max-width: 1024px) { - .npc-modal-body--three-col { + .npc-modal-body--three-col .npc-chat-container { grid-template-columns: 1fr; /* Single column */ grid-template-rows: auto 1fr auto; } - .npc-profile { + .npc-modal-body--three-col .npc-profile { order: 1; + width: 100%; + flex-direction: row; + flex-wrap: wrap; } - .npc-conversation { + .npc-modal-body--three-col .npc-conversation { order: 2; } - .npc-history-panel { + .npc-modal-body--three-col .npc-history-panel { order: 3; border-left: none; border-top: 1px solid var(--play-border); diff --git a/public_web/templates/game/partials/npc_chat_content.html b/public_web/templates/game/partials/npc_chat_content.html index 318b223..9cc8f0f 100644 --- a/public_web/templates/game/partials/npc_chat_content.html +++ b/public_web/templates/game/partials/npc_chat_content.html @@ -109,7 +109,7 @@ Displays NPC profile, conversation interface, and message history {# Right Column: Message History Sidebar #} -