chore: single line block comments (#30852)

This commit is contained in:
Daniel Dietzler 2026-08-18 17:55:26 +02:00 committed by GitHub
parent 80a90fabf3
commit 03da1ba108
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 102 additions and 294 deletions

View file

@ -1,6 +1,4 @@
/**
Focus the given element when it is mounted.
*/
/** Focus the given element when it is mounted. */
export const initInput = (element: HTMLInputElement) => {
element.focus();
};

View file

@ -55,9 +55,7 @@
}
const groupOptions: AlbumGroupOption = {
/**
No grouping
*/
/** No grouping */
[AlbumGroupBy.None]: (order, albums): AlbumGroup[] => {
return [
{
@ -68,9 +66,7 @@
];
},
/**
Group by year
*/
/** Group by year */
[AlbumGroupBy.Year]: (order, albums): AlbumGroup[] => {
const unknownYear = $t('unknown_year');
const useStartDate = userSettings.sortBy === AlbumSortBy.OldestPhoto;
@ -96,9 +92,7 @@
}));
},
/**
Group by owner
*/
/** Group by owner */
[AlbumGroupBy.Owner]: (order, albums): AlbumGroup[] => {
const currentUserId = authManager.user.id;
const groupedByOwnerIds = groupBy(albums, (album) => album.albumUsers[0].user.id);

View file

@ -108,9 +108,7 @@
updateOcrBoxes(ocrManager.showOverlay, ocrManager.data);
});
/**
Use updateOnly=true on zoom, pan, or resize.
*/
/** Use updateOnly=true on zoom, pan, or resize. */
const updateOcrBoxes = (showOverlay: boolean, ocrData: OcrBoundingBox[], updateOnly = false) => {
if (!viewer || !viewer.state.textureData || !viewer.getPlugin(MarkersPlugin)) {
return;

View file

@ -11,54 +11,30 @@
import { fade, fly } from 'svelte/transition';
interface Props {
/**
Offset from the top of the timeline (e.g., for headers)
*/
/** Offset from the top of the timeline (e.g., for headers) */
timelineTopOffset?: number;
/**
Offset from the bottom of the timeline (e.g., for footers)
*/
/** Offset from the bottom of the timeline (e.g., for footers) */
timelineBottomOffset?: number;
/**
Total height of the scrubber component
*/
/** Total height of the scrubber component */
height?: number;
/**
Timeline manager instance that controls the timeline state
*/
/** Timeline manager instance that controls the timeline state */
timelineManager: TimelineManager;
/**
Overall scroll percentage through the entire timeline (0-1), used when no specific month is targeted
*/
/** Overall scroll percentage through the entire timeline (0-1), used when no specific month is targeted */
timelineScrollPercent?: number;
/**
The percentage of scroll through the month that is currently intersecting the top boundary of the viewport
*/
/** The percentage of scroll through the month that is currently intersecting the top boundary of the viewport */
viewportTopMonthScrollPercent?: number;
/**
The year/month of the timeline month at the top of the viewport
*/
/** The year/month of the timeline month at the top of the viewport */
viewportTopMonth?: ViewportTopMonth;
/**
Width of the scrubber component in pixels (bindable for parent component margin adjustments)
*/
/** Width of the scrubber component in pixels (bindable for parent component margin adjustments) */
scrubberWidth?: number;
/**
Callback fired when user interacts with the scrubber to navigate
*/
/** Callback fired when user interacts with the scrubber to navigate */
onScrub?: ScrubberListener;
/**
Callback fired when keyboard events occur on the scrubber
*/
/** Callback fired when keyboard events occur on the scrubber */
onScrubKeyDown?: (event: KeyboardEvent, element: HTMLElement) => void;
/**
Callback fired when scrubbing starts
*/
/** Callback fired when scrubbing starts */
startScrub?: ScrubberListener;
/**
Callback fired when scrubbing stops
*/
/** Callback fired when scrubbing stops */
stopScrub?: ScrubberListener;
}

View file

@ -223,46 +223,34 @@ export const stringToSortOrder = (order: string) => {
};
const sortOptions: AlbumSortOption = {
/**
Sort by album title
*/
/** Sort by album title */
[AlbumSortBy.Title]: (order, albums) => {
const sortSign = order === SortOrder.Desc ? -1 : 1;
return albums.slice().sort((a, b) => a.albumName.localeCompare(b.albumName, get(locale)) * sortSign);
},
/**
Sort by asset count
*/
/** Sort by asset count */
[AlbumSortBy.ItemCount]: (order, albums) => {
return orderBy(albums, 'assetCount', [order]);
},
/**
Sort by last modified
*/
/** Sort by last modified */
[AlbumSortBy.DateModified]: (order, albums) => {
return orderBy(albums, [({ updatedAt }) => new Date(updatedAt)], [order]);
},
/**
Sort by creation date
*/
/** Sort by creation date */
[AlbumSortBy.DateCreated]: (order, albums) => {
return orderBy(albums, [({ createdAt }) => new Date(createdAt)], [order]);
},
/**
Sort by the most recent photo date
*/
/** Sort by the most recent photo date */
[AlbumSortBy.MostRecentPhoto]: (order, albums) => {
albums = orderBy(albums, [({ endDate }) => (endDate ? new Date(endDate) : '')], [order]);
return albums.sort(sortUnknownYearAlbums);
},
/**
Sort by the oldest photo date
*/
/** Sort by the oldest photo date */
[AlbumSortBy.OldestPhoto]: (order, albums) => {
albums = orderBy(albums, [({ startDate }) => (startDate ? new Date(startDate) : '')], [order]);
return albums.sort(sortUnknownYearAlbums);

View file

@ -6,13 +6,9 @@ import { handleError } from '$lib/utils/handle-error';
* and allowing operations to check if they're still valid.
*/
export class InvocationTracker {
/**
Counter for the number of invocations that have been started
*/
/** Counter for the number of invocations that have been started */
invocationsStarted = 0;
/**
Counter for the number of invocations that have been completed
*/
/** Counter for the number of invocations that have been completed */
invocationsEnded = 0;
constructor() {}

View file

@ -92,9 +92,7 @@ interface AssetGridRoute extends Route {
type ImmichRoute = AssetRoute | AssetGridRoute;
type NavOptions = {
/*
navigate even if url is the same
*/
/* navigate even if url is the same */
forceNavigate?: boolean | undefined;
replaceState?: boolean | undefined;
noScroll?: boolean | undefined;

View file

@ -1,9 +1,7 @@
import type { ParamMatcher } from '@sveltejs/kit';
import { UUID_REGEX } from '$lib/constants';
/*
Returns true if the given param matches UUID format
*/
/* Returns true if the given param matches UUID format */
export const match: ParamMatcher = (param: string) => {
return UUID_REGEX.test(param);
};

View file

@ -33,9 +33,7 @@
}
const groupOptions: PlacesGroupOption = {
/**
No grouping
*/
/** No grouping */
[PlacesGroupBy.None]: (places): PlacesGroup[] => {
return [
{
@ -46,9 +44,7 @@
];
},
/**
Group by year
*/
/** Group by year */
[PlacesGroupBy.Country]: (places): PlacesGroup[] => {
const unknownCountry = $t('unknown_country');