fix(editor): fold fence parity, search bar layout and per-tab scroll memory

This commit is contained in:
2026-11-06 10:03:23 +08:00
parent 2117551af7
commit 9f12b91a14
4 changed files with 65 additions and 24 deletions

View File

@@ -441,12 +441,15 @@ body.editing.cm-active #cm-editor { display: block; height: 100%; padding: 10px
/* Edit-mode find/replace bar: same look as the preview findbar. */
html.cm-editing { overflow: hidden; scrollbar-gutter: auto; }
#edit-findbar { top: calc(var(--chrome-top) + 8px); z-index: 130; flex-wrap: wrap; }
body.edit-finding #edit-findbar { display: flex; }
#edit-findbar .edit-replace-group { display: flex; flex: 1 0 100%; align-items: center; gap: 6px; justify-content: flex-start; border-top: 1px solid rgba(0,0,0,.08); padding-top: 6px; margin-top: 2px; }
#edit-findbar .edit-replace-group[hidden] { display: none; }
#edit-findbar #edit-replace-input { width: 160px; }
#edit-findbar button.edit-replace-btn { width: auto; min-width: 54px; padding: 0 8px; font-size: 12px; }
#edit-findbar { top: calc(var(--chrome-top) + 8px); z-index: 130; width: min(560px, calc(100vw - 32px)); padding: 8px 10px; }
body.edit-finding #edit-findbar { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
#edit-findbar .edit-find-row { display: flex; align-items: center; gap: 6px; width: 100%; }
#edit-findbar .edit-find-row input { flex: 1 1 auto; width: auto; min-width: 0; }
#edit-findbar .edit-replace-row { display: flex; align-items: center; gap: 6px; width: 100%; border-top: 1px solid rgba(0,0,0,.08); padding-top: 6px; }
#edit-findbar .edit-replace-row[hidden] { display: none; }
#edit-findbar #edit-replace-input { flex: 1 1 auto; width: auto; min-width: 0; }
#edit-findbar button.edit-replace-btn { width: auto; height: 28px; min-width: 64px; padding: 0 10px; border: 1px solid #e2e2e2; border-radius: 7px; background: #f2f2f2; color: #333; font-size: 12px; }
#edit-findbar button.edit-replace-btn:hover { background: #e7e7e7; color: #111; }
#cm-editor .cm-edit-find-hit { background: rgba(255, 213, 0, .38); }
/* Use the same thin scrollbar inside CodeMirror as the preview container. */
@@ -459,5 +462,7 @@ body.edit-finding #edit-findbar { display: flex; }
#app::-webkit-scrollbar-thumb:hover { background: rgba(200,200,200,.55); }
#cm-editor .CodeMirror-vscrollbar::-webkit-scrollbar-thumb { background: rgba(200,200,200,.35); }
#cm-editor .CodeMirror-vscrollbar::-webkit-scrollbar-thumb:hover { background: rgba(200,200,200,.55); }
#edit-findbar .edit-replace-group { border-top-color: rgba(255,255,255,.12); }
#edit-findbar .edit-replace-row { border-top-color: rgba(255,255,255,.12); }
#edit-findbar button.edit-replace-btn { background: #333; border-color: #4a4a4a; color: #ddd; }
#edit-findbar button.edit-replace-btn:hover { background: #3d3d3d; color: #fff; }
}