Skip to content

Commit e12a264

Browse files
authored
v0.8.53: indexing fixes
2 parents f7db10b + fe7d6d3 commit e12a264

27 files changed

Lines changed: 28837 additions & 58 deletions

File tree

‎apps/sim/app/_styles/globals.css‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@
154154
*/
155155
--color-amber-50: #fffbeb;
156156
--color-amber-200: #fde68a;
157-
--color-amber-300: #fcd34d;
158157
--color-amber-400: #fbbf24;
159158
--color-amber-500: #f59e0b;
160159
--color-amber-600: #d97706;
@@ -166,7 +165,6 @@
166165
--color-emerald-400: #34d399;
167166
--color-emerald-500: #10b981;
168167
--color-green-500: #22c55e;
169-
--color-orange-400: #fb923c;
170168
--color-purple-500: #a855f7;
171169
--color-red-50: #fef2f2;
172170
--color-red-300: #fca5a5;
@@ -235,6 +233,18 @@
235233
--animate-hero-edge-draw: hero-edge-draw 520ms ease-out forwards;
236234
}
237235

236+
/** Runtime collaborator colours must exist even without a matching utility class. */
237+
@theme static {
238+
--color-black: #000000;
239+
--color-white: #ffffff;
240+
--color-amber-300: #fcd34d;
241+
--color-orange-400: #fb923c;
242+
--color-pink-400: #f472b6;
243+
--color-purple-400: #c084fc;
244+
--color-violet-500: #8b5cf6;
245+
--color-cool-gray-500: #6b7280;
246+
}
247+
238248
/**
239249
* One period of the running block's hatch (26px horizontal). Shifting by
240250
* exactly one period is what makes the loop seamless.

‎apps/sim/app/workspace/[workspaceId]/components/presence/presence-avatars.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function PresenceAvatars({
9898
style={{ zIndex: 0 }}
9999
aria-label={`${overflowCount} more ${overflowCount === 1 ? 'user' : 'users'}`}
100100
>
101-
<AvatarFallback className='border-0 bg-[#404040] font-semibold text-[7px] text-white leading-none'>
101+
<AvatarFallback className='border-0 bg-gray-700 font-semibold text-[7px] text-white leading-none'>
102102
+{overflowCount}
103103
</AvatarFallback>
104104
</Avatar>

‎apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/caret-presence.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type { Awareness } from 'y-protocols/awareness'
1818
export const CARET_LABEL_HOLD_MS = 2000
1919

2020
/** Fallback caret color when a peer's awareness carries no `color`. */
21-
export const DEFAULT_CARET_COLOR = '#000000'
21+
export const DEFAULT_CARET_COLOR = 'var(--color-black)'
2222

2323
/**
2424
* The active-state class {@link activateCaretLabel} toggles on the caret node to reveal the

‎apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/editor-extensions.ts‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ import {
3535
} from '@/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/raw-markdown-snippet'
3636
import { SlashCommand } from '@/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/slash-command/slash-command'
3737

38+
const FileCollaborationCaret = CollaborationCaret.extend({
39+
addProseMirrorPlugins() {
40+
// Older peers need a resolved colour to apply their selection opacity.
41+
// Resolve at editor mount, before the parent captures and publishes user.
42+
const color = this.options.user.color
43+
const token = typeof color === 'string' ? /^var\((--[\w-]+)\)$/.exec(color)?.[1] : undefined
44+
if (token && typeof document !== 'undefined') {
45+
const resolved = getComputedStyle(document.documentElement).getPropertyValue(token).trim()
46+
if (resolved) this.options.user = { ...this.options.user, color: resolved }
47+
}
48+
return this.parent?.() ?? []
49+
},
50+
})
51+
3852
/** Live collaboration binding for the editor. When present, the editor's history
3953
* is Yjs-backed and remote carets/selection render via CollaborationCaret. */
4054
export interface EditorCollaboration {
@@ -87,15 +101,15 @@ export function createMarkdownEditorExtensions({
87101
// relayed by the socket provider once connected). `render` tags each caret
88102
// with the peer's client id and shows its name label; the selection tint is
89103
// a translucent fill of the peer's identity color.
90-
CollaborationCaret.configure({
104+
FileCollaborationCaret.configure({
91105
provider: { awareness: collaboration.awareness },
92106
user: collaboration.user,
93107
render: renderCaret,
94108
selectionRender: (user) => {
95-
const hex = typeof user.color === 'string' ? user.color : DEFAULT_CARET_COLOR
109+
const color = typeof user.color === 'string' ? user.color : DEFAULT_CARET_COLOR
96110
return {
97111
class: 'collaboration-carets__selection',
98-
style: `background-color: ${withAlpha(hex, 0.2)};`,
112+
style: `background-color: ${withAlpha(color, 0.2)};`,
99113
}
100114
},
101115
}),

‎apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/list-collaboration.test.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,24 @@ describe('list editing with delayed peer updates', () => {
296296
)
297297
})
298298
})
299+
300+
it('publishes resolved global colours so older peers keep translucent selections', () => {
301+
const doc = new Y.Doc()
302+
const awareness = new Awareness(doc)
303+
const user = { name: 'User', color: 'var(--color-pink-400)' }
304+
const extensions = createMarkdownEditorExtensions({
305+
placeholder: '',
306+
collaboration: { doc, awareness, user },
307+
})
308+
document.documentElement.style.setProperty('--color-pink-400', '#f472b6')
309+
const editor = new Editor({ extensions })
310+
cleanups.push(() => {
311+
editor.destroy()
312+
awareness.destroy()
313+
doc.destroy()
314+
document.documentElement.style.removeProperty('--color-pink-400')
315+
})
316+
317+
expect(awareness.getLocalState()?.user.color).toBe('#f472b6')
318+
expect(user.color).toBe('var(--color-pink-400)')
319+
})

‎apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.css‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@
440440
* text without ever shifting the text (or any following text) as the highlight is applied/removed.
441441
*/
442442
.rich-markdown-nodes mark {
443-
background-color: rgba(255, 212, 0, 0.4);
443+
background-color: color-mix(in srgb, var(--color-amber-400) 40%, transparent);
444444
color: inherit;
445445
border-radius: 2px;
446446
padding: 0 0.1em;
@@ -604,5 +604,5 @@
604604
* its solid fill with a fixed dark ink for exactly this reason. */
605605
.rich-markdown-nodes .rich-find-match-active {
606606
background-color: var(--brand-secondary);
607-
color: #000;
607+
color: var(--color-black);
608608
}

‎apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/constants.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** Tailwind class applied to selected rows / columns / cells. */
2-
export const SELECTION_TINT_BG = 'bg-[rgba(37,99,235,0.06)]'
2+
export const SELECTION_TINT_BG = 'bg-[color-mix(in_srgb,var(--selection)_6%,transparent)]'
33

44
/**
55
* Fill marking every cell matching the active find query. Reuses the app's

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/diff-controls/diff-controls.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ export const DiffControls = memo(function DiffControls() {
8181
width: '2px',
8282
transform: 'skewX(-18.4deg)',
8383
background:
84-
'linear-gradient(to right, var(--border) 50%, color-mix(in srgb, var(--brand-accent) 70%, black) 50%)',
84+
'linear-gradient(to right, var(--border) 50%, color-mix(in srgb, var(--brand-accent) 70%, var(--color-black)) 50%)',
8585
}}
8686
/>
8787
{/* Accept side */}
8888
<button
8989
onClick={handleAccept}
9090
title='Accept changes (⇧⌘⏎)'
91-
className='-ml-2.5 relative flex h-full items-center border border-[rgba(0,0,0,0.15)] bg-[var(--brand-accent)] pr-3 pl-5 text-[var(--text-inverse)] text-small transition-[background-color,border-color,fill,stroke] hover-hover:brightness-110 dark:border-[rgba(255,255,255,0.1)]'
91+
className='-ml-2.5 relative flex h-full items-center border border-black/15 bg-[var(--brand-accent)] pr-3 pl-5 text-[var(--text-inverse)] text-small transition-[background-color,border-color,fill,stroke] hover-hover:brightness-110 dark:border-white/10'
9292
style={{
9393
clipPath: 'polygon(10px 0, 100% 0, 100% 100%, 0 100%)',
9494
borderRadius: '0 4px 4px 0',

‎apps/sim/app/workspace/[workspaceId]/w/components/preview/components/preview-editor/preview-editor.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ function ConnectionsSection({
434434
handleKeyboardActivation(event, () => setExpandedVariables(!expandedVariables))
435435
}
436436
>
437-
<div className='relative flex size-[14px] shrink-0 items-center justify-center overflow-hidden rounded-sm bg-[#8B5CF6]'>
437+
<div className='relative flex size-[14px] shrink-0 items-center justify-center overflow-hidden rounded-sm bg-violet-500'>
438438
<span className='text-[9px] text-white'>V</span>
439439
</div>
440440
<OverflowText
@@ -483,7 +483,7 @@ function ConnectionsSection({
483483
handleKeyboardActivation(event, () => setExpandedEnvVars(!expandedEnvVars))
484484
}
485485
>
486-
<div className='relative flex size-[14px] shrink-0 items-center justify-center overflow-hidden rounded-sm bg-[#6B7280]'>
486+
<div className='relative flex size-[14px] shrink-0 items-center justify-center overflow-hidden rounded-sm bg-cool-gray-500'>
487487
<span className='text-[9px] text-white'>E</span>
488488
</div>
489489
<OverflowText

‎apps/sim/components/ui/shimmer-text.module.css‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
* `--shimmer-rest` to their resting color.
99
*/
1010
.shimmer {
11-
background-image: linear-gradient(90deg, #4a4a4a 40%, #b0b0b0 50%, #4a4a4a 60%);
11+
background-image: linear-gradient(
12+
90deg,
13+
var(--text-body) 40%,
14+
var(--color-gray-400) 50%,
15+
var(--text-body) 60%
16+
);
1217
background-size: 200% 100%;
1318
-webkit-background-clip: text;
1419
background-clip: text;
@@ -17,7 +22,12 @@
1722
}
1823

1924
:global(.dark) .shimmer {
20-
background-image: linear-gradient(90deg, #b9b9b9 40%, #f8f8f8 50%, #b9b9b9 60%);
25+
background-image: linear-gradient(
26+
90deg,
27+
var(--text-body) 40%,
28+
var(--color-gray-50) 50%,
29+
var(--text-body) 60%
30+
);
2131
}
2232

2333
@keyframes shimmer-sweep {

0 commit comments

Comments
 (0)