Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat: add custom scrollbar to block-md (#338)

Jacob Beckerman14b94e3f89e8
diff --git a/js/app/bun.lock b/js/app/bun.lock
index ee906ba21e..b7035b583c 100644
--- a/js/app/bun.lock
+++ b/js/app/bun.lock
@@ -1,5 +1,6 @@
{
"lockfileVersion": 1,
+ "configVersion": 0,
"workspaces": {
"": {
"name": "@coparse/monorepo",
diff --git a/js/app/packages/block-channel/component/MessageList/MessageList.tsx b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
index 8dc1fed9d6..9ccc825252 100644
--- a/js/app/packages/block-channel/component/MessageList/MessageList.tsx
+++ b/js/app/packages/block-channel/component/MessageList/MessageList.tsx
@@ -12,6 +12,7 @@ import {
createMessageListContextLookup,
type MessageListContextLookup,
} from '@block-channel/utils/listContext';
+import { CustomScrollbar } from '@core/component/CustomScrollbar';
import { TextButton } from '@core/component/TextButton';
import { observedSize } from '@core/directive/observedSize';
import type { InputAttachment } from '@core/store/cacheChannelInput';
@@ -39,7 +40,6 @@ import {
} from 'solid-js';
import { createStore, reconcile } from 'solid-js/store';
import { type VirtualizerHandle, VList } from 'virtua/solid';
-import { CustomScrollbar } from '../../../macro-entity/src/components/CustomScrollbar';
import { MessageContainer } from '../Message/MessageContainer';
import { ReplyInputsPortaler } from '../ReplyInputsPortaler';
diff --git a/js/app/packages/block-md/component/Block.tsx b/js/app/packages/block-md/component/Block.tsx
index f97d8f3c7c..1854448bbf 100644
--- a/js/app/packages/block-md/component/Block.tsx
+++ b/js/app/packages/block-md/component/Block.tsx
@@ -1,6 +1,7 @@
import { useGlobalNotificationSource } from '@app/component/GlobalAppState';
import { withAnalytics } from '@coparse/analytics';
import { useBlockId } from '@core/block';
+import { CustomScrollbar } from '@core/component/CustomScrollbar';
import { DocumentBlockContainer } from '@core/component/DocumentBlockContainer';
import { DocumentDebouncedNotificationReadMarker } from '@notifications';
import { useInstructionsMdIdQuery } from '@service-storage/instructionsMd';
@@ -54,13 +55,10 @@ export default function BlockMarkdown() {
notificationSource={notificationSource}
documentId={blockId}
/>
- <div class="w-full grow overflow-hidden" data-block-content>
+ <div class="w-full grow overflow-hidden relative" data-block-content>
<div
- class="w-full h-full relative overflow-auto portal-scope"
+ class="w-full h-full relative overflow-auto portal-scope scrollbar-hidden"
ref={setScrollRef}
- style={{
- 'scrollbar-gutter': 'stable',
- }}
>
<Show
when={!isInstructionsMd()}
@@ -69,6 +67,7 @@ export default function BlockMarkdown() {
<Notebook />
</Show>
</div>
+ <CustomScrollbar scrollContainer={scrollRef} />
</div>
</div>
</DocumentBlockContainer>
diff --git a/js/app/packages/macro-entity/src/components/CustomScrollbar.tsx b/js/app/packages/core/component/CustomScrollbar.tsx
similarity index 100%
rename from js/app/packages/macro-entity/src/components/CustomScrollbar.tsx
rename to js/app/packages/core/component/CustomScrollbar.tsx
diff --git a/js/app/packages/macro-entity/src/components/UnifiedInfiniteList.tsx b/js/app/packages/macro-entity/src/components/UnifiedInfiniteList.tsx
index 6b1cad6613..75ca4250af 100644
--- a/js/app/packages/macro-entity/src/components/UnifiedInfiniteList.tsx
+++ b/js/app/packages/macro-entity/src/components/UnifiedInfiniteList.tsx
@@ -1,3 +1,4 @@
+import { CustomScrollbar } from '@core/component/CustomScrollbar';
import Fragment from '@core/util/Fragment';
import { onElementConnect } from '@solid-primitives/lifecycle';
import { debounce } from '@solid-primitives/scheduled';
@@ -36,7 +37,6 @@ import type {
EntityRenderer,
} from '../types/entity';
import type { WithSearch } from '../types/search';
-import { CustomScrollbar } from './CustomScrollbar';
import { Entity } from './Entity';
/**