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(ShareButton): muted styled, and use old switch statement. fix(CommandConsole): remove fts switch. (#648)

Fake-User107e5c83091b
diff --git a/js/app/packages/app/component/command/Konsole.tsx b/js/app/packages/app/component/command/Konsole.tsx
index f10e4914c9..1cfebc9f73 100644
--- a/js/app/packages/app/component/command/Konsole.tsx
+++ b/js/app/packages/app/component/command/Konsole.tsx
@@ -1,6 +1,5 @@
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';
@@ -46,7 +45,6 @@ import {
konsoleOpen,
lastCommandTime,
rawQuery,
- setKonsoleMode,
setLastCommandTime,
setRawQuery,
toggleKonsoleVisibility,
@@ -332,19 +330,6 @@ export function KommandMenuInner(props: {
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-panel">
<KonsoleFilter />
diff --git a/js/app/packages/app/component/command/state.ts b/js/app/packages/app/component/command/state.ts
index 5cfd585a2a..e1c1a01633 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/core/component/TopBar/ShareButton.tsx b/js/app/packages/core/component/TopBar/ShareButton.tsx
index afe346a087..3685bb1412 100644
--- a/js/app/packages/core/component/TopBar/ShareButton.tsx
+++ b/js/app/packages/core/component/TopBar/ShareButton.tsx
@@ -60,6 +60,7 @@ 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;
@@ -698,53 +699,83 @@ 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 (
<>
- <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);
- setIsSharePermOpen(true);
- }
- }}
- icon={shareIcon()}
- theme="clear"
- size="sm"
- />
-
- <IconButton
- size="sm"
- theme="clear"
- icon={ShareLinkAction().icon}
- onClick={ShareLinkAction().action}
- tooltip={{ label: 'Copy Share Link' }}
- />
+ <div class="border-1 border-edge-muted flex">
+ <Switch>
+ <Match when={shareAccessLevelText() === 'Public'}>
+ <Tooltip
+ tooltip={<div>Anyone with the link can access this document</div>}
+ >
+ <button
+ class="text-xs hover:bg-hover text-ink p-1 flex items-center gap-1"
+ onClick={(e) => {
+ if (!isAuthenticated()) {
+ openLoginModal();
+ } else {
+ track(TrackingEvents.SHARE.OPEN);
+ ShareLinkAction().action(e);
+ setIsSharePermOpen(true);
+ }
+ }}
+ >
+ &nbsp;Share
+ <IconGlobe class="size-4" />
+ </button>
+ </Tooltip>
+ </Match>
+ <Match when={shareAccessLevelText() === 'Shared'}>
+ <Tooltip
+ tooltip={<div>Shared with specific people or channels</div>}
+ >
+ <button
+ class="text-xs hover:bg-hover text-ink p-1 flex items-center gap-1"
+ onClick={(e) => {
+ if (!isAuthenticated()) {
+ openLoginModal();
+ } else {
+ track(TrackingEvents.SHARE.OPEN);
+ ShareLinkAction().action(e);
+ setIsSharePermOpen(true);
+ }
+ }}
+ >
+ &nbsp;Share
+ <IconUsers class="size-4" />
+ </button>
+ </Tooltip>
+ </Match>
+ <Match when={shareAccessLevelText() === 'Just me'}>
+ <Tooltip tooltip={<div>Only you can access this document</div>}>
+ <button
+ class="text-xs hover:bg-hover text-ink p-1 flex items-center gap-1"
+ onClick={(e) => {
+ if (!isAuthenticated()) {
+ openLoginModal();
+ } else {
+ track(TrackingEvents.SHARE.OPEN);
+ ShareLinkAction().action(e);
+ setIsSharePermOpen(true);
+ }
+ }}
+ >
+ &nbsp;Share
+ <IconEyeSlash class="size-4" />
+ </button>
+ </Tooltip>
+ </Match>
+ </Switch>
+
+ <div class="h-[24px] w-[1px] bg-edge-muted" />
+
+ <IconButton
+ size="sm"
+ theme="clear"
+ icon={ShareLinkAction().icon}
+ onClick={ShareLinkAction().action}
+ tooltip={{ label: 'Copy Share Link' }}
+ />
+ </div>
<ShareModal
setIsSharePermOpen={setIsSharePermOpen}