From e246a48b90778f391fa423606f6b9e502c8d7d33 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Wed, 11 Jun 2025 15:28:17 +0200 Subject: [PATCH] Add overlay scrollbars with custom styling --- index.html | 4 ++ package-lock.json | 47 +++++++------ package.json | 2 + public/index.css | 19 ++--- src/components/Border.svelte | 6 +- src/components/InboxButton.svelte | 16 +++++ src/components/Sidebar.svelte | 2 +- src/views/repo/Layout.svelte | 111 +++++++++++++++--------------- 8 files changed, 119 insertions(+), 88 deletions(-) diff --git a/index.html b/index.html index 89e6b13bc..3de28630c 100644 --- a/index.html +++ b/index.html @@ -65,6 +65,10 @@ +
@@ -148,18 +107,62 @@
{/if} -
+ style={`padding-left: ${hideSidebar ? "1rem" : "0"}; ${oneColumnLayout && !hideSidebar ? "display: none;" : ""}; overflow: ${styleSecondColumnOverflow}`} + events={{ + scroll: instance => { + const secondColumnContainer = instance.elements().target; + if ( + loadMoreSecondColumn && + secondColumnContainer.scrollTop + + secondColumnContainer.clientHeight >= + secondColumnContainer.scrollHeight / 2 && + loadingSecondColumn === false + ) { + loadingSecondColumn = true; + void loadMoreSecondColumn().finally( + () => (loadingSecondColumn = false), + ); + } + }, + }} + options={{ + overflow: { x: "visible" }, + scrollbars: { + theme: "os-theme-radicle", + autoHide: "scroll", + }, + }} + defer> {@render secondColumn()} -
+ -
+ { + const contentContainer = instance.elements().target; + if ( + loadMoreContent && + contentContainer.scrollTop + contentContainer.clientHeight >= + contentContainer.scrollHeight / 2 && + loadingContent === false + ) { + loadingContent = true; + void loadMoreContent().finally(() => (loadingContent = false)); + } + }, + }} + style="grid-column: 3/4; width: 100%;" + options={{ + scrollbars: { + theme: "os-theme-radicle", + autoHide: "scroll", + }, + }} + defer> {@render children()} -
+