From 066bf1d285aae0b1f8da4ab80a5d17d973e6e463 Mon Sep 17 00:00:00 2001 From: Ben Floyd Date: Wed, 24 Sep 2025 19:10:47 -0600 Subject: [PATCH] positioning --- main.ts | 8 ++++++++ styles.css | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/main.ts b/main.ts index ce350cf..702b492 100644 --- a/main.ts +++ b/main.ts @@ -64,6 +64,8 @@ export default class StreamsPlugin extends Plugin { // Create global stream indicator this.createGlobalStreamIndicator(); + // No need for dynamic positioning - CSS handles it automatically + this.isInitializing = false; this.log.info('Streams plugin loaded'); } @@ -188,6 +190,8 @@ export default class StreamsPlugin extends Plugin { new Notice('Global stream indicator refreshed'); } }); + + // No positioning commands needed - CSS handles it automatically } private logInitialState(): void { @@ -317,6 +321,8 @@ export default class StreamsPlugin extends Plugin { existingIndicator.remove(); } + // No observers to clean up + this.commandsByStreamId.clear(); } @@ -771,6 +777,8 @@ export default class StreamsPlugin extends Plugin { this.createGlobalStreamIndicator(); } } + + // Positioning is now handled automatically by CSS - no JavaScript needed /** * Create a unique identifier for a WorkspaceLeaf diff --git a/styles.css b/styles.css index 304adcf..b6f408f 100644 --- a/styles.css +++ b/styles.css @@ -145,7 +145,7 @@ } .streams-calendar-component { - position: fixed; + position: absolute; top: 0; left: 0; right: 0; @@ -162,8 +162,18 @@ padding: 0 14px; } -/* Ensure content starts below the fixed bar */ -body { +/* Position relative to the content container that contains cm-panels */ +.streams-markdown-view-content { + position: relative; +} + +.streams-markdown-view-content .streams-calendar-component { + position: absolute; + top: 0; +} + +/* Ensure content starts below the streams bar */ +.view-content { padding-top: 32px !important; }