fix stale stuff?
All checks were successful
ci / docker_image (push) Successful in 2m7s
ci / deploy (push) Successful in 25s

This commit is contained in:
Drake Marino 2026-04-11 23:40:23 -05:00
parent bce9a19776
commit 264b44f555
2 changed files with 44 additions and 37 deletions

View File

@ -8,7 +8,7 @@
--radius: 0.65rem;
--background: oklch(1 0 0);
--foreground: oklch(0.141 0.005 285.823);
--card: oklch(1 0 0);
--card: oklch(0.95 0 0);
--card-foreground: oklch(0.141 0.005 285.823);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.141 0.005 285.823);
@ -21,7 +21,7 @@
--accent: oklch(0.967 0.001 286.375);
--accent-foreground: oklch(0.21 0.006 285.885);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.92 0.004 286.32);
--border: oklch(0.9 0.004 286.32);
--input: oklch(0.92 0.004 286.32);
--ring: oklch(0.606 0.25 292.717);
--chart-1: oklch(0.646 0.222 41.116);
@ -37,7 +37,7 @@
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
--sidebar-border: oklch(0.92 0.004 286.32);
--sidebar-ring: oklch(0.606 0.25 292.717);
--warning: oklch(0.84 0.16 84);
--warning: oklch(0.6 0.16 84);
--error: oklch(0.577 0.245 27.325);
--positive: oklch(0.5 0.2067 147.18);
--action: oklch(0.5852 0.2263 260.47);
@ -134,63 +134,63 @@
}
@custom-variant data-open {
&:where([data-state="open"]), &:where([data-open]:not([data-open="false"])) {
@slot;
&:where([data-state="open"]), &:where([data-open]:not([data-open="false"])) {
@slot;
}
}
@custom-variant data-closed {
&:where([data-state="closed"]), &:where([data-closed]:not([data-closed="false"])) {
@slot;
&:where([data-state="closed"]), &:where([data-closed]:not([data-closed="false"])) {
@slot;
}
}
@custom-variant data-checked {
&:where([data-state="checked"]), &:where([data-checked]:not([data-checked="false"])) {
@slot;
&:where([data-state="checked"]), &:where([data-checked]:not([data-checked="false"])) {
@slot;
}
}
@custom-variant data-unchecked {
&:where([data-state="unchecked"]), &:where([data-unchecked]:not([data-unchecked="false"])) {
@slot;
&:where([data-state="unchecked"]), &:where([data-unchecked]:not([data-unchecked="false"])) {
@slot;
}
}
@custom-variant data-selected {
&:where([data-selected]) {
@slot;
&:where([data-selected]) {
@slot;
}
}
@custom-variant data-disabled {
&:where([data-disabled="true"]), &:where([data-disabled]:not([data-disabled="false"])) {
@slot;
&:where([data-disabled="true"]), &:where([data-disabled]:not([data-disabled="false"])) {
@slot;
}
}
@custom-variant data-active {
&:where([data-state="active"]), &:where([data-active]:not([data-active="false"])) {
@slot;
&:where([data-state="active"]), &:where([data-active]:not([data-active="false"])) {
@slot;
}
}
@custom-variant data-horizontal {
&:where([data-orientation="horizontal"]) {
@slot;
&:where([data-orientation="horizontal"]) {
@slot;
}
}
@custom-variant data-vertical {
&:where([data-orientation="vertical"]) {
@slot;
&:where([data-orientation="vertical"]) {
@slot;
}
}
@utility no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}

View File

@ -25,12 +25,19 @@
export let inquireCallback: (item: Item) => void;
export let claimCallback: (item: Item) => void;
let timeSincePosted: number | string = (new Date().getTime() - item.foundDate.getTime()) / 1000 / 60 / 60 / 24; // days
// if (timeSincePosted < 1) {
// timeSincePosted = '<1';
// } else {
// timeSincePosted = Math.round(timeSincePosted);
// }
// Normalize the foundDate in case it was serialized (string) in prod builds
// (SSR/JSON serialization often turns Date objects into strings).
const foundDateObj: Date = item?.foundDate instanceof Date
? item.foundDate
: new Date(item?.foundDate);
// Compute days since posted as a number (always a number, fall back to 0 on invalid date)
let timeSincePosted: number = (() => {
const t = foundDateObj?.getTime?.();
if (!t || Number.isNaN(t)) return 0;
return (Date.now() - t) / 1000 / 60 / 60 / 24; // days (float)
})();
// If you want to round/display differently you can do that in the template.
</script>
@ -59,13 +66,13 @@
<Tooltip.Trigger
>
<Badge variant="outline"
class="inline-block {user?.settings !== null && user?.settings !== undefined && timeSincePosted >= user.settings.staleItemDays ? 'text-warning' : ''}">{timeSincePosted < 1 ? "<1" : Math.round(timeSincePosted)}
class="inline-block {user?.settings?.staleItemDays !== undefined && timeSincePosted >= user.settings.staleItemDays ? 'text-warning' : ''}">{timeSincePosted < 1 ? "<1" : Math.round(timeSincePosted)}
day{(timeSincePosted <= 1) ? '' : 's'} ago
</Badge>
</Tooltip.Trigger
>
<Tooltip.Content>
<p>{item.foundDate.toLocaleDateString('en-US', dateFormatOptions)}</p>
<p>{foundDateObj.toLocaleDateString('en-US', dateFormatOptions)}</p>
</Tooltip.Content>
</Tooltip.Root>
</Tooltip.Provider>
@ -96,13 +103,13 @@
<Button variant="ghost" class="text-positive"
onclick={async () => {await approveDenyItem({id: item.id, approved: true});
invalidateAll()}}>
await invalidateAll()}}>
<CheckIcon />
Approve
</Button>
<Button variant="ghost" class="text-destructive"
onclick={async () => {await approveDenyItem({id: item.id, approved: false});
invalidateAll()}}>
await invalidateAll()}}>
<XIcon />
Deny
</Button>
@ -116,13 +123,13 @@
{:else}
<Button variant="ghost" class="text-destructive"
onclick={async () => {await approveDenyItem({id: item.id, approved: false});
invalidateAll()}}>
await invalidateAll()}}>
<TrashIcon />
Delete
</Button>
<Button variant="ghost" class="text-action"
onclick={async () => {await restoreClaimedItem(item.id);
invalidateAll()}}>
await invalidateAll()}}>
<ArchiveRestoreIcon />
Restore
</Button>