diff --git a/web/app/assets/css/main.css b/web/app/assets/css/main.css index ab5f280..69c1cd7 100644 --- a/web/app/assets/css/main.css +++ b/web/app/assets/css/main.css @@ -1354,6 +1354,7 @@ button { overflow-y: auto; font-size: var(--fs-ui); line-height: var(--lh-body); + overflow-wrap: anywhere; scrollbar-width: thin; } @@ -1361,6 +1362,26 @@ button { color: var(--faint); } +.composer-sizer { + position: fixed; + top: -10000px; + left: -10000px; + height: 0; + min-height: 0; + max-height: none; + overflow: hidden; + visibility: hidden; + pointer-events: none; + border: 0; + padding: var(--sp-1) var(--sp-2); + font: inherit; + font-size: var(--fs-ui); + line-height: var(--lh-body); + white-space: pre-wrap; + overflow-wrap: anywhere; + resize: none; +} + .composer-actions { display: flex; align-items: center; diff --git a/web/app/components/ChatComposer.vue b/web/app/components/ChatComposer.vue index 4166f90..1bc83d0 100644 --- a/web/app/components/ChatComposer.vue +++ b/web/app/components/ChatComposer.vue @@ -1,25 +1,42 @@ @@ -105,6 +137,16 @@ onBeforeUnmount(() => { @input="onInput" @keydown="onKeydown" /> +
Enter sends, Shift+Enter adds a line.
diff --git a/web/app/pages/room/[id].vue b/web/app/pages/room/[id].vue index 0d95db9..a80edb5 100644 --- a/web/app/pages/room/[id].vue +++ b/web/app/pages/room/[id].vue @@ -637,7 +637,7 @@ let stickScheduled = false /// Keep the newest turn card or message in view while the log grows, /// unless the reader has scrolled away from the bottom. function scheduleStick() { - if (!stick.value || stickScheduled) return + if (!stick.value || suspendAutoScroll || stickScheduled) return stickScheduled = true void nextTick(() => { stickScheduled = false @@ -708,6 +708,10 @@ async function loadOlder() { } } +function onComposerResized() { + scheduleStick() +} + async function onSent(message: Message) { addMessage(message, true) stick.value = true @@ -858,7 +862,12 @@ onBeforeUnmount(() => {

{{ typingText }}

- +