Refactor GraphView with floating sidebar and zoom controls

- Move graph options from left panel to floating sidebar in GraphView
- Add zoom controls (fit, +, -) in top-right corner
- Add dynamic legend showing active categories
- Add cleanup system to View base class for event listeners
- Update delegateEvent to return cleanup function
- Filter nodes by category before rendering
- Fix text color variable (--text-primary to --text)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
ARCHITECT
2026-01-14 00:07:26 +00:00
parent f55945fdb8
commit 131e198851
7 changed files with 424 additions and 325 deletions

View File

@@ -53,12 +53,14 @@ export class GridView extends View {
}
private bindEvents(): void {
const state = this.getState();
delegateEvent<MouseEvent>(this.container, '.card', 'click', (_, target) => {
this.cleanupListeners();
const cleanup = delegateEvent<MouseEvent>(this.container, '.card', 'click', (_, target) => {
const mrf = target.dataset.mrf;
if (!mrf) return;
// Obtener estado FRESCO en cada click (no del closure)
const state = this.getState();
if (state.selectionMode) {
const newSelected = new Set(state.selected);
if (newSelected.has(mrf)) {
@@ -71,5 +73,6 @@ export class GridView extends View {
this.showDetail(mrf);
}
});
this.addCleanup(cleanup);
}
}