GUI: Splitter zwischen Liste und Detail (340-680px, persistent)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0113vDKdSNtD3Dwcw4QMu9yV
This commit is contained in:
co-authored by
Claude Fable 5
parent
f7c50b2b6b
commit
2c9015dd7c
@@ -289,8 +289,29 @@ function viewRecordings() {
|
||||
v.innerHTML = `
|
||||
<div class="rec-layout">
|
||||
<aside class="rec-list-pane"><div id="reclist" class="list">Lade…</div></aside>
|
||||
<div class="rec-splitter" title="Ziehen: Listenbreite ändern"></div>
|
||||
<section class="rec-detail-pane"><div id="detail"><div class="detail-empty muted">← Aufnahme wählen</div></div></section>
|
||||
</div>`;
|
||||
// Draggable splitter: list width between LIST_MIN (the old fixed width) and
|
||||
// twice that; persisted for all sessions.
|
||||
const LIST_MIN = 340, LIST_MAX = 680;
|
||||
const listPane = v.querySelector('.rec-list-pane');
|
||||
const applyW = (w) => { listPane.style.flex = `0 0 ${Math.min(LIST_MAX, Math.max(LIST_MIN, w))}px`; };
|
||||
applyW(+localStorage.getItem('aime-list-width') || LIST_MIN);
|
||||
v.querySelector('.rec-splitter').onmousedown = (e) => {
|
||||
e.preventDefault();
|
||||
const startX = e.clientX, startW = listPane.getBoundingClientRect().width;
|
||||
document.body.classList.add('resizing');
|
||||
const move = (ev) => applyW(startW + (ev.clientX - startX));
|
||||
const up = () => {
|
||||
document.removeEventListener('mousemove', move);
|
||||
document.removeEventListener('mouseup', up);
|
||||
document.body.classList.remove('resizing');
|
||||
localStorage.setItem('aime-list-width', Math.round(listPane.getBoundingClientRect().width));
|
||||
};
|
||||
document.addEventListener('mousemove', move);
|
||||
document.addEventListener('mouseup', up);
|
||||
};
|
||||
refreshRecList();
|
||||
if (state.selectedId != null) openRecording(state.selectedId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user