1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 16:41:59 +00:00

chore(web): timeline bucketing by day

This commit is contained in:
Alex 2024-06-02 08:58:57 +07:00
parent 01f52c9021
commit 95da3eb7a0
No known key found for this signature in database
GPG key ID: 53CD082B3A5E1082
2 changed files with 7 additions and 2 deletions

View file

@ -43,6 +43,7 @@
public timeGroup = ''; public timeGroup = '';
public date!: DateTime; public date!: DateTime;
public hasLabel = false; public hasLabel = false;
public hasDotIndicator = false;
} }
const calculateSegments = (buckets: AssetBucket[]) => { const calculateSegments = (buckets: AssetBucket[]) => {
@ -60,6 +61,10 @@
height = 0; height = 0;
} }
if (previous?.date.month !== segment.date.month) {
segment.hasDotIndicator = true;
}
height += segment.height; height += segment.height;
previous = segment; previous = segment;
return segment; return segment;
@ -164,7 +169,7 @@
> >
{segment.date.year} {segment.date.year}
</div> </div>
{:else if segment.height > 5} {:else if segment.height > 5 && segment.hasDotIndicator}
<div <div
aria-label={segment.timeGroup + ' ' + segment.count} aria-label={segment.timeGroup + ' ' + segment.count}
class="absolute right-0 mr-3 block h-[4px] w-[4px] rounded-full bg-gray-300" class="absolute right-0 mr-3 block h-[4px] w-[4px] rounded-full bg-gray-300"

View file

@ -86,7 +86,7 @@ export class AssetStore {
options: AssetStoreOptions, options: AssetStoreOptions,
private albumId?: string, private albumId?: string,
) { ) {
this.options = { ...options, size: TimeBucketSize.Month }; this.options = { ...options, size: TimeBucketSize.Day };
this.store$.set(this); this.store$.set(this);
} }