fix(chat): Pełna poprawka layoutu - styl ChatGPT/Claude
- Nadpisanie .container dla chatu (100% szerokości) - Main z flex i overflow: hidden - chat-main z height: 100% i max-height: 100% - scrollToBottom z requestAnimationFrame dla pewności - Struktura jak w ChatGPT/Claude Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
11e8fb7dd2
commit
7d7755ed0a
@ -2,17 +2,35 @@
|
||||
|
||||
{% block title %}NordaGPT - Norda Biznes Hub{% endblock %}
|
||||
|
||||
{% block container_class %}chat-container-override{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<style>
|
||||
/* Reset main padding for full-height chat */
|
||||
/* Reset dla pełnoekranowego chatu jak ChatGPT/Claude */
|
||||
main {
|
||||
padding: 0 !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - 73px); /* Wysokość minus navbar */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
main > .container.chat-container-override {
|
||||
max-width: 100% !important;
|
||||
width: 100% !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chat-layout {
|
||||
display: flex;
|
||||
height: calc(100vh - 73px);
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
background: var(--background);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
@ -151,7 +169,9 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
overflow: hidden; /* Zapobiega scrollowaniu całego chat-main */
|
||||
height: 100%; /* Wymuszenie pełnej wysokości */
|
||||
max-height: 100%; /* Nie może przekroczyć rodzica */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chat-header {
|
||||
@ -1510,15 +1530,10 @@ function escapeHtml(text) {
|
||||
// Scroll to bottom
|
||||
function scrollToBottom() {
|
||||
const messagesDiv = document.getElementById('chatMessages');
|
||||
// Użyj scrollIntoView na ostatniej wiadomości zamiast scrollTop
|
||||
const messages = messagesDiv.querySelectorAll('.message');
|
||||
if (messages.length > 0) {
|
||||
const lastMessage = messages[messages.length - 1];
|
||||
lastMessage.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
||||
} else {
|
||||
// Fallback jeśli nie ma wiadomości
|
||||
// Prosty i niezawodny scroll do dołu kontenera wiadomości
|
||||
requestAnimationFrame(() => {
|
||||
messagesDiv.scrollTop = messagesDiv.scrollHeight;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Auto-resize textarea
|
||||
|
||||
Loading…
Reference in New Issue
Block a user