design: fix broken commands styling

This commit is contained in:
James Xylight committed 2025-08-24 10:38:41 -07:00
1 parent bd51f4319b
commit 952120a886
8 files changed
+44 -23

No files matched your search

@@ -57,7 +57,7 @@
size="sm" size="sm"
class="text-slate-500 dark:text-zinc-400" class="text-slate-500 dark:text-zinc-400"
onclick={() => (replying = !replying)} onclick={() => (replying = !replying)}
disabled={comment.post.locked || disabled} disabled={comment.post.locked || disabled || !profile.current.jwt}
> >
<Icon src={ChatBubbleOvalLeft} size="15" micro /> <Icon src={ChatBubbleOvalLeft} size="15" micro />
{$t('comment.reply')} {$t('comment.reply')}
@@ -75,7 +75,7 @@
<div class="flex flex-row"> <div class="flex flex-row">
<MenuButton <MenuButton
onclick={() => share()} onclick={() => share()}
class={['flex-1', !post.post.local && 'rounded-r-xl']} class={['flex-1', !post.post.local && 'rounded-r-lg']}
> >
{#snippet prefix()} {#snippet prefix()}
<Icon src={Share} size="16" micro /> <Icon src={Share} size="16" micro />
@@ -84,11 +84,11 @@
</MenuButton> </MenuButton>
<!--svelte-ignore a11y_no_static_element_interactions --> <!--svelte-ignore a11y_no_static_element_interactions -->
<!--svelte-ignore a11y_click_events_have_key_events--> <!--svelte-ignore a11y_click_events_have_key_events-->
<div {#if !post.post.local}
class="aspect-square w-max m-1 grid place-items-center" <div
onclick={e => e.stopPropagation()} class="aspect-square w-max m-1 grid place-items-center"
> onclick={e => e.stopPropagation()}
{#if !post.post.local} >
<Menu> <Menu>
{#snippet target()} {#snippet target()}
<Button <Button
@@ -120,8 +120,8 @@
{$t('filter.location.local')} {$t('filter.location.local')}
</MenuButton> </MenuButton>
</Menu> </Menu>
{/if} </div>
</div> {/if}
</div> </div>
{#if profile.current?.jwt} {#if profile.current?.jwt}
<MenuButton <MenuButton
+12 -2
View File
@@ -2,12 +2,19 @@
import type { ClassValue } from 'svelte/elements' import type { ClassValue } from 'svelte/elements'
const sizes = { const sizes = {
xs: 'text-xs px-3 mt-3 mb-1', xs: 'text-xs',
sm: 'text-sm', sm: 'text-sm',
md: 'text-base', md: 'text-base',
lg: 'text-lg', lg: 'text-lg',
} }
const margins = {
none: '',
sm: 'mt-3 mb-1 px-3',
md: 'mt-4 mb-2',
lg: 'mt-5 mb-3',
}
const colors = { const colors = {
subtle: 'text-slate-600 dark:text-zinc-400', subtle: 'text-slate-600 dark:text-zinc-400',
none: '', none: '',
@@ -17,6 +24,7 @@
class?: ClassValue class?: ClassValue
size?: keyof typeof sizes size?: keyof typeof sizes
color?: keyof typeof colors color?: keyof typeof colors
margin?: keyof typeof margins
border?: boolean border?: boolean
children?: import('svelte').Snippet children?: import('svelte').Snippet
action?: import('svelte').Snippet action?: import('svelte').Snippet
@@ -29,6 +37,7 @@
border = true, border = true,
size = 'sm', size = 'sm',
color = 'subtle', color = 'subtle',
margin = 'none',
}: Props = $props() }: Props = $props()
</script> </script>
@@ -37,6 +46,7 @@
'flex flex-row items-center gap-2 flex-wrap', 'flex flex-row items-center gap-2 flex-wrap',
sizes[size], sizes[size],
colors[color], colors[color],
margins[margin],
clazz, clazz,
]} ]}
> >
@@ -45,7 +55,7 @@
</h3> </h3>
<div <div
class={[ class={[
'flex-1 border-slate-200 dark:border-zinc-800 border-b', 'flex-1 border-slate-200/70 dark:border-zinc-800 border-b',
!border && 'opacity-0', !border && 'opacity-0',
]} ]}
></div> ></div>
@@ -21,6 +21,7 @@
alignment="left" alignment="left"
color="none" color="none"
size="custom" size="custom"
class="block w-full"
data-sveltekit-preload-code="viewport" data-sveltekit-preload-code="viewport"
data-sveltekit-preload-data="tap" data-sveltekit-preload-data="tap"
{...rest} {...rest}
@@ -28,21 +29,27 @@
{#if typeof action.icon === 'string'} {#if typeof action.icon === 'string'}
<Avatar url={action.icon} width={20} /> <Avatar url={action.icon} width={20} />
{:else} {:else}
<Icon src={action.icon ?? QuestionMarkCircle} size="20" /> <Icon
src={action.icon ?? QuestionMarkCircle}
solid
size="20"
class="text-slate-600 dark:text-zinc-400"
/>
{/if} {/if}
{@render children?.()} {@render children?.()}
<span class="mr-auto inline-flex flex-col"> <div class="inline-flex flex-col">
<span>{action.name}</span> <span>{action.name}</span>
{#if action.detail} {#if action.detail}
<span class="font-normal text-xs">{action.detail}</span> <span class="font-normal text-xs">{action.detail}</span>
{/if} {/if}
</span> </div>
<div class="flex-1"></div>
{#if action.shortcut} {#if action.shortcut}
<div class="flex items-center gap-0.5 text-xs font-medium"> <div class="flex items-center gap-0.5 text-xs font-medium">
⌘ {action.shortcut} ⌘ {action.shortcut}
</div> </div>
{/if} {/if}
{#if action.subActions} {#if action.subActions}
<Icon src={ArrowUturnDown} size="16" micro /> <Icon src={ArrowUturnDown} size="16" micro class="" />
{/if} {/if}
</Button> </Button>
@@ -13,6 +13,7 @@
import CommandItem from './CommandItem.svelte' import CommandItem from './CommandItem.svelte'
import { fuzzySearch } from '$lib/util.svelte' import { fuzzySearch } from '$lib/util.svelte'
import CommonList from '../../layout/CommonList.svelte' import CommonList from '../../layout/CommonList.svelte'
import EndPlaceholder from '../../EndPlaceholder.svelte'
interface Props { interface Props {
open?: boolean open?: boolean
@@ -253,7 +254,7 @@
<div class="space-y-1" bind:this={container}> <div class="space-y-1" bind:this={container}>
{#each filteredGroups as group, groupIndex} {#each filteredGroups as group, groupIndex}
<div class="space-y-1"> <div class="space-y-1">
<span class="text-sm font-medium">{group.name}</span> <EndPlaceholder margin="md" size="sm">{group.name}</EndPlaceholder>
<CommonList size="xs" class="p-0! sm:p-0! lg:p-0!"> <CommonList size="xs" class="p-0! sm:p-0! lg:p-0!">
{#each group.actions as action, actionIndex} {#each group.actions as action, actionIndex}
{@const globalIndex = {@const globalIndex =
@@ -263,7 +264,8 @@
<li <li
class={[ class={[
'custom-size', 'custom-size',
globalIndex == selectedIndex && 'brightness-125', globalIndex == selectedIndex &&
'brightness-95 dark:brightness-125',
]} ]}
> >
<CommandItem <CommandItem
+5 -3
View File
@@ -41,7 +41,7 @@
{style} {style}
> >
<ProfileSelection profiles={profile.meta.profiles} /> <ProfileSelection profiles={profile.meta.profiles} />
<EndPlaceholder size="xs">{$t('profile.profile')}</EndPlaceholder> <EndPlaceholder margin="sm" size="xs">{$t('profile.profile')}</EndPlaceholder>
{#if profile.current?.jwt} {#if profile.current?.jwt}
<SidebarButton <SidebarButton
icon={UserCircle} icon={UserCircle}
@@ -76,7 +76,7 @@
icon={UserGroup} icon={UserGroup}
/> />
{/if} {/if}
<EndPlaceholder size="xs">{$t('nav.menu.app')}</EndPlaceholder> <EndPlaceholder margin="sm" size="xs">{$t('nav.menu.app')}</EndPlaceholder>
<SidebarButton <SidebarButton
href="/settings" href="/settings"
label={$t('nav.menu.settings')} label={$t('nav.menu.settings')}
@@ -107,7 +107,9 @@
</Select> </Select>
<SidebarButton href="/theme" label={$t('nav.menu.theme')} icon={Swatch} /> <SidebarButton href="/theme" label={$t('nav.menu.theme')} icon={Swatch} />
{#if profile.current?.user} {#if profile.current?.user}
<EndPlaceholder size="xs">{$t('content.communities')}</EndPlaceholder> <EndPlaceholder margin="sm" size="xs">
{$t('content.communities')}
</EndPlaceholder>
<div class="space-y-3"> <div class="space-y-3">
{#if profile.current?.user.moderates.length > 0} {#if profile.current?.user.moderates.length > 0}
+1 -1
View File
@@ -102,7 +102,7 @@ bg-white/50 dark:bg-black/50 box-border p-4"
dark:border-zinc-900 dark:border-zinc-900
rounded-3xl max-w-lg box-border mx-auto overscroll-contain shadow-lg overflow-auto rounded-3xl max-w-lg box-border mx-auto overscroll-contain shadow-lg overflow-auto
p-5 flex flex-col gap-2 dark:bg-zinc-950 p-5 flex flex-col gap-2 dark:bg-zinc-950
bg-white relative {clazz}" bg-slate-50 relative {clazz}"
> >
{#if dismissable} {#if dismissable}
<Button <Button
+2 -2
View File
@@ -49,11 +49,11 @@
> >
{#snippet popover()} {#snippet popover()}
<div <div
class="w-full max-w-sm origin-top-left max-h-128 overflow-auto list-none shadow-lg rounded-xl" class="w-full max-w-sm max-h-128 overflow-auto list-none shadow-lg rounded-xl"
> >
<div <div
class="flex flex-col p-1 list-none bg-white/80 dark:bg-zinc-900/90 rounded-xl class="flex flex-col p-1 list-none bg-white/80 dark:bg-zinc-900/90 rounded-xl
border border-slate-300 dark:border-zinc-800 border-opacity-50 gap-px" border border-slate-200 dark:border-zinc-800 gap-px"
> >
{@render children?.(open)} {@render children?.(open)}
</div> </div>