fix #221: scale image pastes, drop text box, fix raw view and size
CI / test (pull_request) Successful in 45s
CI / docker (pull_request) Skipped

- image pastes render the image scaled to fit the viewer box (aspect
  ratio preserved, max-height 70vh), no text/code box below it
- link pill moved under the image as a small inline chip
- /raw serves image attachment bytes as an image instead of empty text
- view details size reports the actual attachment file size
This commit is contained in:
fen
2026-09-10 14:19:07 -05:00
parent 44cff7e718
commit 98ea7eefa9
5 changed files with 80 additions and 9 deletions
+26 -6
View File
@@ -813,15 +813,35 @@ button[type="submit"]:focus-visible,
}
.file-chip .file-chip-remove:hover { color: var(--danger, #c0392b); }
.attachment-bar { display: flex; flex-direction: column; gap: 10px; }
.attachment-chip {
/* #221: the link pill under an image preview stays a small inline chip,
left-aligned under the image, not stretched above it. */
.attachment-bar .attachment-chip {
display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
border: 1px solid var(--border); border-radius: var(--radius);
padding: 8px 16px; text-decoration: none; color: var(--fg);
background: var(--surface-2); font-size: 21.6px;
padding: 6px 14px; text-decoration: none; color: var(--fg);
background: var(--surface-2); font-size: 19px;
}
.attachment-bar .attachment-chip:hover { border-color: var(--accent); }
.attachment-bar .attachment-chip .attachment-name {
max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* #221: images scale to fit the viewer box, aspect ratio preserved. */
.attachment-preview {
max-width: 100%;
align-self: flex-start;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--surface-2);
overflow: hidden;
}
.attachment-preview img {
display: block;
max-width: 100%;
max-height: 70vh;
width: auto;
height: auto;
object-fit: contain;
}
.attachment-chip:hover { border-color: var(--accent); }
.attachment-chip .attachment-size { color: var(--muted-fg); font-size: 19px; }
.attachment-preview img { max-width: 480px; max-height: 360px; border-radius: var(--radius); border: 1px solid var(--border); }
/* #139: CSP-safe replacements for inline style attributes (style-src 'self') */
.hidden { display: none; }