Changeset 0.21.5 (#91)

This commit is contained in:
2026-03-01 20:35:10 +00:00
parent d67cfd37c2
commit aadba77887
15 changed files with 1499 additions and 14 deletions

229
src/css/editor-mode.css Normal file
View File

@@ -0,0 +1,229 @@
/* ==========================================
Editor Surface (v0.21.5)
IDE-like layout: file tree | code + chat
========================================== */
/* ── Header ──────────────────────────────── */
.editor-header {
display: flex; align-items: center; justify-content: space-between;
padding: 6px 12px; gap: 8px;
font-size: 13px; color: var(--text-secondary);
border-bottom: 1px solid var(--border);
min-height: 36px; box-sizing: border-box;
}
.editor-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.editor-ws-name { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-branch { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.editor-header-right { display: flex; align-items: center; gap: 4px; }
.editor-hdr-btn {
background: none; border: none; color: var(--text-secondary);
cursor: pointer; padding: 4px; border-radius: 4px;
display: flex; align-items: center;
}
.editor-hdr-btn:hover { background: var(--hover); color: var(--text-primary); }
/* ── File Tree (sidebar-content region) ──── */
.editor-file-tree {
flex: 1; overflow-y: auto; overflow-x: hidden;
padding: 4px 0; font-size: 13px;
user-select: none;
}
.editor-tree-row {
display: flex; align-items: center; gap: 4px;
padding: 3px 8px; cursor: pointer;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
border-radius: 4px; margin: 0 4px;
}
.editor-tree-row:hover { background: var(--hover); }
.editor-tree-row.active { background: var(--active-bg, rgba(59,130,246,0.12)); color: var(--accent); }
.editor-tree-arrow { width: 14px; text-align: center; font-size: 10px; color: var(--text-tertiary); flex-shrink: 0; }
.editor-tree-arrow.expanded { /* already rotated via character */ }
.editor-tree-icon { flex-shrink: 0; font-size: 14px; line-height: 1; }
.editor-tree-name { overflow: hidden; text-overflow: ellipsis; }
.editor-tree-loading, .editor-tree-empty, .editor-tree-error {
padding: 16px; text-align: center; color: var(--text-tertiary); font-size: 12px;
}
/* ── Main Split Layout ───────────────────── */
.editor-main {
display: flex; flex: 1; min-height: 0; overflow: hidden;
}
.editor-left-pane {
display: flex; flex-direction: column; min-width: 200px; overflow: hidden;
}
.editor-right-pane {
display: flex; flex-direction: column; min-width: 200px; overflow: hidden;
border-left: 1px solid var(--border);
}
/* Resize handle */
.editor-split-handle {
width: 5px; cursor: col-resize; flex-shrink: 0;
background: transparent; position: relative; z-index: 5;
}
.editor-split-handle:hover,
.editor-split-handle:active {
background: var(--accent);
opacity: 0.3;
}
/* ── Tab Bar ─────────────────────────────── */
.editor-tab-bar {
display: flex; overflow-x: auto; overflow-y: hidden;
border-bottom: 1px solid var(--border);
min-height: 32px; flex-shrink: 0;
scrollbar-width: none;
}
.editor-tab-bar::-webkit-scrollbar { height: 0; }
.editor-tab {
display: flex; align-items: center; gap: 4px;
padding: 4px 10px; font-size: 12px;
cursor: pointer; white-space: nowrap;
border-right: 1px solid var(--border);
color: var(--text-secondary);
flex-shrink: 0; max-width: 180px;
position: relative;
}
.editor-tab:hover { background: var(--hover); }
.editor-tab.active {
background: var(--bg-primary);
color: var(--text-primary);
border-bottom: 2px solid var(--accent);
}
.editor-tab.modified .editor-tab-name { font-style: italic; }
.editor-tab-icon { font-size: 13px; flex-shrink: 0; }
.editor-tab-name { overflow: hidden; text-overflow: ellipsis; }
.editor-tab-modified { color: var(--accent); font-size: 10px; margin-left: 2px; }
.editor-tab-close {
background: none; border: none; color: var(--text-tertiary);
cursor: pointer; font-size: 11px; padding: 0 2px;
border-radius: 3px; opacity: 0; transition: opacity 0.1s;
margin-left: 4px;
}
.editor-tab:hover .editor-tab-close { opacity: 1; }
.editor-tab-close:hover { background: var(--hover); color: var(--text-primary); }
/* ── Code Editor Area ────────────────────── */
.editor-code-area {
flex: 1; min-height: 0; position: relative; overflow: hidden;
}
.editor-cm-wrap {
position: absolute; inset: 0; overflow: hidden;
}
.editor-cm-wrap .cm-editor { height: 100%; }
.editor-cm-wrap .cm-scroller { overflow: auto; }
/* Textarea fallback */
.editor-textarea-fallback {
width: 100%; height: 100%; resize: none; border: none; outline: none;
background: var(--bg-primary); color: var(--text-primary);
font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
font-size: 13px; line-height: 1.5;
padding: 8px 12px; box-sizing: border-box;
tab-size: 4;
}
/* Welcome screen */
.editor-welcome {
position: absolute; inset: 0;
display: flex; align-items: center; justify-content: center;
}
.editor-welcome-inner { text-align: center; color: var(--text-tertiary); }
.editor-welcome-inner p { margin: 8px 0; font-size: 14px; }
.editor-welcome-hint { font-size: 12px; opacity: 0.6; }
.editor-welcome-hint kbd {
background: var(--hover); border: 1px solid var(--border);
border-radius: 3px; padding: 1px 5px; font-size: 11px;
font-family: inherit;
}
/* ── Chat Panel (right pane) ─────────────── */
.editor-chat-header {
padding: 6px 12px; font-size: 12px; font-weight: 600;
color: var(--text-secondary); border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.editor-chat-messages {
flex: 1; overflow-y: auto; min-height: 0;
}
/* Inherit chat message styles when embedded */
.editor-chat-messages .messages { height: auto; overflow: visible; }
.editor-chat-input { flex-shrink: 0; }
/* Inherit input-area styles */
.editor-chat-input .input-area { border-top: 1px solid var(--border); }
/* ── Status Bar (footer) ─────────────────── */
.editor-status-bar {
display: flex; align-items: center; gap: 8px;
padding: 2px 12px; font-size: 11px;
color: var(--text-tertiary);
border-top: 1px solid var(--border);
min-height: 22px; flex-shrink: 0;
background: var(--bg-secondary);
}
.editor-status-sep { opacity: 0.3; }
.editor-status-right { margin-left: auto; }
.editor-status-branch { font-size: 11px; }
.editor-status-file { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ── Context Menu ────────────────────────── */
.editor-ctx-menu {
position: fixed; z-index: 1000;
background: var(--bg-primary); border: 1px solid var(--border);
border-radius: 6px; padding: 4px 0;
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
min-width: 120px; font-size: 13px;
}
.editor-ctx-item {
padding: 6px 12px; cursor: pointer;
color: var(--text-primary);
}
.editor-ctx-item:hover { background: var(--hover); }
/* ── Quick Open Overlay ──────────────────── */
.editor-quick-open {
position: fixed; inset: 0; z-index: 2000;
background: rgba(0,0,0,0.4);
display: flex; align-items: flex-start; justify-content: center;
padding-top: 15vh;
}
.editor-qo-dialog {
background: var(--bg-primary); border: 1px solid var(--border);
border-radius: 8px; width: 460px; max-width: 90vw;
box-shadow: 0 8px 32px rgba(0,0,0,0.3);
overflow: hidden;
}
.editor-qo-input {
width: 100%; padding: 10px 14px; font-size: 14px;
border: none; outline: none; box-sizing: border-box;
background: var(--bg-primary); color: var(--text-primary);
border-bottom: 1px solid var(--border);
}
.editor-qo-results { max-height: 300px; overflow-y: auto; }
.editor-qo-row {
padding: 6px 14px; cursor: pointer; font-size: 13px;
display: flex; align-items: center; gap: 6px;
color: var(--text-primary);
}
.editor-qo-row:hover { background: var(--hover); }
.editor-qo-icon { font-size: 14px; flex-shrink: 0; }
/* ── Mobile: single pane ─────────────────── */
@media (max-width: 768px) {
.editor-main { flex-direction: column; }
.editor-left-pane { flex: 1 !important; min-width: 0; }
.editor-right-pane { min-width: 0; border-left: none; border-top: 1px solid var(--border); max-height: 40vh; }
.editor-split-handle { display: none; }
}