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.

styling(inbox): change checkbox + unread styling (#4699)

teo8e22c25f4842
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/inbox/InboxListEntity.tsx b/js/app/packages/app/component/next-soup/soup-view/views/inbox/InboxListEntity.tsx
index 434f3bffd0..70222afe3a 100644
--- a/js/app/packages/app/component/next-soup/soup-view/views/inbox/InboxListEntity.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/views/inbox/InboxListEntity.tsx
@@ -1,5 +1,5 @@
import { useChannelsContext } from '@core/context/channels';
-import { MaybeEntityRow, MultiSelectCheckbox } from '@entity';
+import { MaybeEntityRow, MultiSelectCheckbox, UnreadIndicator } from '@entity';
import type { BaseListEntityProps } from '@entity/composed/list-entity/shared';
import { cn } from '@ui';
import { createMemo, Show } from 'solid-js';
@@ -43,17 +43,30 @@ export function InboxListEntity(props: BaseListEntityProps) {
</MaybeEntityRow>
{/* Select checkbox lives in the gutter reserved by the card's `pl-9`. */}
<Show when={!props.hideCheckbox}>
- <div
- class={cn(
- 'absolute left-1 top-2.5 z-10 size-8 place-items-center',
- props.checked ? 'grid' : 'hidden group-hover/inbox-item:grid'
- )}
- >
- <MultiSelectCheckbox
- checked={props.checked}
- onChecked={props.onChecked}
- showBorder
- />
+ <div class="group/select-control absolute left-1 top-2.5 z-10 grid size-8 place-items-center">
+ <Show when={!props.checked}>
+ <div
+ aria-hidden="true"
+ class={cn(
+ 'pointer-events-none grid size-4 place-items-center rounded-xs group-hover/select-control:hidden',
+ !item().unread && 'border border-edge'
+ )}
+ >
+ <UnreadIndicator active={item().unread} />
+ </div>
+ </Show>
+ <div
+ class={cn(
+ 'absolute inset-0 place-items-center',
+ props.checked ? 'grid' : 'hidden group-hover/select-control:grid'
+ )}
+ >
+ <MultiSelectCheckbox
+ checked={props.checked}
+ onChecked={props.onChecked}
+ showBorder
+ />
+ </div>
</div>
</Show>
</div>
diff --git a/js/app/packages/app/component/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx b/js/app/packages/app/component/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx
index 3110a1cb3d..032b3ae2e8 100644
--- a/js/app/packages/app/component/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx
@@ -303,16 +303,6 @@ function GithubStatusIcon(props: { status?: string }) {
);
}
-function Badge(props: { unread: boolean }) {
- return (
- <Show when={props.unread}>
- <span class="flex shrink-0 items-center">
- <span class="size-2 rounded-full bg-accent" />
- </span>
- </Show>
- );
-}
-
function PropertyPills(props: { entityId: string; properties?: PropertyT[] }) {
const properties = createMemo(() => props.properties ?? []);
@@ -504,7 +494,6 @@ function BaseCard(props: {
<InboxCard.Body class="contents">
<InboxCard.Header class="col-start-2 row-start-1 self-center">
<InboxCard.Title class="flex items-center gap-1 truncate">
- <Badge unread={props.unread} />
{props.title}
</InboxCard.Title>
</InboxCard.Header>
@@ -637,7 +626,6 @@ export function ChannelCardLayout(props: InboxCardLayoutProps) {
<InboxCard.Body class="contents">
<InboxCard.Header class="col-start-2 row-start-1 self-center">
<InboxCard.Title class="flex items-center gap-1">
- <Badge unread={props.item.unread} />
{text().title}
</InboxCard.Title>
</InboxCard.Header>
@@ -854,7 +842,6 @@ export function ChannelThreadCardLayout(props: InboxCardLayoutProps) {
<div class={cn('col-start-2 row-start-2')}>
<InboxCard.Header class="self-center">
<InboxCard.Title class="flex items-center gap-1">
- <Badge unread={props.item.unread} />
{text().title}
</InboxCard.Title>
</InboxCard.Header>
@@ -1165,7 +1152,6 @@ export function EmailCardLayout(props: InboxCardLayoutProps) {
<InboxCard.Body class="contents">
<InboxCard.Header class="col-start-2 row-start-1 self-center">
<InboxCard.Title class="flex items-center gap-1">
- <Badge unread={props.item.unread} />
{text().sender}
</InboxCard.Title>
</InboxCard.Header>
@@ -1292,7 +1278,6 @@ export function GithubCardLayout(props: InboxCardLayoutProps) {
<InboxCard.Body class="contents">
<InboxCard.Header class="col-start-2 row-start-1 self-center">
<InboxCard.Title class="flex items-center gap-1">
- <Badge unread={props.item.unread} />
{text().title}
</InboxCard.Title>
</InboxCard.Header>