mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-22 03:05:32 +02:00
feat: inline entry title renaming (#14)
* feat: inline entry title renaming - database.rs: add update_entry_title(conn, entry_uid, title) -> Result<bool> targets archived_entries table; returns false for unknown uid - routes.rs: PATCH /api/archives/:archive_id/entries/:entry_uid (ROLE_USER) maps false -> 404; 3 tests (401 unauthed, 204+persists, 404 unknown uid) - api.js: updateEntryTitle(archiveId, entryUid, title) - ContextRail.jsx: click title h2 -> inline input; Enter/blur commits, Escape cancels (cancel ref prevents double-save on blur after Escape); pencil icon fades in on hover as edit affordance - App.jsx: handleEntryTitleChange mutates entries + selectedEntry in-place - styles.css: rail-title--editable cursor/hover, pencil icon show/hide, rail-title-input underline style - rebuild frontend bundle * chore: remove + prefix from Capture button label
This commit is contained in:
parent
1ff91956a1
commit
2502de45b6
11 changed files with 258 additions and 50 deletions
|
|
@ -1349,3 +1349,37 @@ select {
|
|||
}
|
||||
.entry-table { min-width: 860px; }
|
||||
}
|
||||
|
||||
/* Inline title edit in ContextRail */
|
||||
.rail-title--editable {
|
||||
cursor: pointer;
|
||||
}
|
||||
.rail-title--editable:hover {
|
||||
opacity: 0.75;
|
||||
}
|
||||
.rail-title--editable .edit-icon {
|
||||
display: inline-block;
|
||||
width: 0.75em;
|
||||
height: 0.75em;
|
||||
margin-left: 0.35em;
|
||||
vertical-align: middle;
|
||||
opacity: 0;
|
||||
transition: opacity 0.1s;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.rail-title--editable:hover .edit-icon {
|
||||
opacity: 0.5;
|
||||
}
|
||||
.rail-title-input {
|
||||
width: 100%;
|
||||
font: inherit;
|
||||
font-size: inherit;
|
||||
font-weight: 600;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid currentColor;
|
||||
color: inherit;
|
||||
padding: 0;
|
||||
margin: 0 0 8px;
|
||||
outline: none;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue