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: quick dialog fix (#1046)

Peter Chinmane8c4cf21f93e
diff --git a/js/app/packages/app/component/GlobalHotkeys.tsx b/js/app/packages/app/component/GlobalHotkeys.tsx
index 4575663fa1..fd7bf52227 100644
--- a/js/app/packages/app/component/GlobalHotkeys.tsx
+++ b/js/app/packages/app/component/GlobalHotkeys.tsx
@@ -7,18 +7,13 @@ import { AiInstructionsIcon } from '@service-storage/instructionsMd';
import { registerHotkey } from 'core/hotkey/hotkeys';
import { createMemo } from 'solid-js';
import {
- beveledCorners,
- blackBezels,
monochromeIcons,
- setBeveledCorners,
- setBlackBezels,
setDarkModeTheme,
setLightModeTheme,
setMonochromeIcons,
setThemeShouldMatchSystem,
themeShouldMatchSystem,
themes,
- toggleGutterSize,
} from '../../block-theme/signals/themeSignals';
import { applyTheme } from '../../block-theme/utils/themeUtils';
import { globalSplitManager } from '../signal/splitLayout';
@@ -258,35 +253,5 @@ export default function GlobalShortcuts() {
runWithInputFocused: true,
});
- registerHotkey({
- scopeId: 'global',
- description: 'Toggle beveled corners',
- keyDownHandler: () => {
- setBeveledCorners(!beveledCorners());
- return true;
- },
- runWithInputFocused: true,
- });
-
- registerHotkey({
- scopeId: 'global',
- description: 'Toggle black bezels',
- keyDownHandler: () => {
- setBlackBezels(!blackBezels());
- return true;
- },
- runWithInputFocused: true,
- });
-
- registerHotkey({
- scopeId: 'global',
- description: 'Toggle gutter size',
- keyDownHandler: () => {
- toggleGutterSize();
- return true;
- },
- runWithInputFocused: true,
- });
-
- return '';
+ return null;
}
diff --git a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
index 77c661f1c1..7130c1cb74 100644
--- a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
@@ -102,15 +102,24 @@ function SplitSpotlightButton() {
function SplitCloseButton() {
const context = useContext(SplitPanelContext);
- if (!context) return null;
+ const layout = useContext(SplitLayoutContext);
+ if (!context || !layout) return null;
+
+ const label = createMemo(() => {
+ const isOnlySplit = layout.manager.splits().length === 1;
+ const isNotUnifiedList = context.handle.content().id !== 'unified-list';
+ return isOnlySplit && isNotUnifiedList ? 'Return to list' : 'Close';
+ });
return (
<Button
class="p-1"
- tooltip={<LabelAndHotKey label="Close" />}
+ tooltip={
+ <LabelAndHotKey label={label()} hotkeyToken={TOKENS.split.close} />
+ }
onClick={context.handle.close}
>
- <CloseIcon class="h-4" />
+ <CloseIcon class="w-4 h-4" />
</Button>
);
}
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index 746530cfaf..8bb968a616 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -107,7 +107,6 @@
--transition: 0.s;
/*--transition: 0.15s;*/
-
--color-*: initial; /* Disable default tailwind color palette */
/* Semantic Color names, use these when writing tailwind */
diff --git a/js/app/packages/core/component/ClippedPanel.tsx b/js/app/packages/core/component/ClippedPanel.tsx
index b7c3be5a96..59be461154 100644
--- a/js/app/packages/core/component/ClippedPanel.tsx
+++ b/js/app/packages/core/component/ClippedPanel.tsx
@@ -1,7 +1,5 @@
-import { isTouchDevice } from '@core/mobile/isTouchDevice';
-import { isMobileWidth } from '@core/mobile/mobileWidth';
import { cornerClip } from '@core/util/clipPath';
-import { type JSX, type JSXElement, type Ref, Show } from 'solid-js';
+import type { JSX, JSXElement, Ref } from 'solid-js';
import { beveledCorners } from '../../block-theme/signals/themeSignals';
interface PanelProps {
@@ -17,57 +15,52 @@ interface PanelProps {
export function ClippedPanel(props: PanelProps) {
return (
- <Show
- when={!isTouchDevice() || !isMobileWidth()}
- fallback={<div class="size-full">{props.children}</div>}
+ <div
+ style={{
+ 'background-image': `linear-gradient(${props.active ? `var(--color-accent), ${props.edgeMutedColor || 'var(--color-edge-muted)'} 80%` : `${props.edgeMutedColor || 'var(--color-edge-muted)'}`} )`,
+ 'clip-path': !beveledCorners()
+ ? cornerClip(
+ props.tl ? '0.5rem' : 0,
+ props.tr ? '0.5rem' : 0,
+ props.br ? '0.5rem' : 0,
+ props.bl ? '0.5rem' : 0
+ )
+ : '',
+ 'border-radius': beveledCorners()
+ ? `
+ ${props.tl ? '16px' : '4px'}
+ ${props.tr ? '16px' : '4px'}
+ ${props.br ? '16px' : '4px'}
+ ${props.bl ? '16px' : '4px'}
+ `
+ : '0',
+ }}
+ class="p-px h-full w-full box-border"
>
<div
style={{
- 'background-image': `linear-gradient(${props.active ? `var(--color-accent), ${props.edgeMutedColor || 'var(--color-edge-muted)'} 80%` : `${props.edgeMutedColor || 'var(--color-edge-muted)'}`} )`,
'clip-path': !beveledCorners()
? cornerClip(
- props.tl ? '0.5rem' : 0,
- props.tr ? '0.5rem' : 0,
- props.br ? '0.5rem' : 0,
- props.bl ? '0.5rem' : 0
+ props.tl ? 'calc(0.5rem - 0.5px)' : 0,
+ props.tr ? 'calc(0.5rem - 0.5px)' : 0,
+ props.br ? 'calc(0.5rem - 0.5px)' : 0,
+ props.bl ? 'calc(0.5rem - 0.5px)' : 0
)
: '',
'border-radius': beveledCorners()
? `
- ${props.tl ? '16px' : '4px'}
- ${props.tr ? '16px' : '4px'}
- ${props.br ? '16px' : '4px'}
- ${props.bl ? '16px' : '4px'}
- `
- : '0',
- }}
- class="p-px h-full w-full box-border"
- >
- <div
- style={{
- 'clip-path': !beveledCorners()
- ? cornerClip(
- props.tl ? 'calc(0.5rem - 0.5px)' : 0,
- props.tr ? 'calc(0.5rem - 0.5px)' : 0,
- props.br ? 'calc(0.5rem - 0.5px)' : 0,
- props.bl ? 'calc(0.5rem - 0.5px)' : 0
- )
- : '',
- 'border-radius': beveledCorners()
- ? `
${props.tl ? '15.5px' : '3.3px'}
${props.tr ? '15.5px' : '3.3px'}
${props.br ? '15.5px' : '3.3px'}
${props.bl ? '15.5px' : '3.3px'}
`
- : '0',
- }}
- class="h-full w-full box-border overflow-hidden bg-panel"
- ref={props.ref}
- >
- {props.children}
- </div>
+ : '0',
+ }}
+ class="h-full w-full box-border overflow-hidden bg-panel"
+ ref={props.ref}
+ >
+ {props.children}
</div>
- </Show>
+ </div>
);
}
diff --git a/js/app/packages/core/component/DialogWrapper.tsx b/js/app/packages/core/component/DialogWrapper.tsx
index 712e1b9339..1f165f1549 100644
--- a/js/app/packages/core/component/DialogWrapper.tsx
+++ b/js/app/packages/core/component/DialogWrapper.tsx
@@ -17,14 +17,8 @@ export function DialogWrapper(props: DialogWrapperProps) {
ref={props.overlayRef}
>
<div
- style={{
- 'max-width': 'calc(100vw - (var(--gutter-size) * 2))',
- margin: '160px auto 0 auto',
- 'max-height': '75vh',
- overflow: 'hidden',
- width: width,
- }}
- class={props.class}
+ class={`max-w-[calc(100vw-16px)] mt-20 sm:mt-40 mx-auto max-h-[75vh] overflow-hidden ${props.class ?? ''}`}
+ style={{ width: width }}
ref={props.contentRef}
>
{props.children}
diff --git a/js/app/packages/core/component/Hotkey.tsx b/js/app/packages/core/component/Hotkey.tsx
index 6d4a16024d..a9aad5fccc 100644
--- a/js/app/packages/core/component/Hotkey.tsx
+++ b/js/app/packages/core/component/Hotkey.tsx
@@ -124,19 +124,19 @@ export const Hotkey = (props: HotkeyProps) => {
'children',
'lowercase',
]);
- const tokenShortcut = local.token
- ? getPrettyHotkeyStringByToken(local.token)
- : undefined;
+ const tokenShortcut = createMemo(() =>
+ local.token ? getPrettyHotkeyStringByToken(local.token) : undefined
+ );
const hotkey = createMemo(() => {
// fallback for when we specify a shortcut directly instead of a hotkey token
- if (local.shortcut && !tokenShortcut) {
+ if (local.shortcut && !tokenShortcut()) {
return breakApartHotkeyString(local.shortcut);
}
- if (!tokenShortcut) {
+ if (!tokenShortcut()) {
return { key: '', modifiers: [] };
}
- return breakApartHotkeyString(tokenShortcut);
+ return breakApartHotkeyString(tokenShortcut() ?? '');
});
const normalizedKey = () => {