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(splits): hide close on single split, chg history behavior for common operations (#1922)

Seamusfab039a8b762
diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsx
index b112d3e512..ded9ffaa5e 100644
--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx
+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx
@@ -161,7 +161,7 @@ export const AppSidebar = (props: AppSidebarProps) => {
},
{
preferNewSplit: e?.shiftKey,
- mergeHistory: true,
+ mergeHistory: false,
allowDuplicate: true,
}
);
@@ -399,7 +399,7 @@ const SidebarLink = (props: SidebarLinkProps) => {
},
{
preferNewSplit: e.shiftKey,
- mergeHistory: true,
+ mergeHistory: false,
allowDuplicate: true,
}
);
diff --git a/js/app/packages/app/component/next-soup/soup-view/use-soup-navigation-hotkeys.ts b/js/app/packages/app/component/next-soup/soup-view/use-soup-navigation-hotkeys.ts
index 3c81bc46b8..284a48a529 100644
--- a/js/app/packages/app/component/next-soup/soup-view/use-soup-navigation-hotkeys.ts
+++ b/js/app/packages/app/component/next-soup/soup-view/use-soup-navigation-hotkeys.ts
@@ -56,6 +56,7 @@ export const useSoupNavigationHotkeys = (
openEntityInSplitFromUnifiedList(entity, {
splitHandle,
+ mergeHistory: true,
});
};
diff --git a/js/app/packages/app/component/next-soup/utils.ts b/js/app/packages/app/component/next-soup/utils.ts
index 79478d2913..6f4603e08e 100644
--- a/js/app/packages/app/component/next-soup/utils.ts
+++ b/js/app/packages/app/component/next-soup/utils.ts
@@ -260,6 +260,7 @@ export interface OpenEntityOptions {
openInNewSplit?: boolean;
location?: SearchLocation;
splitHandle?: SplitHandle;
+ mergeHistory?: boolean;
}
/**
@@ -273,7 +274,7 @@ export const openEntityInSplitFromUnifiedList = async (
entity: EntityData,
options: OpenEntityOptions
): Promise<void> => {
- const { openInNewSplit, location, splitHandle } = options;
+ const { openInNewSplit, location, splitHandle, mergeHistory } = options;
// Get dependencies internally
const splitManager = globalSplitManager();
@@ -302,6 +303,7 @@ export const openEntityInSplitFromUnifiedList = async (
activate: true,
preferNewSplit: openInNewSplit,
handle: splitHandle,
+ mergeHistory,
}
);
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 b391aeb9b0..12cc02e1dd 100644
--- a/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
+++ b/js/app/packages/app/component/split-layout/components/SplitHeader.tsx
@@ -111,15 +111,17 @@ function SplitCloseButton() {
});
return (
- <Button
- class="p-1"
- tooltip={
- <LabelAndHotKey label={label()} hotkeyToken={TOKENS.split.close} />
- }
- onClick={context.handle.close}
- >
- <CloseIcon class="w-4 h-4" />
- </Button>
+ <Show when={layout.manager.splits().length > 1}>
+ <Button
+ class="p-1"
+ tooltip={
+ <LabelAndHotKey label={label()} hotkeyToken={TOKENS.split.close} />
+ }
+ onClick={context.handle.close}
+ >
+ <CloseIcon class="w-4 h-4" />
+ </Button>
+ </Show>
);
}
diff --git a/js/app/packages/ui/components/Button.stories.tsx b/js/app/packages/ui/components/Button.stories.tsx
index 668bbce2a0..5f7c38286f 100644
--- a/js/app/packages/ui/components/Button.stories.tsx
+++ b/js/app/packages/ui/components/Button.stories.tsx
@@ -90,7 +90,9 @@ export const PrimaryDisabled: Story = {
},
play: async ({ canvas, userEvent, args }: PlayContext<Story>) => {
const button = canvas.getByText('I am Disabled');
- await userEvent.click(button);
+ try {
+ await userEvent.click(button);
+ } catch {}
await expect(button).toBeDisabled();
await expect(args.onClick).not.toHaveBeenCalled();
},
diff --git a/js/app/packages/ui/components/Button.tsx b/js/app/packages/ui/components/Button.tsx
index 087fd8dc6b..6c83eb14a9 100644
--- a/js/app/packages/ui/components/Button.tsx
+++ b/js/app/packages/ui/components/Button.tsx
@@ -61,7 +61,7 @@ export const Button: ParentComponent<ButtonProps> = (props) => {
'relative flex items-center justify-center gap-[1ch] px-[1ch] py-[0.25lh] border border-transparent',
'font-mono font-medium uppercase leading-none',
!local.suppressInteractionStyling &&
- 'hover:bg-hover focus:[--focus-border-inset:-4px] active:border-accent active:bg-accent active:text-panel disabled:opacity-50 disabled:hover:bg-inherit',
+ 'hover:bg-hover focus:[--focus-border-inset:-4px] active:border-accent active:bg-accent active:text-panel disabled:opacity-20 disabled:pointer-events-none disabled:hover:bg-inherit',
'touch:min-h-11 touch:min-w-11 touch:[&_svg]:size-6',
{