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.

fix(styles): dialog styles, bracket fixes, share contrast, scroll container (#589)

Fake-User1b28306108f1
diff --git a/js/app/packages/app/component/UnifiedListView.tsx b/js/app/packages/app/component/UnifiedListView.tsx
index 4861b7c78c..629757cc2e 100644
--- a/js/app/packages/app/component/UnifiedListView.tsx
+++ b/js/app/packages/app/component/UnifiedListView.tsx
@@ -1297,10 +1297,10 @@ export function UnifiedListView(props: UnifiedListViewProps) {
<div class="grid divide-y divide-edge">
<section class="gap-1 grid p-2">
<ToggleSwitch
- size="SM"
- label="Important"
- checked={importantFilter()}
onChange={setImportantFilter}
+ checked={importantFilter()}
+ label="Important"
+ size="SM"
/>
<SegmentedControl
size="SM"
diff --git a/js/app/packages/app/component/command/Konsole.tsx b/js/app/packages/app/component/command/Konsole.tsx
index fd1bd44b37..efbc872577 100644
--- a/js/app/packages/app/component/command/Konsole.tsx
+++ b/js/app/packages/app/component/command/Konsole.tsx
@@ -1,8 +1,9 @@
import { useChannelsContext } from '@core/component/ChannelsProvider';
+import { ClippedPanel } from '@core/component/ClippedPanel';
+import { ToggleSwitch } from '@core/component/FormControls/ToggleSwitch';
import { StaticMarkdownContext } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
import { ENABLE_SEARCH_PAGINATION } from '@core/constant/featureFlags';
import type { CommandWithInfo } from '@core/hotkey/getCommands';
-import { cornerClip } from '@core/util/clipPath';
import { createFreshSearch } from '@core/util/freshSort';
import { Popover } from '@kobalte/core';
import { Command as CommandK, useCommandState } from 'cmdk-solid';
@@ -45,6 +46,7 @@ import {
konsoleOpen,
lastCommandTime,
rawQuery,
+ setKonsoleMode,
setLastCommandTime,
setRawQuery,
toggleKonsoleVisibility,
@@ -97,32 +99,10 @@ export function KommandMenu() {
<Popover.Portal>
<CommandWindow>
<Popover.Content>
- <div class="bg-dialog mt-[25vh] border-2 border-accent w-6xl max-w-[90vw] max-h-[75vh] overflow-hidden">
- <div
- class="left-0 absolute bg-accent py-1.5 pr-10 pl-2 font-mono font-black text-menu text-xs -translate-y-full"
- style={{ 'clip-path': cornerClip(0, '1.5rem', 0, 0) }}
- >
- <svg
- fill="none"
- viewBox="0 0 127 16"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- class="h-2"
- >
- <clipPath id="a">
- <path d="m.599609 0h125.8v16h-125.8z" />
- </clipPath>
- <g clip-path="url(#a)" fill="currentColor">
- <path d="m108.249 0c-2.397 0-4.381 1.94809-4.381 4.30241v7.37539c0 2.3543 1.984 4.3024 4.381 4.3024h13.769c2.398 0 4.382-1.9481 4.382-4.3024v-7.37539c0-2.35432-1.984-4.30241-4.382-4.30241zm0 3.68767h13.769c.368 0 .626.25328.626.61455v7.37538c0 .3612-.258.6145-.626.6145h-13.769c-.368 0-.626-.2533-.626-.6145v-7.37519c0-.36126.258-.61474.626-.61474z" />
- <path d="m78.8333 0v15.98h3.7552v-4.917h11.6697l2.5034 4.917h4.1994l-2.6237-5.1522c1.7427-.5698 3.0277-2.1784 3.0277-4.067v-2.45839c0-2.35432-1.984-4.30241-4.3815-4.30241zm3.7552 3.68767h14.395c.3679 0 .6258.25328.6258.61455v2.45838c0 .36127-.2579.61455-.6258.61455h-14.395z" />
- <path d="m58.1792 0c-2.3972 0-4.381 1.94809-4.381 4.30241v7.37539c0 2.3543 1.9838 4.3024 4.381 4.3024h18.1505v-3.6877h-18.1505c-.3679 0-.6258-.2533-.6258-.6145v-7.37559c0-.36126.2579-.61454.6258-.61454h18.1505v-3.68787z" />
- <path d="m33.1443.0200268c-2.3974 0-4.381 1.9480932-4.381 4.3024132v11.67776h3.7552v-4.9374h15.0209v4.9374h3.7552v-11.67776c0-2.35432-1.9836-4.3024132-4.381-4.3024132zm0 3.6876732h13.7693c.3678 0 .6258.25328.6258.61454v3.05271h-15.0209v-3.05271c0-.36126.2579-.61454.6258-.61454z" />
- <path d="m.599609 0v15.98h3.755211v-12.29233h2.35626c.19253 0 .38028.05969.53603.17082.15595.11093.27211.26761.33189.44746l3.8762 11.67425h3.9495l3.888-11.70783c.0564-.16983.1659-.31787.3131-.42291.1473-.10505.3245-.16159.5064-.16159h2.3931v12.29233h3.7552v-15.9802h-8.873c-.1819 0-.3591.0567425-.5064.161588-.1472.105043-.2568.253084-.3131.422918l-3.138 9.447894-3.1379-9.447894c-.0563-.169834-.1659-.317875-.31326-.422918-.14715-.1050419-.3245-.161588-.50644-.161588z" />
- </g>
- </svg>
- </div>
-
- <KommandMenuInner commandKRef={commandKRef} />
+ <div class="bg-dialog mt-[25vh] w-6xl max-w-[90vw] max-h-[75vh] overflow-hidden">
+ <ClippedPanel tl active>
+ <KommandMenuInner commandKRef={commandKRef} />
+ </ClippedPanel>
</div>
</Popover.Content>
</CommandWindow>
@@ -335,7 +315,7 @@ export function KommandMenuInner(props: {
return (
<CommandK
label="Global CommandK Menu"
- class="flex flex-col gap-px bg-accent w-full"
+ class="flex flex-col gap-px w-full"
value={currentValue()}
shouldFilter={false}
onValueChange={(value) => {
@@ -343,26 +323,34 @@ export function KommandMenuInner(props: {
setCurrentValue(value);
}}
>
- <div
- class="flex items-center gap-2 bg-menu p-3"
- style={{ 'clip-path': cornerClip(0, 0, '0.25rem', '0.25rem') }}
- >
- <span class="text-accent">❯</span>
+ <div class="flex items-center gap-2 bg-panel px-2 h-[40px] border-b border-edge-muted">
+ <span class="pl-2 pointer-events-none">❯</span>
<CommandK.Input
- value={rawQuery()}
- placeholder="Search files..."
- class="flex-1 border-0 outline-none! focus:outline-none ring-0! focus:ring-0 font-mono placeholder:text-edge text-accent-270"
+ class="flex-1 border-0 outline-none! focus:outline-none ring-0! focus:ring-0 font-mono"
onValueChange={setRawQuery}
+ placeholder="Search"
+ value={rawQuery()}
+ autofocus
+ />
+ <ToggleSwitch
+ onChange={(val) => {
+ if (val) {
+ setKonsoleMode('FULL_TEXT_SEARCH');
+ } else {
+ setKonsoleMode('ENTITY_SEARCH');
+ }
+ }}
+ checked={isFullTextSearch()}
+ // switchRootClass='subtle'
+ label="Full Text Search"
+ size="SM"
/>
</div>
- <div
- class="bg-menu"
- style={{ 'clip-path': cornerClip('0.25rem', '0.25rem', 0, 0) }}
- >
+ <div class="bg-panel">
<KonsoleFilter />
<CommandK.List class="scrollbar-hidden">
<CommandK.Empty>
- <div class="px-2 pb-2 text-ink-muted">
+ <div class="px-2 text-ink-muted min-h-[40px]">
{currentKonsoleMode() === 'FULL_TEXT_SEARCH' &&
cleanQuery().length < 3
? 'Enter 3 or more characters to search all documents.'
@@ -375,7 +363,7 @@ export function KommandMenuInner(props: {
<VList
data={filteredItems()}
style={{ height: containerHeight() }}
- class="scrollbar-hidden pb-2 bg-dialog"
+ class="scrollbar-hidden pb-2 bg-panel"
>
{(item, index) => (
<CommandKItemWrapper index={index()} item={item} />
diff --git a/js/app/packages/app/component/command/KonsoleFilter.tsx b/js/app/packages/app/component/command/KonsoleFilter.tsx
index 1adf5527d9..1f6dd87cd5 100644
--- a/js/app/packages/app/component/command/KonsoleFilter.tsx
+++ b/js/app/packages/app/component/command/KonsoleFilter.tsx
@@ -1,12 +1,5 @@
-import { TextButton } from '@core/component/TextButton';
-import {
- createEffect,
- createSignal,
- For,
- onCleanup,
- onMount,
- Show,
-} from 'solid-js';
+import { SegmentedControl } from '@core/component/FormControls/SegmentControls';
+import { createMemo, onCleanup, onMount } from 'solid-js';
import {
commandCategoryIndex,
searchCategories,
@@ -15,8 +8,35 @@ import {
import { konsoleOpen } from './state';
export function KonsoleFilter() {
- const [containerRef, setContainerRef] = createSignal<HTMLDivElement>();
- const buttonRefs: HTMLDivElement[] = [];
+ const visibleCategories = createMemo(() => {
+ return searchCategories
+ .listVisible()
+ .map((category, index) => {
+ if (searchCategories.isCategoryActive(index)) {
+ return category.name;
+ }
+ return null;
+ })
+ .filter(Boolean) as string[];
+ });
+
+ const selectedCategoryName = createMemo(() => {
+ const categories = searchCategories.listVisible();
+ const index = commandCategoryIndex();
+ if (index >= 0 && index < categories.length) {
+ return categories[index].name;
+ }
+ return categories[0]?.name || '';
+ });
+
+ const handleCategoryChange = (categoryName: string) => {
+ const index = searchCategories
+ .listVisible()
+ .findIndex((cat) => cat.name === categoryName);
+ if (index !== -1) {
+ setCommandCategoryIndex(index);
+ }
+ };
onMount(() => {
const down = (e: KeyboardEvent) => {
@@ -48,62 +68,14 @@ export function KonsoleFilter() {
});
});
- // Scroll selected category into view when selection changes
- createEffect(() => {
- const container = containerRef();
- const selectedIndex = commandCategoryIndex();
-
- if (container && buttonRefs[selectedIndex]) {
- const selectedButtonDiv = buttonRefs[selectedIndex];
-
- // Use requestAnimationFrame to ensure DOM updates are complete
- requestAnimationFrame(() => {
- const containerRect = container.getBoundingClientRect();
- const buttonRect = selectedButtonDiv.getBoundingClientRect();
-
- const isFullyVisible =
- buttonRect.left >= containerRect.left &&
- buttonRect.right <= containerRect.right;
-
- if (!isFullyVisible) {
- // For rightmost items like "Companies", scroll to show them fully
- // Add some padding so the button isn't right at the edge
- const scrollLeft =
- selectedButtonDiv.offsetLeft -
- container.clientWidth +
- selectedButtonDiv.offsetWidth +
- 8;
- container.scrollTo({
- left: Math.max(0, scrollLeft),
- behavior: 'smooth',
- });
- }
- });
- }
- });
-
return (
- <div
- ref={setContainerRef}
- class="flex pb-4 overflow-x-auto scrollbar-hidden bg-transparent"
- >
- <For each={searchCategories.listVisible()}>
- {(item, index) => (
- <Show when={searchCategories.isCategoryActive(index())}>
- <TextButton
- ref={(el) => {
- if (el) buttonRefs[index()] = el;
- }}
- theme={
- index() === commandCategoryIndex() ? 'accentFill' : 'clear'
- }
- text={item.name}
- onMouseDown={() => setCommandCategoryIndex(index())}
- class="flex-shrink-0 h-auto *:h-7 *:px-2"
- />
- </Show>
- )}
- </For>
+ <div class="flex items-center bg-transparent border-b px-2 border-edge-muted/50 h-[40px]">
+ <SegmentedControl
+ onChange={handleCategoryChange}
+ value={selectedCategoryName()}
+ list={visibleCategories()}
+ size="SM"
+ />
</div>
);
}
diff --git a/js/app/packages/app/component/command/state.ts b/js/app/packages/app/component/command/state.ts
index e1c1a01633..5cfd585a2a 100644
--- a/js/app/packages/app/component/command/state.ts
+++ b/js/app/packages/app/component/command/state.ts
@@ -44,7 +44,7 @@ export function cleanQuery(query?: string) {
}
export const COMMAND_MODES = [
- // { id: 'FULL_TEXT_SEARCH', sigil: '%', label: 'Full Text Search' },
+ { id: 'FULL_TEXT_SEARCH', sigil: '%', label: 'Full Text Search' },
// { id: "REGEX_SEARCH", sigil: "/", label: "Regex Search" },
// { id: "RUN_COMMAND", sigil: ">", label: "Run" },
// { id: "TEMP_CHAT", sigil: " ", label: "Temporary Chat" },
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index 374428de68..ee80d929a8 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -212,7 +212,7 @@
--color-task: var(--theme-task);
--color-task-bg: color-mix(in srgb, var(--color-task), var(--color-panel) 90%);
-
+
/* SCUFFED We probably want to let the theme determine 3 or 4 "extra" hue offsets. Rights now these are only being */
/* used as debug colors and to improve the consistency of markdown block lightness/chroma with themed css */
--color-accent-30: oklch(var(--a0l) var(--a0c) calc(var(--a0h) + 30deg));
@@ -243,6 +243,13 @@
--color-focus: var(--color-accent);
}
+/*
+*{
+ scrollbar-width: thin;
+ scrollbar-color: var(--color-accent);
+}
+*/
+
/* NOTE: We use this as a compile-time css util in this file to be able reuse the
* declarations while still being able to override the color. */
@utility util-bracket-bg-image {
@@ -320,6 +327,10 @@
}
}
+@utility hide-scrollbar {
+ scrollbar-width: none;
+}
+
@utility bracket-* {
background-image:
conic-gradient(from 90deg at top 1px left 1px, #0000 90deg, var(--color-focus) 0),
diff --git a/js/app/packages/block-channel/component/ParticipantManager.tsx b/js/app/packages/block-channel/component/ParticipantManager.tsx
index 6d8516d8c8..6426310c4f 100644
--- a/js/app/packages/block-channel/component/ParticipantManager.tsx
+++ b/js/app/packages/block-channel/component/ParticipantManager.tsx
@@ -6,6 +6,8 @@ import {
useAddParticipantsToChannel,
useRemoveParticipantsFromChannel,
} from '@block-channel/signal/participants';
+import { ClippedPanel } from '@core/component/ClippedPanel';
+import { IconButton } from '@core/component/IconButton';
import { getDestinationFromOptions } from '@core/component/NewMessage';
import { RecipientSelector } from '@core/component/RecipientSelector';
import { TextButton } from '@core/component/TextButton';
@@ -18,7 +20,7 @@ import {
} from '@core/user';
import InvitedIcon from '@icon/regular/paper-plane-tilt.svg';
import UsersIcon from '@icon/regular/users.svg';
-import XIcon from '@icon/regular/x.svg';
+import CloseIcon from '@icon/regular/x.svg';
import { Dialog } from '@kobalte/core/dialog';
import BracketLeft from '@macro-icons/macro-group-bracket-left.svg';
import type { ChannelParticipant } from '@service-comms/generated/models/channelParticipant';
@@ -82,59 +84,56 @@ export function ParticipantManager(props: { participantCount: number }) {
</Dialog.Trigger>
<Dialog.Portal>
- <Dialog.Overlay class="fixed flex inset-0 z-modal bg-modal-overlay items-center justify-content" />
+ <Dialog.Overlay class="fixed flex inset-0 z-modal bg-modal-overlay pattern-edge-muted pattern-diagonal-4 items-center justify-content" />
<div class="fixed inset-0 z-modal w-screen h-screen flex items-center justify-center bg-transparent">
- <Dialog.Content class="w-[512px] bg-dialog rounded-lg border-edge-muted border-1 shadow-lg">
- <div class="flex flex-row justify-between items-center p-4">
- <Dialog.Title class="font-medium text-2xl text-ink-muted">
- {title()}
- </Dialog.Title>
- <Dialog.CloseButton class="text-ink-muted hover:bg-hover hover-transition-bg rounded-md p-1">
- <XIcon class="w-5 h-5" />
- </Dialog.CloseButton>
- </div>
- <Show
- when={
- channelType() &&
- ['private'].includes(channelType()!) &&
- isChannelAdminOrOwnerMemo()
- }
- >
- <div class="flex flex-col justify-between items-start px-4 gap-2 py-1 pt-2 text-ink-muted">
- <h1 class="justify-start items-start text-ink-muted text-sm font-medium font-sans">
- Invite Participants
- </h1>
- <RecipientSelector<'user'>
- placeholder={'Add participant'}
- options={options}
- selectedOptions={usersToInvite}
- setSelectedOptions={setUsersToInvite}
- />
- <div class="flex w-full flex-row justify-end items-center">
+ <Dialog.Content class="w-[512px]">
+ <ClippedPanel tl>
+ <div class="flex flex-row items-center px-2 h-[40px] gap-2 border-b-1 border-b-edge-muted">
+ <Dialog.CloseButton>
+ <IconButton
+ tooltip={{ label: 'Close' }}
+ icon={CloseIcon}
+ iconSize={16}
+ theme="clear"
+ size="sm"
+ />
+ </Dialog.CloseButton>
+ <Dialog.Title class="text-sm">{title()}</Dialog.Title>
+ </div>
+ <Show
+ when={
+ channelType() &&
+ ['private'].includes(channelType()!) &&
+ isChannelAdminOrOwnerMemo()
+ }
+ >
+ <div class="flex flex-row justify-between gap-2 h-[40px] text-ink-muted border-b border-edge-muted/50 px-2 items-center">
+ <RecipientSelector<'user'>
+ setSelectedOptions={setUsersToInvite}
+ selectedOptions={usersToInvite}
+ placeholder={'Search'}
+ options={options}
+ hideBorder
+ noPadding
+ />
<TextButton
- theme="accent"
disabled={usersToInvite().length === 0}
- icon={InvitedIcon}
- text="Add Users"
onClick={handleAddParticipants}
+ icon={InvitedIcon}
+ text="Add Participant"
+ theme="accent"
/>
</div>
- </div>
- </Show>
+ </Show>
- <div class="flex flex-col">
- <h1 class="justify-start items-start px-4 text-ink-muted text-sm font-medium font-sans">
- Participants{' '}
- <span class="text-ink-muted font-regular">
- ({channel?.participants.length})
- </span>
- </h1>
- <ParticipantList
- editable={editable()}
- participants={channel.participants}
- userId={userId()!}
- />
- </div>
+ <div class="flex flex-col">
+ <ParticipantList
+ editable={editable()}
+ participants={channel.participants}
+ userId={userId()!}
+ />
+ </div>
+ </ClippedPanel>
</Dialog.Content>
</div>
</Dialog.Portal>
@@ -176,16 +175,16 @@ export function ParticipantList(props: {
});
return (
- <div ref={ref} class="flex flex-col px-4 py-2 w-full">
+ <div ref={ref} class="flex flex-col w-full">
<Show when={props.participants.length > 10}>
<input
- placeholder="Search participants..."
- class="w-full rounded-md border-edge-muted border-solid border p-2 text-sm text-ink-muted"
+ placeholder="Search"
+ class="w-full border-edge-muted/50 border-b-1 px-2 h-[40px] text-sm text-ink-muted"
value={searchQuery()}
onInput={(e) => setSearchQuery(e.currentTarget.value)}
/>
</Show>
- <div class="flex flex-col gap-3 max-h-[300px] w-full overflow-y-auto mt-1 overflow-x-hidden">
+ <div class="flex flex-col gap-3 max-h-[300px] w-full overflow-y-auto overflow-x-hidden">
<Show
when={filteredParticipants().length > 0}
fallback={<EmptyParticipantList query={searchQuery()} />}
@@ -193,6 +192,7 @@ export function ParticipantList(props: {
<VList
data={filteredParticipants()}
style={{
+ 'scrollbar-width': 'none',
height: '300px',
width: '100%',
}}
diff --git a/js/app/packages/block-channel/component/UserItem.tsx b/js/app/packages/block-channel/component/UserItem.tsx
index ce62987f0a..6e6325e521 100644
--- a/js/app/packages/block-channel/component/UserItem.tsx
+++ b/js/app/packages/block-channel/component/UserItem.tsx
@@ -1,9 +1,9 @@
+import { BozzyBracket } from '@core/component/BozzyBracket';
import { TruncatedText } from '@core/component/FileList/TruncatedText';
-import { DropdownMenuContent, MenuItem } from '@core/component/Menu';
+import { IconButton } from '@core/component/IconButton';
import { UserIcon } from '@core/component/UserIcon';
import { idToEmail } from '@core/user';
-import DotsThree from '@icon/bold/dots-three-bold.svg';
-import { DropdownMenu } from '@kobalte/core/dropdown-menu';
+import IconX from '@icon/regular/x.svg';
import { createSignal, Show } from 'solid-js';
export type UserItemProps = {
@@ -16,50 +16,37 @@ export type UserItemProps = {
};
export function UserItem(props: UserItemProps) {
- const [open, setOpen] = createSignal(false);
const [hovered, setHovered] = createSignal(false);
- const hoveredState = () => {
- return hovered() || open();
- };
-
return (
- <div
- class={`flex group flex-row items-center justify-between overflow-x-hidden w-full hover:bg-hover transition-none hover:transition ${hoveredState() ? 'bg-hover' : ''} p-2 rounded-sm`}
- onMouseEnter={() => setHovered(true)}
- onMouseLeave={() => setHovered(false)}
- >
- <div class="flex flex-row gap-2 items-center w-full">
- <UserIcon id={props.id} size="md" isDeleted={false} />
- <div class="flex flex-col gap-0 w-full">
- <TruncatedText>
- <p class="text-sm">{idToEmail(props.id)}</p>
- </TruncatedText>
- <p class="text-xs text-ink-muted">{props.description}</p>
+ <BozzyBracket hover={hovered()} active={false} class="w-full">
+ <div
+ class={`flex group flex-row items-center justify-between overflow-x-hidden w-full p-2`}
+ onMouseEnter={() => setHovered(true)}
+ onMouseLeave={() => setHovered(false)}
+ >
+ <div class="flex flex-row gap-2 items-center w-full">
+ <UserIcon id={props.id} size="md" isDeleted={false} />
+ <div class="flex flex-col gap-0 w-full">
+ <TruncatedText>
+ <p class="text-sm">{idToEmail(props.id)}</p>
+ </TruncatedText>
+ <p class="text-xs text-ink-muted">{props.description}</p>
+ </div>
</div>
+ <Show
+ when={props.currentUserId !== props.id && props.editable && hovered()}
+ >
+ <IconButton
+ tooltip={{ label: 'Remove participant' }}
+ icon={IconX}
+ iconSize={16}
+ theme="clear"
+ size="sm"
+ onClick={props.removeParticipant}
+ />
+ </Show>
</div>
- <Show
- when={props.currentUserId !== props.id && props.editable}
- fallback={<div />}
- >
- <DropdownMenu onOpenChange={setOpen}>
- <DropdownMenu.Trigger
- class={`${!hoveredState() ? 'hidden' : 'ring-edge shadow shadow-edge/10 scale-105 bg-menu ring-1 text-ink flex'}
- group-hover:flex flex-none h-7 w-7 p-1 mr-1
- rounded-full justify-center items-center text-ink
- hover:text-ink group-hover:bg-hover group-hover:ring-1
- group-hover:ring-edge/10 group-hover:shadow shadow-edge/10
- hover:scale-105 transition-scale duration-200 hover:bg-menu`}
- >
- <DotsThree />
- </DropdownMenu.Trigger>
- <DropdownMenu.Portal mount={props.mountPoint}>
- <DropdownMenuContent>
- <MenuItem text="Remove" onClick={props.removeParticipant} />
- </DropdownMenuContent>
- </DropdownMenu.Portal>
- </DropdownMenu>
- </Show>
- </div>
+ </BozzyBracket>
);
}
diff --git a/js/app/packages/core/component/BozzyBracket.tsx b/js/app/packages/core/component/BozzyBracket.tsx
index 11f10fa3a8..a820f7643b 100644
--- a/js/app/packages/core/component/BozzyBracket.tsx
+++ b/js/app/packages/core/component/BozzyBracket.tsx
@@ -1,11 +1,11 @@
import { createSignal, type JSX, onMount, type ParentProps } from 'solid-js';
type BozzyBracketProps = {
- active: boolean;
- class?: string;
style?: JSX.CSSProperties;
- hover?: boolean;
unfocusable?: boolean;
+ active: boolean;
+ hover?: boolean;
+ class?: string;
};
/**
@@ -29,7 +29,7 @@ export function BozzyBracket(props: ParentProps<BozzyBracketProps>) {
style={props.style}
>
<div
- class="absolute pointer-events-none left-[-1px] top-[-1px] w-[calc(100%+2px)] h-[calc(100%+2px)] z-modal"
+ class="absolute pointer-events-none left-0 top-0 w-full h-full z-modal"
classList={{
bracket: (props.active || props.hover) && !props.unfocusable,
'group-focus-within/bozzy:absolute group-focus-within/bozzy:bracket':
@@ -51,6 +51,7 @@ export function BozzyBracketInnerSibling(props: {
setTimeout(() => setBig(false));
});
}
+ /* TEST BEFORE REMOVING left-[-1px] top-[-1px] w-[calc(100%+2px)] h-[calc(100%+2px)] */
return (
<div
class="pointer-events-none absolute left-[-1px] top-[-1px] w-[calc(100%+2px)] h-[calc(100%+2px)] bracket-offset-2"
diff --git a/js/app/packages/core/component/ClippedPanel.tsx b/js/app/packages/core/component/ClippedPanel.tsx
index 909ba008e0..281f447d59 100644
--- a/js/app/packages/core/component/ClippedPanel.tsx
+++ b/js/app/packages/core/component/ClippedPanel.tsx
@@ -15,7 +15,7 @@ export function ClippedPanel(props: PanelProps) {
return (
<div
style={{
- 'background-image': `linear-gradient(var(--color-accent), var(--color-edge-muted) ${props.active ? '80%' : '0%'})`,
+ 'background-image': `linear-gradient(${props.active ? 'var(--color-accent), var(--color-edge-muted) 80%' : 'var(--color-edge-muted)'} )`,
'clip-path': !beveledCorners()
? cornerClip(
props.tl ? '0.5rem' : 0,
diff --git a/js/app/packages/core/component/ScrollContainer.tsx b/js/app/packages/core/component/ScrollContainer.tsx
new file mode 100644
index 0000000000..f792d620c1
--- /dev/null
+++ b/js/app/packages/core/component/ScrollContainer.tsx
@@ -0,0 +1,56 @@
+import { createSignal, type JSX, onMount } from 'solid-js';
+
+interface ScrollContainerProps {
+ children: JSX.Element;
+ thumbSize?: number;
+}
+
+export function ScrollContainer(props: ScrollContainerProps) {
+ const [scrollHeight, setScrollHeight] = createSignal(0);
+ const [clientHeight, setClientHeight] = createSignal(0);
+ const [scrollTop, setScrollTop] = createSignal(0);
+
+ const thumbSize = 80;
+ let scrollContainerRef!: HTMLDivElement;
+
+ function handleScroll(e: Event) {
+ const target = e.target as HTMLDivElement;
+ setScrollTop(target.scrollTop);
+ setScrollHeight(target.scrollHeight);
+ setClientHeight(target.clientHeight);
+ }
+
+ onMount(() => {
+ setScrollHeight(scrollContainerRef.scrollHeight);
+ setClientHeight(scrollContainerRef.clientHeight);
+ });
+
+ function thumbTop() {
+ const maxScroll = scrollHeight() - clientHeight();
+ const maxThumbTop = clientHeight() - thumbSize;
+ return maxScroll > 0 ? (scrollTop() / maxScroll) * maxThumbTop : 0;
+ }
+
+ return (
+ <div class="relative w-[800px] h-[400px]">
+ <div
+ class="w-[800px] h-[400px] border border-[#666] overflow-y-auto overflow-x-hidden scrollbar-hide"
+ style={{ 'scrollbar-width': 'none' }}
+ ref={scrollContainerRef}
+ onScroll={handleScroll}
+ >
+ {props.children}
+ </div>
+
+ <div class="absolute top-0 right-0 w-[1px] h-full bg-transparent">
+ <div
+ class="absolute right-0 w-[1px] bg-red-600"
+ style={{
+ height: `${thumbSize}px`,
+ top: `${thumbTop()}px`,
+ }}
+ />
+ </div>
+ </div>
+ );
+}
diff --git a/js/app/packages/core/component/TopBar/ShareButton.tsx b/js/app/packages/core/component/TopBar/ShareButton.tsx
index 7b7a395e7d..afe346a087 100644
--- a/js/app/packages/core/component/TopBar/ShareButton.tsx
+++ b/js/app/packages/core/component/TopBar/ShareButton.tsx
@@ -23,11 +23,11 @@ import {
type MaybeResult,
} from '@core/util/maybeResult';
import { buildSimpleEntityUrl } from '@core/util/url';
-import EyeSlash from '@icon/bold/eye-slash-bold.svg';
-import GlobeIcon from '@icon/bold/globe-simple-bold.svg';
-import LinkIconBold from '@icon/bold/link-bold.svg';
-import Users from '@icon/bold/users-bold.svg';
+import IconEyeSlash from '@icon/regular/eye-slash.svg';
+import IconGlobe from '@icon/regular/globe.svg';
+import IconLink from '@icon/regular/link.svg';
import User from '@icon/regular/user.svg';
+import IconUsers from '@icon/regular/users.svg';
import { Dialog } from '@kobalte/core/dialog';
import { DropdownMenu } from '@kobalte/core/dropdown-menu';
import { Switch as KobalteSwitch } from '@kobalte/core/switch';
@@ -54,14 +54,12 @@ import {
Show,
Switch,
} from 'solid-js';
-import { Button } from '../FormControls/Button';
import { ForwardToChannel } from '../ForwardToChannel';
import { IconButton } from '../IconButton';
import { DropdownMenuContent, MENU_ITEM_CLASS, MenuItem } from '../Menu';
import { Permissions } from '../SharePermissions';
import { TextButton } from '../TextButton';
import { toast } from '../Toast/Toast';
-import { Tooltip } from '../Tooltip';
import { openLoginModal } from './LoginButton';
false && clickOutside;
@@ -533,7 +531,7 @@ export function ShareModal(props: ShareModalProps) {
<User class="flex-shrink-0 w-4 h-4" />
</Match>
<Match when={true}>
- <Users class="flex-shrink-0 w-4 h-4" />
+ <IconUsers class="flex-shrink-0 w-4 h-4" />
</Match>
</Switch>
<div class="font-medium truncate">
@@ -685,7 +683,7 @@ export function ShareButton(props: ShareButtonProps) {
e.stopPropagation();
copyLink();
},
- icon: LinkIconBold,
+ icon: IconLink,
};
});
@@ -700,76 +698,62 @@ export function ShareButton(props: ShareButtonProps) {
return 'Just me';
});
+ const shareIcon = createMemo(() => {
+ const accessLevel = shareAccessLevelText();
+ if (accessLevel === 'Public') {
+ return IconGlobe;
+ }
+ if (accessLevel === 'Shared') {
+ return IconUsers;
+ }
+ if (accessLevel === 'Just me') {
+ return IconEyeSlash;
+ }
+ return IconGlobe;
+ });
+
return (
<>
- <div class="ml-1 border-ink border">
- <IconButton
- size="xs"
- theme="reverse"
- icon={ShareLinkAction().icon}
- onClick={ShareLinkAction().action}
- tooltip={{ label: 'Copy Share Link' }}
- />
- </div>
- <div class="bg-ink w-1 h-[4px]"></div>
- <Button
- size="XS"
- hotkeyToken={'block.share'}
- onClick={(e) => {
+ <IconButton
+ tooltip={{
+ label:
+ shareAccessLevelText() === 'Public'
+ ? 'Share • Anyone with the link can access'
+ : shareAccessLevelText() === 'Shared'
+ ? 'Share • Shared with specific people'
+ : shareAccessLevelText() === 'Just me'
+ ? 'Share • Only you can access'
+ : 'Share',
+ }}
+ onClick={(_e) => {
if (!isAuthenticated()) {
openLoginModal();
} else {
track(TrackingEvents.SHARE.OPEN);
- ShareLinkAction().action(e);
setIsSharePermOpen(true);
}
}}
- >
- <div class="flex flex-row items-center">
- <Show
- when={shareAccessLevelText() !== ''}
- // use this fallback to force the button to correct height without icons
- fallback={<div class="w-0 h-3" />}
- >
- <div class="mr-1 font-medium text-panel/80 text-sm text-nowrap">
- <Switch>
- <Match when={shareAccessLevelText() === 'Public'}>
- <Tooltip
- tooltip={
- <div>Anyone with the link can access this document</div>
- }
- >
- <GlobeIcon class="size-3" />
- </Tooltip>
- </Match>
- <Match when={shareAccessLevelText() === 'Shared'}>
- <Tooltip
- tooltip={<div>Shared with specific people or channels</div>}
- >
- <Users class="size-3" />
- </Tooltip>
- </Match>
- <Match when={shareAccessLevelText() === 'Just me'}>
- <Tooltip
- tooltip={<div>Only you can access this document</div>}
- >
- <EyeSlash class="size-3" />
- </Tooltip>
- </Match>
- </Switch>
- </div>
- </Show>
- Share
- </div>
- </Button>
+ icon={shareIcon()}
+ theme="clear"
+ size="sm"
+ />
+
+ <IconButton
+ size="sm"
+ theme="clear"
+ icon={ShareLinkAction().icon}
+ onClick={ShareLinkAction().action}
+ tooltip={{ label: 'Copy Share Link' }}
+ />
+
<ShareModal
- id={props.id}
- name={props.name}
+ setIsSharePermOpen={setIsSharePermOpen}
userPermissions={props.userPermissions}
- itemType={props.itemType}
isSharePermOpen={isSharePermOpen()}
- setIsSharePermOpen={setIsSharePermOpen}
+ itemType={props.itemType}
owner={props.owner}
+ name={props.name}
+ id={props.id}
/>
</>
);