fix(desktop): catalog counts use compactNumber and a Codicon star
Also drops cursor-pointer RowButton already sets, and Install from Git uses textStrong instead of text plus underline.
This commit is contained in:
committed by
brooklyn!
parent
770735b8a3
commit
c756986db2
@@ -1,4 +1,4 @@
|
||||
import { groupCatalogPlugins, PLUGIN_CATEGORIES } from '@hermes/shared'
|
||||
import { compactNumber, groupCatalogPlugins, PLUGIN_CATEGORIES } from '@hermes/shared'
|
||||
import { useStore } from '@nanostores/react'
|
||||
import { memo, type ReactNode, useDeferredValue, useEffect, useRef, useState } from 'react'
|
||||
|
||||
@@ -377,7 +377,7 @@ export const CatalogBrowser = memo(function CatalogBrowser({
|
||||
{section.label}
|
||||
</Button>
|
||||
<span className="text-xs font-normal text-(--ui-text-tertiary)">
|
||||
{section.entries.length.toLocaleString()}
|
||||
{compactNumber(section.entries.length)}
|
||||
</span>
|
||||
</h3>
|
||||
<Button onClick={() => filters.chooseCategory(section.key)} size="inline" variant="text">
|
||||
|
||||
@@ -88,7 +88,7 @@ export function CatalogCard({ entry, action, accentIndex, onOpen, onCategory, on
|
||||
<RowButton
|
||||
aria-haspopup="dialog"
|
||||
aria-label={entry.name}
|
||||
className="min-w-0 flex-1 cursor-pointer text-left font-semibold leading-snug after:absolute after:inset-0 after:rounded-[inherit] focus-visible:outline-none focus-visible:after:outline-2 focus-visible:after:outline-primary focus-visible:after:-outline-offset-2"
|
||||
className="min-w-0 flex-1 text-left font-semibold leading-snug after:absolute after:inset-0 after:rounded-[inherit] focus-visible:outline-none focus-visible:after:outline-2 focus-visible:after:outline-primary focus-visible:after:-outline-offset-2"
|
||||
onClick={() => onOpen(entry)}
|
||||
>
|
||||
<span className="line-clamp-2 min-w-0 break-words text-lg">{entry.name}</span>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { compactNumber } from '@hermes/shared'
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
import { SidebarDateDivider, SidebarSectionMeta } from '@/app/chat/sidebar/chrome'
|
||||
@@ -44,7 +45,7 @@ function FacetItem({ row, active, onClick }: { row: FacetRow; active: boolean; o
|
||||
onClick={onClick}
|
||||
pressed={active}
|
||||
trailing={
|
||||
row.count !== undefined ? <SidebarSectionMeta>{row.count.toLocaleString()}</SidebarSectionMeta> : undefined
|
||||
row.count !== undefined ? <SidebarSectionMeta>{compactNumber(row.count)}</SidebarSectionMeta> : undefined
|
||||
}
|
||||
/>
|
||||
)
|
||||
@@ -104,7 +105,7 @@ export function CatalogFilters({
|
||||
return (
|
||||
<OverlaySidebar className={className}>
|
||||
<div className="flex h-7 shrink-0 items-center gap-2 pb-1">
|
||||
<SidebarPanelLabel meta={resultCount.toLocaleString()}>{c.discover}</SidebarPanelLabel>
|
||||
<SidebarPanelLabel meta={compactNumber(resultCount)}>{c.discover}</SidebarPanelLabel>
|
||||
{filtered && (
|
||||
<Button aria-label={c.clearFilters} className="ml-auto" onClick={onClear} size="inline" variant="text">
|
||||
{t.common.clear}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { compactNumber } from '@hermes/shared'
|
||||
import { useState } from 'react'
|
||||
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Codicon } from '@/components/ui/codicon'
|
||||
import { Tip } from '@/components/ui/tooltip'
|
||||
import { useI18n } from '@/i18n'
|
||||
import { fmtDateTime, relativeTime } from '@/lib/time'
|
||||
@@ -44,8 +46,8 @@ export function CatalogHeaderMeta({ entry }: { entry: CatalogEntry }) {
|
||||
)}
|
||||
{entry.stars !== null && entry.stars > 0 && (
|
||||
<span className="flex shrink-0 items-center gap-0.5 text-[0.65rem] text-(--ui-text-tertiary)">
|
||||
<span aria-hidden>★</span>
|
||||
{entry.stars.toLocaleString()}
|
||||
<Codicon name="star-full" size="0.65rem" />
|
||||
{compactNumber(entry.stars)}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
|
||||
@@ -514,12 +514,7 @@ export function PluginActions({ profile }: { profile: ProfileScope }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
className="underline"
|
||||
onClick={() => openPluginInstallRequest({ profile: scope, repo: '' })}
|
||||
size="xs"
|
||||
variant="text"
|
||||
>
|
||||
<Button onClick={() => openPluginInstallRequest({ profile: scope, repo: '' })} size="xs" variant="textStrong">
|
||||
{d.installModal.installFromGit}
|
||||
</Button>
|
||||
<Tip label={d.openFolder}>
|
||||
|
||||
Reference in New Issue
Block a user