Add PDF file attachments to components

- Upload PDFs, rename them (conflict-checked), delete them
- Link/unlink files per component (many components can share a file)
- File picker dialog: browse existing files, rename inline, upload new
- Component detail shows linked files as clickable links
- Files stored in data/pdfs/, served at /pdf/:filename
- KV prefix: pdf:

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 00:19:30 +00:00
parent e91a656dc8
commit f0bedc80a7
6 changed files with 393 additions and 4 deletions

View File

@@ -1506,3 +1506,78 @@ nav {
padding: 0.25rem 0.6rem;
font-size: 0.82rem;
}
/* ===== FILE PICKER DIALOG ===== */
.fp-list {
display: flex;
flex-direction: column;
gap: 0.3rem;
max-height: 40vh;
overflow-y: auto;
margin-bottom: 1rem;
}
.fp-row {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.35rem 0.5rem;
border-radius: 4px;
background: var(--surface-raised);
}
.fp-name {
flex: 1;
font-size: 0.9rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fp-rename-input {
flex: 1;
font-size: 0.9rem;
background: var(--bg);
color: var(--text);
border: 1px solid var(--border-focus);
border-radius: 4px;
padding: 0.2rem 0.4rem;
}
.fp-upload-section {
border-top: 1px solid var(--border);
padding-top: 1rem;
margin-top: 0.25rem;
}
.fp-upload-row {
display: flex;
gap: 0.5rem;
align-items: center;
flex-wrap: wrap;
}
.fp-upload-row input[type=text] {
flex: 1;
min-width: 140px;
}
/* ===== DETAIL FILE LINKS ===== */
.detail-files-list {
display: flex;
flex-direction: column;
gap: 0.3rem;
}
.detail-file-link {
color: var(--accent);
text-decoration: none;
font-size: 0.9rem;
padding: 0.2rem 0;
}
.detail-file-link:hover {
text-decoration: underline;
}