Files
task-inventory/public/style.css
mikael-lovqvists-claude-agent dbef6605c9 Replace entry dialog with full-page edit view
- Remove Entry_Dialog class; edit/new now navigate to #edit/<id> and #new/...
- render_edit_view() builds a full-page layout: header with title input,
  Write/Preview tabs, and a metadata sidebar
- Tab key inserts a literal tab character in the editor
- Ctrl+S saves from both title input and textarea
- Body/main element uses flex column layout so edit view fills viewport

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 14:25:36 +00:00

785 lines
14 KiB
CSS

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
font-family: system-ui, sans-serif;
font-size: 14px;
background: #1a1a1a;
color: #e0e0e0;
height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
}
header {
display: flex;
align-items: center;
gap: 1.5rem;
padding: 0.75rem 1.25rem;
background: #242424;
border-bottom: 1px solid #333;
}
header h1 {
font-size: 1rem;
font-weight: 600;
color: #fff;
}
nav { display: flex; gap: 0.5rem; }
.nav-btn {
padding: 0.3rem 0.75rem;
border: 1px solid #444;
border-radius: 4px;
background: transparent;
color: #aaa;
cursor: pointer;
font-size: 13px;
}
.segmented-control {
display: flex;
border: 1px solid #444;
border-radius: 4px;
overflow: hidden;
}
.segmented-control button {
border: none;
border-radius: 0;
padding: 0.3rem 0.75rem;
background: transparent;
color: #777;
font-size: 13px;
}
.segmented-control button + button { border-left: 1px solid #444; }
.segmented-control button.active { background: #383838; color: #fff; }
.segmented-control button:hover:not(.active) { color: #bbb; }
.nav-btn.active, .nav-btn:hover {
background: #333;
color: #fff;
border-color: #555;
}
main { padding: 1.25rem; }
/* Toolbar */
.toolbar {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1rem;
}
.toolbar h2 { font-size: 1rem; flex: 1; }
/* Filter bar */
.filter-bar {
display: flex;
gap: 0.5rem;
margin-bottom: 0.75rem;
flex-wrap: wrap;
}
.filter-bar select, .filter-bar input {
padding: 0.3rem 0.5rem;
background: #2a2a2a;
border: 1px solid #444;
border-radius: 4px;
color: #e0e0e0;
font-size: 13px;
}
/* Task list */
.task-list { display: flex; flex-direction: column; gap: 1px; }
.task-node + .task-node { margin-top: 1px; }
.task-node { display: flex; flex-direction: column; }
.task-children {
margin-left: 1rem;
padding-left: 0.75rem;
border-left: 1px solid #2d2d2d;
display: flex;
flex-direction: column;
gap: 1px;
}
.task-row {
display: grid;
grid-template-columns: 1.25rem auto 1fr;
align-items: start;
gap: 0.5rem 0.75rem;
padding: 0.5rem 0.75rem;
background: #242424;
border-radius: 4px;
border-left: 3px solid transparent;
}
.task-meta {
display: grid;
grid-template-columns: auto auto;
gap: 0.2rem 0.3rem;
align-items: center;
align-content: start;
}
.task-main {
display: flex;
flex-direction: column;
gap: 0.25rem;
min-width: 0;
}
.task-footer {
display: flex;
align-items: center;
gap: 0.5rem;
flex-wrap: wrap;
margin-top: 0.1rem;
}
.task-time {
font-size: 11px;
color: #555;
margin-left: auto;
}
.task-row[data-priority='high'] { border-left-color: #e05555; }
.task-row[data-priority='normal'] { border-left-color: #5588e0; }
.task-row[data-priority='low'] { border-left-color: #555; }
.task-row:hover { background: #2c2c2c; }
.task-row[data-status='done'] { opacity: 0.5; }
.task-row[data-status='cancelled'] { opacity: 0.4; text-decoration: line-through; }
.task-id { color: #666; font-size: 11px; text-align: center; }
.task-title { font-weight: 500; }
.task-status, .task-priority {
font-size: 11px;
padding: 0.15rem 0.4rem;
border-radius: 3px;
text-align: center;
text-transform: uppercase;
letter-spacing: 0.03em;
}
.task-actions { display: flex; gap: 0.4rem; }
.task-status[data-val='open'] { background: #1e3a5f; color: #6ab0f5; }
.task-status[data-val='done'] { background: #1a3a1a; color: #6ad06a; }
.task-status[data-val='cancelled'] { background: #2a1a1a; color: #c06060; }
.task-status[data-val='deferred'] { background: #2a2a1a; color: #c0b060; }
.task-priority[data-val='high'] { background: #3a1a1a; color: #e08080; }
.task-priority[data-val='normal'] { background: transparent; color: #777; }
.task-priority[data-val='low'] { background: transparent; color: #555; }
.task-tags { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.tag {
font-size: 11px;
padding: 0.1rem 0.35rem;
background: #2a2a3a;
border-radius: 3px;
color: #8899cc;
}
.clickable-tag { cursor: pointer; }
.clickable-tag:hover { background: #363650; color: #aabbee; }
.btn-expand {
width: 1.25rem;
height: 1.25rem;
padding: 0;
font-size: 9px;
background: transparent;
color: #555;
border: none;
border-radius: 3px;
display: flex;
align-items: center;
justify-content: center;
visibility: hidden;
}
.btn-expand:hover { color: #aaa; background: #333; }
.btn-sub { font-size: 12px; padding: 0.2rem 0.5rem; color: #6a9; }
/* Buttons */
button {
cursor: pointer;
border: none;
border-radius: 4px;
font-size: 13px;
padding: 0.3rem 0.7rem;
background: #333;
color: #ccc;
}
button:hover { background: #444; color: #fff; }
.btn-primary {
background: #2a4a7a;
color: #8bb8f0;
}
.btn-primary:hover { background: #335a90; color: #c0d8ff; }
.btn-danger { background: #4a1a1a; color: #e08080; }
.btn-danger:hover { background: #5a2020; color: #ffaaaa; }
.btn-edit { font-size: 12px; padding: 0.2rem 0.5rem; }
.btn-delete { font-size: 12px; padding: 0.2rem 0.5rem; }
/* Dialog */
dialog {
margin: auto;
background: #242424;
border: 1px solid #444;
border-radius: 8px;
color: #e0e0e0;
padding: 1.5rem;
width: 480px;
max-width: 95vw;
}
dialog::backdrop { background: rgba(0,0,0,0.6); }
dialog h2 { margin-bottom: 1rem; font-size: 1rem; }
dialog label {
display: flex;
flex-direction: column;
gap: 0.3rem;
margin-bottom: 0.75rem;
font-size: 12px;
color: #999;
}
dialog input, dialog textarea, dialog select {
padding: 0.4rem 0.6rem;
background: #1a1a1a;
border: 1px solid #444;
border-radius: 4px;
color: #e0e0e0;
font-size: 13px;
font-family: inherit;
resize: vertical;
}
dialog input:focus, dialog textarea:focus, dialog select:focus {
outline: none;
border-color: #5588e0;
}
.dialog-buttons {
display: flex;
gap: 0.5rem;
justify-content: flex-end;
margin-top: 1rem;
}
/* Parent section in dialog */
.parent-section {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
font-size: 12px;
}
.parent-section-label { color: #999; min-width: 3rem; }
.parent-display { color: #ccc; flex: 1; }
/* Task picker dialog */
.task-picker-dialog {
width: 420px;
max-width: 95vw;
}
.task-picker-dialog h2 { margin-bottom: 0.75rem; font-size: 1rem; }
.picker-search {
width: 100%;
padding: 0.4rem 0.6rem;
background: #1a1a1a;
border: 1px solid #444;
border-radius: 4px;
color: #e0e0e0;
font-size: 13px;
margin-bottom: 0.5rem;
}
.picker-search:focus { outline: none; border-color: #5588e0; }
.picker-list {
max-height: 280px;
overflow-y: auto;
border: 1px solid #333;
border-radius: 4px;
margin-bottom: 0.75rem;
}
.picker-item {
padding: 0.4rem 0.6rem;
cursor: pointer;
font-size: 13px;
border-bottom: 1px solid #2a2a2a;
}
.picker-item:last-child { border-bottom: none; }
.picker-item:hover { background: #2e2e2e; color: #fff; }
.empty-state {
color: #555;
padding: 2rem;
text-align: center;
}
/* Markdown inline in task list */
.task-title.markup, .task-body.markup {
padding: 0;
font-size: 14px;
overflow: visible;
}
.task-title.markup p { margin: 0; display: inline; }
.task-title.markup > *:first-child { margin-top: 0; }
.task-body.markup {
margin-top: 0.25rem;
font-size: 12px;
color: #aaa;
max-height: 3.5em;
overflow: hidden;
}
.task-body.markup > *:first-child { margin-top: 0; }
.task-body.markup > *:last-child { margin-bottom: 0; }
/* Field with edit/preview tabs */
.field-with-tabs {
margin-bottom: 0.75rem;
}
.tab-bar {
display: flex;
align-items: center;
gap: 2px;
margin-bottom: 0;
border-bottom: 1px solid #444;
padding-bottom: 0;
}
.tab-btn {
padding: 0.25rem 0.75rem;
border-radius: 4px 4px 0 0;
border: 1px solid transparent;
border-bottom: none;
background: transparent;
color: #888;
font-size: 12px;
margin-bottom: -1px;
}
.tab-btn.active {
background: #1a1a1a;
color: #e0e0e0;
border-color: #444;
border-bottom-color: #1a1a1a;
}
.tab-btn:hover:not(.active) { color: #ccc; }
.tab-label {
margin-left: auto;
font-size: 11px;
color: #666;
padding-right: 0.25rem;
}
.tab-pane textarea {
width: 100%;
padding: 0.4rem 0.6rem;
background: #1a1a1a;
border: 1px solid #444;
border-top: none;
border-radius: 0 0 4px 4px;
color: #e0e0e0;
font-size: 13px;
font-family: monospace;
resize: vertical;
}
.tab-pane textarea:focus {
outline: none;
border-color: #5588e0;
}
.preview-content {
min-height: 8rem;
padding: 0.6rem 0.75rem;
background: #1a1a1a;
border: 1px solid #444;
border-top: none;
border-radius: 0 0 4px 4px;
font-size: 13px;
overflow: auto;
}
.preview-content.loading { color: #555; font-style: italic; }
/* Entry type chip (shown in All view) */
.entry-type-chip {
font-size: 10px;
padding: 0.1rem 0.35rem;
background: #1e2a3a;
border: 1px solid #2a4060;
border-radius: 3px;
color: #5588cc;
margin-bottom: 0.2rem;
display: inline-block;
width: fit-content;
}
/* Type section in entry dialog */
.type-section {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
font-size: 12px;
}
.type-section-label { color: #999; min-width: 3rem; }
.type-section .type-display {
color: #ccc;
font-size: 13px;
}
.type-section .type-select {
padding: 0.3rem 0.5rem;
background: #1a1a1a;
border: 1px solid #444;
border-radius: 4px;
color: #e0e0e0;
font-size: 13px;
}
/* Manage types view */
.type-list {
display: flex;
flex-direction: column;
gap: 1px;
}
.type-row {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.6rem 0.75rem;
background: #242424;
border-radius: 4px;
}
.type-info {
flex: 1;
display: flex;
align-items: baseline;
gap: 0.75rem;
flex-wrap: wrap;
}
.type-id {
font-family: monospace;
font-size: 12px;
color: #777;
background: #1a1a1a;
padding: 0.1rem 0.35rem;
border-radius: 3px;
}
.type-title {
font-weight: 500;
font-size: 14px;
}
.type-desc {
font-size: 12px;
color: #888;
}
/* Entry type dialog */
.entry-type-dialog { width: 420px; max-width: 95vw; }
.id-display-row {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
font-size: 12px;
}
.id-display-label { color: #999; min-width: 3rem; }
.id-display-value { font-size: 13px; color: #ccc; }
/* Clickable entry row main area */
.task-main.clickable {
cursor: pointer;
}
.task-main.clickable:hover .task-title {
color: #fff;
}
/* Entry detail view */
.detail-header {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
}
.detail-back {
color: #666;
text-decoration: none;
font-size: 13px;
}
.detail-back:hover { color: #aaa; }
.detail-id {
color: #555;
font-size: 13px;
}
.detail-actions {
margin-left: auto;
display: flex;
gap: 0.5rem;
}
.detail-title {
font-size: 1.4rem;
font-weight: 600;
margin-bottom: 0.75rem;
line-height: 1.3;
}
.detail-title p { margin: 0; }
.detail-meta {
display: flex;
align-items: center;
gap: 0.5rem;
flex-wrap: wrap;
margin-bottom: 1.25rem;
}
.detail-parent-link {
font-size: 12px;
color: #666;
text-decoration: none;
}
.detail-parent-link:hover { color: #aaa; }
.detail-body {
background: #1e1e1e;
border: 1px solid #2e2e2e;
border-radius: 6px;
padding: 1rem 1.25rem;
margin-bottom: 1.5rem;
line-height: 1.6;
}
.detail-children h3 {
font-size: 13px;
color: #666;
font-weight: 500;
margin-bottom: 0.5rem;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.detail-children .task-list {
margin-top: 0.5rem;
}
/* Full-page edit mode */
header { flex-shrink: 0; }
main {
flex: 1;
overflow-y: auto;
min-height: 0;
}
main.edit-mode {
padding: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.edit-view {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.edit-header {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.6rem 1rem;
background: #1e1e1e;
border-bottom: 1px solid #333;
flex-shrink: 0;
}
.edit-title-input {
flex: 1;
padding: 0.35rem 0.6rem;
background: #2a2a2a;
border: 1px solid #444;
border-radius: 4px;
color: #e0e0e0;
font-size: 15px;
font-family: inherit;
font-weight: 500;
}
.edit-title-input:focus {
outline: none;
border-color: #5588e0;
}
.edit-body-area {
display: grid;
grid-template-columns: 1fr 240px;
flex: 1;
overflow: hidden;
min-height: 0;
}
.edit-editor-pane {
display: flex;
flex-direction: column;
border-right: 1px solid #2a2a2a;
overflow: hidden;
min-height: 0;
}
.edit-tab-bar {
display: flex;
gap: 0;
border-bottom: 1px solid #2a2a2a;
flex-shrink: 0;
background: #161616;
}
.edit-tab {
padding: 0.4rem 1rem;
border: none;
border-radius: 0;
background: transparent;
color: #666;
font-size: 13px;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
}
.edit-tab:hover { color: #aaa; background: transparent; }
.edit-tab.active { color: #e0e0e0; border-bottom-color: #5588e0; background: transparent; }
.edit-textarea {
flex: 1;
resize: none;
padding: 1rem;
background: #111;
border: none;
color: #d0d0d0;
font-size: 13px;
font-family: monospace;
line-height: 1.6;
overflow-y: auto;
min-height: 0;
}
.edit-textarea:focus {
outline: none;
background: #141414;
}
.edit-preview {
flex: 1;
padding: 1rem 1.25rem;
overflow-y: auto;
line-height: 1.6;
font-size: 14px;
background: #111;
min-height: 0;
}
.edit-sidebar {
overflow-y: auto;
padding: 0.75rem;
background: #1a1a1a;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.edit-sidebar-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.edit-sidebar-label {
font-size: 11px;
color: #666;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.edit-sidebar-value {
font-size: 13px;
color: #ccc;
padding: 0.2rem 0;
}
.edit-sidebar-select,
.edit-sidebar-input {
width: 100%;
padding: 0.3rem 0.5rem;
background: #242424;
border: 1px solid #444;
border-radius: 4px;
color: #e0e0e0;
font-size: 13px;
font-family: inherit;
}
.edit-sidebar-select:focus,
.edit-sidebar-input:focus {
outline: none;
border-color: #5588e0;
}
.edit-parent-btns {
display: flex;
gap: 0.4rem;
flex-wrap: wrap;
margin-top: 0.25rem;
}