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.

style(splits): add edge glow effect to active split (#68)

Seamusf20fc118d761
diff --git a/js/app/packages/app/component/split-layout/SplitLayout.tsx b/js/app/packages/app/component/split-layout/SplitLayout.tsx
index 7ed0d75822..447169d764 100644
--- a/js/app/packages/app/component/split-layout/SplitLayout.tsx
+++ b/js/app/packages/app/component/split-layout/SplitLayout.tsx
@@ -101,7 +101,7 @@ function createSplitFocusTracker(props: {
panelRefs: Map<SplitId, HTMLDivElement>;
splits: Accessor<ReadonlyArray<SplitState>>;
}) {
- const DEBOUNCE = 100;
+ const DEBOUNCE = 40;
const activeSplitId = () => props.splitManager.activeSplitId();
const currentSplitsIds = () => new Set(props.splits().map((s) => s.id));
diff --git a/js/app/packages/app/component/split-layout/components/SplitContainer.tsx b/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
index 47cc271950..dbcd9bda53 100644
--- a/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitContainer.tsx
@@ -7,7 +7,6 @@ import {
createMemo,
createSignal,
on,
- onCleanup,
type ParentProps,
type Setter,
Show,
@@ -17,6 +16,22 @@ import { SplitDrawerGroup } from './SplitDrawerContext';
import { SplitHeader } from './SplitHeader';
import { SplitModalProvider } from './SplitModalContext';
import { SplitToolbar } from './SplitToolbar';
+import './splitContainer.css';
+import { globalSplitManager } from '@app/signal/splitLayout';
+
+function EdgeDecor(props: { isActive: boolean }) {
+ return (
+ <div
+ class="absolute inset-0 border border-accent opacity-50 pointer-events-none mask-anim"
+ classList={{ active: props.isActive }}
+ style={{
+ 'clip-path': cornerClip('0.5rem', 0, 0, 0),
+ }}
+ >
+ <div class="size-[0.465rem] bg-accent [clip-path:polygon(0%_0%,100%_0%,0%_100%)]"></div>
+ </div>
+ );
+}
export function SplitContainer(
props: ParentProps<{ id: string; ref: (elem: HTMLDivElement) => void }>
@@ -44,6 +59,11 @@ export function SplitContainer(
return offset;
});
+ const multipleSplits = () => {
+ const splits = globalSplitManager()?.splits?.();
+ return Boolean(splits && splits.length > 1);
+ };
+
return (
<SplitModalProvider>
<SplitDrawerGroup
@@ -57,6 +77,18 @@ export function SplitContainer(
/>
<div class="fixed inset-[4rem] bg-panel shadow-xl rounded-tl-[1.5rem]" />
</Show>
+ <div
+ class="pointer-events-none text-accent"
+ classList={{
+ 'absolute inset-0 z-1': !isSpotLight(),
+ }}
+ >
+ <EdgeDecor
+ isActive={
+ panel.handle.isActive() && multipleSplits() && !isSpotLight()
+ }
+ />
+ </div>
<div
data-split-id={props.id}
data-split-container
diff --git a/js/app/packages/app/component/split-layout/components/splitContainer.css b/js/app/packages/app/component/split-layout/components/splitContainer.css
new file mode 100644
index 0000000000..108c6f0e4c
--- /dev/null
+++ b/js/app/packages/app/component/split-layout/components/splitContainer.css
@@ -0,0 +1,12 @@
+.mask-anim {
+ mask-image: linear-gradient(0deg, transparent 30%, black 50%);
+ mask-size: 100% 0;
+ transition: mask-size 0.25s, opacity 0.1s ease;
+ mask-repeat: no-repeat;
+ opacity: 0;
+}
+
+.mask-anim.active {
+ mask-size: 100% 100%;
+ opacity: 0.4
+}