Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/features/dashboard/common/log-level-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
DropdownMenuRadioItem,
DropdownMenuTrigger,
} from '@/ui/primitives/dropdown-menu'
import { StatusIcon } from '@/ui/primitives/icons'
import type { LogLevelValue } from './log-cells'

const DEFAULT_OPTIONS: Array<{ value: LogLevelValue; label: string }> = [
Expand Down Expand Up @@ -63,16 +64,13 @@ export function LogLevelFilter({

function LevelIndicator({ level }: { level: LogLevelValue }) {
return (
<div
className={cn(
'size-3.5 rounded-full bg-bg border-[1.5px] border-dashed',
{
'border-fg-tertiary': level === 'debug',
'border-accent-info-highlight': level === 'info',
'border-accent-warning-highlight': level === 'warn',
'border-accent-error-highlight': level === 'error',
}
)}
<StatusIcon
className={cn({
'text-fg-tertiary!': level === 'debug',
'text-accent-info-highlight!': level === 'info',
'text-accent-warning-highlight!': level === 'warn',
'text-accent-error-highlight!': level === 'error',
})}
/>
)
}
41 changes: 24 additions & 17 deletions src/features/dashboard/templates/builds/status-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@/ui/primitives/dropdown-menu'
import { StatusIcon } from '@/ui/primitives/icons'
import { Status } from './table-cells'

const STATUS_OPTIONS: Array<{ value: BuildStatus; label: string }> = [
Expand Down Expand Up @@ -83,14 +84,15 @@ interface StatusIconsProps {
}

function StatusIcons({ selectedStatuses }: StatusIconsProps) {
const sortedStatuses = STATUS_DISPLAY_ORDER.filter((s) =>
selectedStatuses.includes(s)
)

return (
<div className="flex -space-x-1.5">
{sortedStatuses.map((status, i) => (
<DashedStatusCircleIcon key={status} status={status} index={i} />
<div className="flex -space-x-2">
{STATUS_DISPLAY_ORDER.map((status, i) => (
<DashedStatusCircleIcon
key={status}
status={status}
index={i}
selected={selectedStatuses.includes(status)}
/>
))}
</div>
)
Expand All @@ -99,23 +101,28 @@ function StatusIcons({ selectedStatuses }: StatusIconsProps) {
interface DashedStatusCircleIconProps {
status: BuildStatus
index: number
selected: boolean
}

function DashedStatusCircleIcon({
status,
index,
selected,
}: DashedStatusCircleIconProps) {
return (
<div
className={cn(
'size-3.5 rounded-full bg-bg border-[1.5px] border-dashed',
{
'border-fg-tertiary': status === 'building',
'border-accent-positive-highlight': status === 'success',
'border-accent-error-highlight': status === 'failed',
}
)}
<span
className="relative grid shrink-0 place-items-center"
style={{ rotate: `${index * 50}deg`, zIndex: index + 1 }}
/>
>
<span className="col-start-1 row-start-1 size-3.5 rounded-full bg-bg" />
<StatusIcon
className={cn('col-start-1 row-start-1', {
'text-fill!': !selected,
'text-fg-tertiary!': selected && status === 'building',
'text-accent-positive-highlight!': selected && status === 'success',
'text-accent-error-highlight!': selected && status === 'failed',
})}
/>
</span>
)
}
3 changes: 2 additions & 1 deletion src/ui/primitives/icons/status-icon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Icon, type IconProps } from './icon'

/**
* ![StatusIcon](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuMTY2IDhDMTQuMTY2IDExLjMxMzcgMTEuNDc5NyAxNCA4LjE2NjAyIDE0QzQuODUyMzEgMTQgMi4xNjYwMiAxMS4zMTM3IDIuMTY2MDIgOEMyLjE2NjAyIDQuNjg2MjkgNC44NTIzMSAyIDguMTY2MDIgMkMxMS40Nzk3IDIgMTQuMTY2IDQuNjg2MjkgMTQuMTY2IDhaIiBzdHJva2U9IiM4ODg4ODgiIHN0cm9rZS13aWR0aD0iMS4zMzMzMyIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLWRhc2hhcnJheT0iMS4zMyAyLjY3Ii8+PC9zdmc+)
* ![StatusIcon](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuMTY2IDhDMTQuMTY2IDExLjMxMzcgMTEuNDc5NyAxNCA4LjE2NjAyIDE0QzQuODUyMzEgMTQgMi4xNjYwMiAxMS4zMTM3IDIuMTY2MDIgOEMyLjE2NjAyIDQuNjg2MjkgNC44NTIzMSAyIDguMTY2MDIgMkMxMS40Nzk3IDIgMTQuMTY2IDQuNjg2MjkgMTQuMTY2IDhaIiBzdHJva2U9IiM4ODg4ODgiIHN0cm9rZS13aWR0aD0iMS4zMzMzMyIgc3Ryb2tlLWxpbmVjYXA9InNxdWFyZSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLWRhc2hhcnJheT0iMS4zMyAyLjY3IiBwYXRoTGVuZ3RoPSIzMiIvPjwvc3ZnPg==)
*
* Synced from Figma `Icon/16px/Status`.
*/
Expand All @@ -14,6 +14,7 @@ export const StatusIcon = (props: IconProps) => (
strokeLinejoin="round"
strokeWidth="1.33333"
strokeDasharray="1.33 2.67"
pathLength={32}
Comment thread
drankou marked this conversation as resolved.
/>
</Icon>
)
Loading