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(tasks): tighten task composer layout (#7729)

Jacob Beckermancf2cd5239230
diff --git a/apps/web/src/features/block-email/EmailThreadHostView.tsx b/apps/web/src/features/block-email/EmailThreadHostView.tsx
index e1eca65e28..642d1404cb 100644
--- a/apps/web/src/features/block-email/EmailThreadHostView.tsx
+++ b/apps/web/src/features/block-email/EmailThreadHostView.tsx
@@ -45,10 +45,6 @@ export function EmailThreadHostView(props: EmailThreadHostViewProps) {
type: 'component',
id: 'task-compose',
params: {
- initialTitle:
- props.title.length > 70
- ? `${props.title.slice(0, 70)}...`
- : props.title,
initialContent: buildMentionMarkdownString({
type: 'document',
documentId: props.threadId(),
diff --git a/apps/web/src/features/block-md/component/ComposeTask.tsx b/apps/web/src/features/block-md/component/ComposeTask.tsx
index a484667e0e..b2703b1253 100644
--- a/apps/web/src/features/block-md/component/ComposeTask.tsx
+++ b/apps/web/src/features/block-md/component/ComposeTask.tsx
@@ -39,7 +39,9 @@ import { SYSTEM_PROPERTY_IDS } from '@property/constants';
import { PropertiesProvider } from '@property/context/PropertiesContext';
import { InlineTagsPill } from '@property/tags';
import type { PropertyApiValues } from '@property/types';
+import { queryReadyGate } from '@queries/gate';
import { useUpsertToHistoryMutation } from '@queries/history/history';
+import { useUserTeamsQuery } from '@queries/team/teams';
import { onElementConnect } from '@solid-primitives/lifecycle';
import { debounce } from '@solid-primitives/scheduled';
import { Button, EntityComposer, Scroll, ToggleSwitch, Tooltip } from '@ui';
@@ -452,6 +454,11 @@ export function ComposeTask(props: ComposeTaskProps) {
}
);
const [errorMessage, setErrorMessage] = createSignal<string>('');
+ const userTeams = useUserTeamsQuery();
+ const team = () =>
+ queryReadyGate(userTeams) ? userTeams.data.at(0) : undefined;
+ // Without a team there is nobody to share with, whatever was last toggled.
+ const sharesWithTeam = () => (team() ? shareWithTeam() : false);
const sharingHint = () =>
shareWithTeam()
? 'Visible to your whole team'
@@ -626,7 +633,7 @@ export function ComposeTask(props: ComposeTaskProps) {
createDefinitions(),
(params) => upsertToHistoryMutation.mutate(params),
{
- shareWithTeam: shareWithTeam(),
+ shareWithTeam: sharesWithTeam(),
onMutate: () => {
splitPanel.handle.close();
props.onClose?.();
@@ -662,7 +669,7 @@ export function ComposeTask(props: ComposeTaskProps) {
createDefinitions(),
(params) => upsertToHistoryMutation.mutate(params),
{
- shareWithTeam: shareWithTeam(),
+ shareWithTeam: sharesWithTeam(),
onMutate: () => {
resetTitleAndBody();
setIsCreating(false);
@@ -711,7 +718,7 @@ export function ComposeTask(props: ComposeTaskProps) {
createDefinitions(),
(params) => upsertToHistoryMutation.mutate(params),
{
- shareWithTeam: shareWithTeam(),
+ shareWithTeam: sharesWithTeam(),
onMutate: () => {
splitPanel.handle.close();
props.onClose?.();
@@ -822,6 +829,10 @@ export function ComposeTask(props: ComposeTaskProps) {
if (container) {
attachHotkeys(container);
}
+ // An empty title (e.g. a task started from an email) waits for the user.
+ if (!title().trim()) {
+ requestAnimationFrame(() => titleEditorRoot?.focus());
+ }
});
registerHotkey({
@@ -942,7 +953,7 @@ export function ComposeTask(props: ComposeTaskProps) {
/>
</EntityComposer.Title>
- <EntityComposer.Body>
+ <EntityComposer.Body class="mb-0">
<Scroll>
<MarkdownShell
config={editorConfig}
@@ -958,6 +969,27 @@ export function ComposeTask(props: ComposeTaskProps) {
</Scroll>
</EntityComposer.Body>
+ <div class="shrink-0 flex items-center py-2 -ml-1 touch:-ml-[3px]">
+ <input
+ ref={(el) => {
+ attachInputRef = el;
+ }}
+ type="file"
+ class="hidden"
+ multiple
+ accept="image/*,video/*"
+ onChange={handleAttachFiles}
+ />
+ <Button
+ onMouseDown={() => attachInputRef?.click()}
+ tabIndex={-1}
+ tooltip="Attach image or video"
+ size="icon-composer"
+ >
+ <PaperclipIcon />
+ </Button>
+ </div>
+
<Suspense fallback={<div class="h-7" />}>
<PropertiesProvider
entityType="TASK"
@@ -1026,26 +1058,22 @@ export function ComposeTask(props: ComposeTaskProps) {
</div>
</Show>
- <EntityComposer.Footer>
- <input
- ref={(el) => {
- attachInputRef = el;
- }}
- type="file"
- class="hidden"
- multiple
- accept="image/*,video/*"
- onChange={handleAttachFiles}
- />
- <Button
- onMouseDown={() => attachInputRef?.click()}
- tabIndex={-1}
- tooltip="Attach image or video"
- size="icon-composer"
- >
- <PaperclipIcon />
- </Button>
- <div class="flex items-center gap-3">
+ <EntityComposer.Footer class="items-center">
+ <Show when={team()}>
+ {(team) => (
+ <Tooltip label={sharingHint()} tabIndex={0}>
+ <ToggleSwitch
+ class="shrink-0 ml-0.5"
+ checked={shareWithTeam()}
+ onChange={setShareWithTeam}
+ disabled={isCreating()}
+ label={`Share with ${team().name}`}
+ labelClass="text-xs text-ink-muted font-normal whitespace-nowrap"
+ />
+ </Tooltip>
+ )}
+ </Show>
+ <div class="ml-auto flex items-center gap-3">
<ToggleSwitch
labelClass="text-xs text-ink-muted font-normal whitespace-nowrap"
onChange={setCreateMore}
@@ -1063,20 +1091,6 @@ export function ComposeTask(props: ComposeTaskProps) {
</div>
</EntityComposer.Footer>
- <div class="-mx-4 flex shrink-0 items-center gap-3 border-t border-edge-muted px-6 pt-4">
- <ToggleSwitch
- class="shrink-0"
- checked={shareWithTeam()}
- onChange={setShareWithTeam}
- disabled={isCreating()}
- label="Shared with Team"
- labelClass="text-xs text-ink-muted font-normal whitespace-nowrap"
- />
- <Tooltip label={sharingHint()} class="min-w-0" tabIndex={0}>
- <p class="truncate text-xs text-ink-muted">{sharingHint()}</p>
- </Tooltip>
- </div>
-
<SimilarTasksSection
title={title}
content={content}
diff --git a/docs/AGENT_GUIDE/tasks.md b/docs/AGENT_GUIDE/tasks.md
index 483cd3da76..c143d96599 100644
--- a/docs/AGENT_GUIDE/tasks.md
+++ b/docs/AGENT_GUIDE/tasks.md
@@ -332,16 +332,16 @@ filter sheets. Desktop uses the centered composer dialog.
2. A dialog opens with the title contenteditable focused (placeholder `New task`), plus
`Add description...`, and property buttons: `Not Started` (status), `Priority`, assignee
chip (defaults to you), `Due Date`, `Project` (when Projects is enabled; the standard
- property dropdown, listing projects), `Change or select tags`, `Attach image or video`,
- a `Create More` switch, and `Create Task Ctrl ↵`. If the chosen project can't be
+ property dropdown, listing projects), `Change or select tags`, a `Create More` switch,
+ and `Create Task Ctrl ↵`. `Attach image or video` (paperclip) sits just under the
+ description, above the property buttons. If the chosen project can't be
set, the task is still created and a toast says it wasn't added to the project.
- The `Shared with Team` row defaults to on and remembers your choice in local
- storage across composer openings and page reloads. Its hint explains whether
- the task will be visible to your whole team or only to you and the people you
- share it with. The choice also applies to Create More, continuing in a split,
- and tasks created from a project.
- This row sits below the creation buttons, separated by an edge-to-edge divider.
- A second divider separates it from Similar Tasks when matches are shown.
+ The `Share with <team name>` switch in the footer's left corner (hidden when you
+ aren't on a team) defaults to on and remembers your
+ choice in local storage across composer openings and page reloads. Hovering it
+ explains whether the task will be visible to your whole team or only to you and
+ the people you share it with. The choice also applies to Create More, continuing
+ in a split, and tasks created from a project.
3. `type_text` the title, then press **Ctrl+Enter** to create (the `Create Task` button
enables once there is a title). Dialog also offers `Continue editing in split` to open the
task as a full document.