Skip to content

Commit 15646a8

Browse files
committed
chore: fix linter
1 parent e268a1f commit 15646a8

File tree

6 files changed

+5
-53
lines changed

6 files changed

+5
-53
lines changed

web/src/components/MemoEditor/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ const MemoEditorImpl: React.FC<MemoEditorProps> = ({
5454
const { userGeneralSetting } = useAuth();
5555

5656
// Get default visibility from user settings
57-
const defaultVisibility = userGeneralSetting?.memoVisibility
58-
? convertVisibilityFromString(userGeneralSetting.memoVisibility)
59-
: undefined;
57+
const defaultVisibility = userGeneralSetting?.memoVisibility ? convertVisibilityFromString(userGeneralSetting.memoVisibility) : undefined;
6058

6159
useMemoInit(editorRef, memoName, cacheKey, currentUser?.name ?? "", autoFocus, defaultVisibility);
6260

web/src/components/MemoView/components/metadata/AttachmentCard.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { cn } from "@/lib/utils";
22
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
3-
import { getAttachmentType, getAttachmentUrl, getColorspace } from "@/utils/attachment";
3+
import { getAttachmentType, getAttachmentUrl } from "@/utils/attachment";
44

55
interface AttachmentCardProps {
66
attachment: Attachment;
@@ -25,14 +25,7 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps)
2525
}
2626

2727
if (attachmentType === "video/*") {
28-
return (
29-
<video
30-
src={sourceUrl}
31-
className={cn("w-full h-full object-cover rounded-lg", className)}
32-
controls
33-
preload="metadata"
34-
/>
35-
);
28+
return <video src={sourceUrl} className={cn("w-full h-full object-cover rounded-lg", className)} controls preload="metadata" />;
3629
}
3730

3831
return null;

web/src/components/MemoView/components/metadata/AttachmentList.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ const AttachmentList = ({ attachments }: AttachmentListProps) => {
131131
onOpenChange={(open: boolean) => setPreviewImage((prev) => ({ ...prev, open }))}
132132
imgUrls={previewImage.urls}
133133
initialIndex={previewImage.index}
134-
mimeType={previewImage.mimeType}
135134
/>
136135
</>
137136
);

web/src/components/PreviewImageDialog.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@ import { X } from "lucide-react";
22
import React, { useEffect, useState } from "react";
33
import { Button } from "@/components/ui/button";
44
import { Dialog, DialogContent } from "@/components/ui/dialog";
5-
import { getColorspace } from "@/utils/attachment";
65

76
interface Props {
87
open: boolean;
98
onOpenChange: (open: boolean) => void;
109
imgUrls: string[];
1110
initialIndex?: number;
12-
mimeType?: string; // MIME type for HDR detection
1311
}
1412

15-
function PreviewImageDialog({ open, onOpenChange, imgUrls, initialIndex = 0, mimeType }: Props) {
13+
function PreviewImageDialog({ open, onOpenChange, imgUrls, initialIndex = 0 }: Props) {
1614
const [currentIndex, setCurrentIndex] = useState(initialIndex);
17-
const colorspace = mimeType ? getColorspace(mimeType) : undefined;
1815

1916
// Update current index when initialIndex prop changes
2017
useEffect(() => {
@@ -83,7 +80,6 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls, initialIndex = 0, mim
8380
draggable={false}
8481
loading="eager"
8582
decoding="async"
86-
{...(colorspace && { colorSpace: colorspace as unknown as string })}
8783
/>
8884
</div>
8985

web/src/components/Settings/PreferencesSection.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ const PreferencesSection = () => {
8282

8383
<SettingGroup title={t("setting.preference")} showSeparator>
8484
<SettingRow label={t("setting.preference-section.default-memo-visibility")}>
85-
<Select
86-
value={setting.memoVisibility || "PRIVATE"}
87-
onValueChange={handleDefaultMemoVisibilityChanged}
88-
>
85+
<Select value={setting.memoVisibility || "PRIVATE"} onValueChange={handleDefaultMemoVisibilityChanged}>
8986
<SelectTrigger className="min-w-fit">
9087
<div className="flex items-center gap-2">
9188
<VisibilityIcon visibility={convertVisibilityFromString(setting.memoVisibility)} />

web/src/utils/attachment.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,3 @@ export const isMidiFile = (mimeType: string): boolean => {
5252
const isPSD = (t: string) => {
5353
return t === "image/vnd.adobe.photoshop" || t === "image/x-photoshop" || t === "image/photoshop";
5454
};
55-
56-
// HDR-capable MIME types that support wide color gamut
57-
export const HDR_CAPABLE_FORMATS = [
58-
"image/heic",
59-
"image/heif",
60-
"image/webp",
61-
"image/png", // PNG can contain ICC profiles for wide gamut
62-
"image/jpeg", // JPEG can support extended color via profiles
63-
"video/mp4", // Can contain HDR tracks
64-
"video/quicktime", // Can contain HDR tracks
65-
"video/x-matroska", // Can contain HDR tracks
66-
"video/webm", // VP9 Profile 2 for HDR
67-
];
68-
69-
// isHDRCapable returns true if the MIME type supports HDR/wide color gamut.
70-
export const isHDRCapable = (mimeType: string): boolean => {
71-
return HDR_CAPABLE_FORMATS.some((format) => mimeType.startsWith(format));
72-
};
73-
74-
// getColorspace returns the appropriate colorspace attribute for wide gamut images.
75-
// Returns "display-p3" for HDR-capable formats, undefined for standard images.
76-
export const getColorspace = (mimeType: string): string | undefined => {
77-
return isHDRCapable(mimeType) ? "display-p3" : undefined;
78-
};
79-
80-
// supportsHDR checks if the browser supports wide color gamut display.
81-
// Uses CSS.supports() to detect color-gamut capability.
82-
export const supportsHDR = (): boolean => {
83-
if (typeof CSS === "undefined") return false;
84-
return CSS.supports("(color-gamut: srgb)") && CSS.supports("(color-gamut: p3)");
85-
};

0 commit comments

Comments
 (0)