fix(web): restore 3-column NPC chat modal layout for desktop #4
@@ -564,6 +564,8 @@ def create_character():
|
||||
<span id="spinner" class="htmx-indicator">⏳</span>
|
||||
```
|
||||
|
||||
> **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
|
||||
<input hx-get="/search"
|
||||
@@ -646,6 +648,6 @@ document.body.addEventListener('htmx:responseError', (event) => {
|
||||
|
||||
---
|
||||
|
||||
**Document Version:** 1.1
|
||||
**Document Version:** 1.2
|
||||
**Created:** November 18, 2025
|
||||
**Last Updated:** November 21, 2025
|
||||
**Last Updated:** November 26, 2025
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -109,7 +109,7 @@ Displays NPC profile, conversation interface, and message history
|
||||
</div>
|
||||
|
||||
{# Right Column: Message History Sidebar #}
|
||||
<aside class="npc-history-panel htmx-indicator"
|
||||
<aside class="npc-history-panel"
|
||||
id="npc-history-{{ npc.npc_id }}"
|
||||
hx-get="{{ url_for('game.npc_chat_history', session_id=session_id, npc_id=npc.npc_id) }}"
|
||||
hx-trigger="load, newMessage from:body"
|
||||
|
||||
Reference in New Issue
Block a user