Add tab bar with open/close/switch for multi-note editing

- Replace single selectedNote with tabs state in App (open/close/switch)
- Tab bar above editor: title + x close button, active tab highlighted
- Clicking note opens new tab or switches to existing
- Closing active tab switches to adjacent tab
- Fix race condition: editor re-creates when tab content loads async
- Add Playwright test verifying multi-tab behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-02-14 20:15:44 +01:00
parent 72bc90e3be
commit eb87c0d223
4 changed files with 182 additions and 37 deletions

View File

@@ -21,6 +21,66 @@
margin: 8px 0;
}
/* Tab bar */
.editor__tab-bar {
display: flex;
background: #16162a;
border-bottom: 1px solid #2a2a4a;
overflow-x: auto;
flex-shrink: 0;
}
.editor__tab-bar::-webkit-scrollbar {
height: 0;
}
.editor__tab {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
font-size: 12px;
color: #888;
cursor: pointer;
border-right: 1px solid #2a2a4a;
white-space: nowrap;
max-width: 180px;
flex-shrink: 0;
}
.editor__tab:hover {
background: #1e1e3a;
color: #ccc;
}
.editor__tab--active {
background: #0f0f1a;
color: #e0e0e0;
border-bottom: 2px solid #4a9eff;
}
.editor__tab-title {
overflow: hidden;
text-overflow: ellipsis;
}
.editor__tab-close {
background: none;
border: none;
color: #666;
cursor: pointer;
font-size: 14px;
padding: 0 2px;
line-height: 1;
border-radius: 3px;
}
.editor__tab-close:hover {
background: #3a3a5a;
color: #e0e0e0;
}
/* CodeMirror container */
.editor__cm-container {
flex: 1;
overflow: auto;