Skip to content

Commit 267dd27

Browse files
author
Alexey Panfilov
committed
ux(chat): move Edit/Regenerate into bubble footer, drop unicode icons
Float-above-bubble positioning produced clipping and weird overlap on narrow screens and fonts that don't carry pencil/refresh glyphs. Moved the action buttons into a subtle footer row inside the last bubble: static flow, no absolute positioning, no clipping, works the same desktop and mobile. Plain 'Edit' / 'Regenerate' labels render in every system font.
1 parent 6dfbdbd commit 267dd27

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

internal/adminapi/templates/chat.html

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@
4141
40% { transform: scale(1); opacity: 0.85; }
4242
}
4343

44-
/* Per-message hover actions (Regenerate on last bot, Edit on last user). */
45-
.chat-msg__actions { position: absolute; top: -0.6rem; right: 0.4rem; display: none; gap: 0.25rem; opacity: 0; transition: opacity 0.15s; }
44+
/* Per-message actions: a subtle footer row inside the last user/bot
45+
bubble. No absolute positioning → no clipping or weird overlap
46+
regardless of bubble width or screen size. Only rendered on the
47+
last bubble of each role (see updateLastActions in JS). */
48+
.chat-msg__actions { display: none; justify-content: flex-end; gap: 0.4rem; margin-top: 0.4rem; padding-top: 0.35rem; border-top: 1px solid rgba(0,0,0,0.1); }
4649
.chat-msg--last-user .chat-msg__actions,
4750
.chat-msg--last-bot .chat-msg__actions { display: flex; }
48-
.chat-msg--last-user:hover .chat-msg__actions,
49-
.chat-msg--last-bot:hover .chat-msg__actions { opacity: 1; }
50-
.chat-msg__actions button { font-size: 0.72em; padding: 0.15em 0.5em; border-radius: 4px; border: 1px solid rgba(0,0,0,0.15); background: rgba(255,255,255,0.95); cursor: pointer; }
51-
.chat-msg__actions button:disabled { opacity: 0.5; cursor: default; }
51+
.chat-msg--user .chat-msg__actions { border-top-color: rgba(255,255,255,0.2); }
52+
.chat-msg__actions button { font-size: 0.75em; padding: 0.2em 0.6em; border-radius: 4px; border: 1px solid currentColor; background: transparent; color: inherit; opacity: 0.75; cursor: pointer; font-family: inherit; }
53+
.chat-msg__actions button:hover { opacity: 1; }
54+
.chat-msg__actions button:disabled { opacity: 0.4; cursor: default; }
5255

5356
/* Copy button injected into <pre> blocks by hydrateCodeBlocks(). */
5457
.chat-code-copy { position: absolute; top: 0.35rem; right: 0.35rem; font-size: 0.7em; padding: 0.1em 0.4em; border-radius: 4px; border: 1px solid rgba(0,0,0,0.15); background: rgba(255,255,255,0.9); cursor: pointer; opacity: 0.6; }
@@ -92,11 +95,7 @@
9295
.chat-form .chat-controls select { flex: 1; min-width: 0; }
9396
.chat-form .chat-controls .btn { min-height: 40px; padding-inline: 1.1em; }
9497
.chat-attachment { width: 3.5rem; height: 3.5rem; }
95-
.chat-msg__actions { top: -0.55rem; }
9698
.chat-msg__actions button { opacity: 1; }
97-
/* On touch devices hover is sticky; show actions always on last bubbles. */
98-
.chat-msg--last-user .chat-msg__actions,
99-
.chat-msg--last-bot .chat-msg__actions { opacity: 1; }
10099
}
101100
</style>
102101
</head>
@@ -425,11 +424,11 @@ <h1>Admin</h1>
425424
var btn = document.createElement('button');
426425
btn.type = 'button';
427426
if (isUser) {
428-
btn.textContent = '\u270E Edit';
427+
btn.textContent = 'Edit';
429428
btn.title = 'Edit last message (drops the assistant reply)';
430429
btn.addEventListener('click', editLast);
431430
} else {
432-
btn.textContent = '\u21BB Regenerate';
431+
btn.textContent = 'Regenerate';
433432
btn.title = 'Regenerate the last reply';
434433
btn.addEventListener('click', regenerateLast);
435434
}

0 commit comments

Comments
 (0)