Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
15646a89
Commit
15646a89
authored
Jan 05, 2026
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix linter
parent
e268a1fe
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
53 deletions
+5
-53
index.tsx
web/src/components/MemoEditor/index.tsx
+1
-3
AttachmentCard.tsx
...omponents/MemoView/components/metadata/AttachmentCard.tsx
+2
-9
AttachmentList.tsx
...omponents/MemoView/components/metadata/AttachmentList.tsx
+0
-1
PreviewImageDialog.tsx
web/src/components/PreviewImageDialog.tsx
+1
-5
PreferencesSection.tsx
web/src/components/Settings/PreferencesSection.tsx
+1
-4
attachment.ts
web/src/utils/attachment.ts
+0
-31
No files found.
web/src/components/MemoEditor/index.tsx
View file @
15646a89
...
@@ -54,9 +54,7 @@ const MemoEditorImpl: React.FC<MemoEditorProps> = ({
...
@@ -54,9 +54,7 @@ const MemoEditorImpl: React.FC<MemoEditorProps> = ({
const
{
userGeneralSetting
}
=
useAuth
();
const
{
userGeneralSetting
}
=
useAuth
();
// Get default visibility from user settings
// Get default visibility from user settings
const
defaultVisibility
=
userGeneralSetting
?.
memoVisibility
const
defaultVisibility
=
userGeneralSetting
?.
memoVisibility
?
convertVisibilityFromString
(
userGeneralSetting
.
memoVisibility
)
:
undefined
;
?
convertVisibilityFromString
(
userGeneralSetting
.
memoVisibility
)
:
undefined
;
useMemoInit
(
editorRef
,
memoName
,
cacheKey
,
currentUser
?.
name
??
""
,
autoFocus
,
defaultVisibility
);
useMemoInit
(
editorRef
,
memoName
,
cacheKey
,
currentUser
?.
name
??
""
,
autoFocus
,
defaultVisibility
);
...
...
web/src/components/MemoView/components/metadata/AttachmentCard.tsx
View file @
15646a89
import
{
cn
}
from
"@/lib/utils"
;
import
{
cn
}
from
"@/lib/utils"
;
import
type
{
Attachment
}
from
"@/types/proto/api/v1/attachment_service_pb"
;
import
type
{
Attachment
}
from
"@/types/proto/api/v1/attachment_service_pb"
;
import
{
getAttachmentType
,
getAttachmentUrl
,
getColorspace
}
from
"@/utils/attachment"
;
import
{
getAttachmentType
,
getAttachmentUrl
}
from
"@/utils/attachment"
;
interface
AttachmentCardProps
{
interface
AttachmentCardProps
{
attachment
:
Attachment
;
attachment
:
Attachment
;
...
@@ -25,14 +25,7 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps)
...
@@ -25,14 +25,7 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps)
}
}
if
(
attachmentType
===
"video/*"
)
{
if
(
attachmentType
===
"video/*"
)
{
return
(
return
<
video
src=
{
sourceUrl
}
className=
{
cn
(
"w-full h-full object-cover rounded-lg"
,
className
)
}
controls
preload=
"metadata"
/>;
<
video
src=
{
sourceUrl
}
className=
{
cn
(
"w-full h-full object-cover rounded-lg"
,
className
)
}
controls
preload=
"metadata"
/>
);
}
}
return
null
;
return
null
;
...
...
web/src/components/MemoView/components/metadata/AttachmentList.tsx
View file @
15646a89
...
@@ -131,7 +131,6 @@ const AttachmentList = ({ attachments }: AttachmentListProps) => {
...
@@ -131,7 +131,6 @@ const AttachmentList = ({ attachments }: AttachmentListProps) => {
onOpenChange=
{
(
open
:
boolean
)
=>
setPreviewImage
((
prev
)
=>
({
...
prev
,
open
}))
}
onOpenChange=
{
(
open
:
boolean
)
=>
setPreviewImage
((
prev
)
=>
({
...
prev
,
open
}))
}
imgUrls=
{
previewImage
.
urls
}
imgUrls=
{
previewImage
.
urls
}
initialIndex=
{
previewImage
.
index
}
initialIndex=
{
previewImage
.
index
}
mimeType=
{
previewImage
.
mimeType
}
/>
/>
</>
</>
);
);
...
...
web/src/components/PreviewImageDialog.tsx
View file @
15646a89
...
@@ -2,19 +2,16 @@ import { X } from "lucide-react";
...
@@ -2,19 +2,16 @@ import { X } from "lucide-react";
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
Button
}
from
"@/components/ui/button"
;
import
{
Button
}
from
"@/components/ui/button"
;
import
{
Dialog
,
DialogContent
}
from
"@/components/ui/dialog"
;
import
{
Dialog
,
DialogContent
}
from
"@/components/ui/dialog"
;
import
{
getColorspace
}
from
"@/utils/attachment"
;
interface
Props
{
interface
Props
{
open
:
boolean
;
open
:
boolean
;
onOpenChange
:
(
open
:
boolean
)
=>
void
;
onOpenChange
:
(
open
:
boolean
)
=>
void
;
imgUrls
:
string
[];
imgUrls
:
string
[];
initialIndex
?:
number
;
initialIndex
?:
number
;
mimeType
?:
string
;
// MIME type for HDR detection
}
}
function
PreviewImageDialog
({
open
,
onOpenChange
,
imgUrls
,
initialIndex
=
0
,
mimeType
}:
Props
)
{
function
PreviewImageDialog
({
open
,
onOpenChange
,
imgUrls
,
initialIndex
=
0
}:
Props
)
{
const
[
currentIndex
,
setCurrentIndex
]
=
useState
(
initialIndex
);
const
[
currentIndex
,
setCurrentIndex
]
=
useState
(
initialIndex
);
const
colorspace
=
mimeType
?
getColorspace
(
mimeType
)
:
undefined
;
// Update current index when initialIndex prop changes
// Update current index when initialIndex prop changes
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -83,7 +80,6 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls, initialIndex = 0, mim
...
@@ -83,7 +80,6 @@ function PreviewImageDialog({ open, onOpenChange, imgUrls, initialIndex = 0, mim
draggable=
{
false
}
draggable=
{
false
}
loading=
"eager"
loading=
"eager"
decoding=
"async"
decoding=
"async"
{
...
(
colorspace
&&
{
colorSpace
:
colorspace
as
unknown
as
string
})}
/>
/>
</
div
>
</
div
>
...
...
web/src/components/Settings/PreferencesSection.tsx
View file @
15646a89
...
@@ -82,10 +82,7 @@ const PreferencesSection = () => {
...
@@ -82,10 +82,7 @@ const PreferencesSection = () => {
<
SettingGroup
title=
{
t
(
"setting.preference"
)
}
showSeparator
>
<
SettingGroup
title=
{
t
(
"setting.preference"
)
}
showSeparator
>
<
SettingRow
label=
{
t
(
"setting.preference-section.default-memo-visibility"
)
}
>
<
SettingRow
label=
{
t
(
"setting.preference-section.default-memo-visibility"
)
}
>
<
Select
<
Select
value=
{
setting
.
memoVisibility
||
"PRIVATE"
}
onValueChange=
{
handleDefaultMemoVisibilityChanged
}
>
value=
{
setting
.
memoVisibility
||
"PRIVATE"
}
onValueChange=
{
handleDefaultMemoVisibilityChanged
}
>
<
SelectTrigger
className=
"min-w-fit"
>
<
SelectTrigger
className=
"min-w-fit"
>
<
div
className=
"flex items-center gap-2"
>
<
div
className=
"flex items-center gap-2"
>
<
VisibilityIcon
visibility=
{
convertVisibilityFromString
(
setting
.
memoVisibility
)
}
/>
<
VisibilityIcon
visibility=
{
convertVisibilityFromString
(
setting
.
memoVisibility
)
}
/>
...
...
web/src/utils/attachment.ts
View file @
15646a89
...
@@ -52,34 +52,3 @@ export const isMidiFile = (mimeType: string): boolean => {
...
@@ -52,34 +52,3 @@ export const isMidiFile = (mimeType: string): boolean => {
const
isPSD
=
(
t
:
string
)
=>
{
const
isPSD
=
(
t
:
string
)
=>
{
return
t
===
"image/vnd.adobe.photoshop"
||
t
===
"image/x-photoshop"
||
t
===
"image/photoshop"
;
return
t
===
"image/vnd.adobe.photoshop"
||
t
===
"image/x-photoshop"
||
t
===
"image/photoshop"
;
};
};
// HDR-capable MIME types that support wide color gamut
export
const
HDR_CAPABLE_FORMATS
=
[
"image/heic"
,
"image/heif"
,
"image/webp"
,
"image/png"
,
// PNG can contain ICC profiles for wide gamut
"image/jpeg"
,
// JPEG can support extended color via profiles
"video/mp4"
,
// Can contain HDR tracks
"video/quicktime"
,
// Can contain HDR tracks
"video/x-matroska"
,
// Can contain HDR tracks
"video/webm"
,
// VP9 Profile 2 for HDR
];
// isHDRCapable returns true if the MIME type supports HDR/wide color gamut.
export
const
isHDRCapable
=
(
mimeType
:
string
):
boolean
=>
{
return
HDR_CAPABLE_FORMATS
.
some
((
format
)
=>
mimeType
.
startsWith
(
format
));
};
// getColorspace returns the appropriate colorspace attribute for wide gamut images.
// Returns "display-p3" for HDR-capable formats, undefined for standard images.
export
const
getColorspace
=
(
mimeType
:
string
):
string
|
undefined
=>
{
return
isHDRCapable
(
mimeType
)
?
"display-p3"
:
undefined
;
};
// supportsHDR checks if the browser supports wide color gamut display.
// Uses CSS.supports() to detect color-gamut capability.
export
const
supportsHDR
=
():
boolean
=>
{
if
(
typeof
CSS
===
"undefined"
)
return
false
;
return
CSS
.
supports
(
"(color-gamut: srgb)"
)
&&
CSS
.
supports
(
"(color-gamut: p3)"
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment