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
16576be1
Commit
16576be1
authored
Mar 01, 2026
by
Johnny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: polish MemoDetailSidebar for consistent structure and styles
parent
9628d3de
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
94 deletions
+96
-94
MemoDetailSidebar.tsx
web/src/components/MemoDetailSidebar/MemoDetailSidebar.tsx
+63
-59
MemoDetailSidebarDrawer.tsx
.../components/MemoDetailSidebar/MemoDetailSidebarDrawer.tsx
+1
-1
MemoDetail.tsx
web/src/pages/MemoDetail.tsx
+32
-34
No files found.
web/src/components/MemoDetailSidebar/MemoDetailSidebar.tsx
View file @
16576be1
...
...
@@ -13,6 +13,10 @@ interface Props {
parentPage
?:
string
;
}
const
SectionLabel
=
({
children
}:
{
children
:
React
.
ReactNode
})
=>
(
<
p
className=
"text-xs font-medium text-muted-foreground/50 uppercase tracking-wider"
>
{
children
}
</
p
>
);
const
MemoDetailSidebar
=
({
memo
,
className
,
parentPage
}:
Props
)
=>
{
const
t
=
useTranslate
();
const
property
=
create
(
Memo_PropertySchema
,
memo
.
property
||
{});
...
...
@@ -20,51 +24,52 @@ const MemoDetailSidebar = ({ memo, className, parentPage }: Props) => {
const
hasReferenceRelations
=
memo
.
relations
.
some
((
r
)
=>
r
.
type
===
MemoRelation_Type
.
REFERENCE
);
return
(
<
aside
className=
{
cn
(
"relative w-full h-auto max-h-screen overflow-auto flex flex-col justify-start items-start"
,
className
)
}
>
<
div
className=
"flex flex-col justify-start items-start w-full gap-4 h-auto shrink-0 flex-nowrap"
>
<
aside
className=
{
cn
(
"relative w-full h-auto max-h-screen overflow-auto flex flex-col gap-5"
,
className
)
}
>
{
hasReferenceRelations
&&
(
<
div
className=
"w-full space-y-2"
>
<
div
className=
"flex items-center gap-1.5"
>
<
SectionLabel
>
{
t
(
"common.relations"
)
}
</
SectionLabel
>
<
span
className=
"text-xs text-muted-foreground/30"
>
(Beta)
</
span
>
</
div
>
<
div
className=
"relative w-full h-36 border border-border rounded-lg bg-muted overflow-hidden"
>
<
MemoRelationForceGraph
className=
"w-full h-full"
memo=
{
memo
}
parentPage=
{
parentPage
}
/>
<
div
className=
"absolute top-2 left-2 text-xs text-muted-foreground/60 font-medium gap-1 flex flex-row items-center"
>
<
span
>
{
t
(
"common.relations"
)
}
</
span
>
<
span
className=
"text-xs opacity-60"
>
(Beta)
</
span
>
</
div
>
</
div
>
)
}
<
div
className=
"w-full space-y-1"
>
<
p
className=
"text-xs font-medium text-muted-foreground/60 uppercase tracking-wide px-1"
>
{
t
(
"common.created-at"
)
}
</
p
>
<
p
className=
"text-sm text-muted-foreground px-1"
>
{
memo
.
createTime
?
timestampDate
(
memo
.
createTime
).
toLocaleString
()
:
"-
"
}
</
p
>
<
SectionLabel
>
{
t
(
"common.created-at"
)
}
</
SectionLabel
>
<
p
className=
"text-sm text-foreground/70"
>
{
memo
.
createTime
?
timestampDate
(
memo
.
createTime
).
toLocaleString
()
:
"—
"
}
</
p
>
</
div
>
{
!
isEqual
(
memo
.
createTime
,
memo
.
updateTime
)
&&
(
<
div
className=
"w-full space-y-1"
>
<
p
className=
"text-xs font-medium text-muted-foreground/60 uppercase tracking-wide px-1"
>
{
t
(
"common.last-updated-at"
)
}
</
p
>
<
p
className=
"text-sm text-muted-foreground px-1"
>
{
memo
.
updateTime
?
timestampDate
(
memo
.
updateTime
).
toLocaleString
()
:
"-
"
}
</
p
>
<
SectionLabel
>
{
t
(
"common.last-updated-at"
)
}
</
SectionLabel
>
<
p
className=
"text-sm text-foreground/70"
>
{
memo
.
updateTime
?
timestampDate
(
memo
.
updateTime
).
toLocaleString
()
:
"—
"
}
</
p
>
</
div
>
)
}
{
hasSpecialProperty
&&
(
<
div
className=
"w-full space-y-2"
>
<
p
className=
"text-xs font-medium text-muted-foreground/60 uppercase tracking-wide px-1"
>
{
t
(
"common.properties"
)
}
</
p
>
<
div
className=
"w-full flex flex-row justify-start items-center gap-2 flex-wrap px-1
"
>
<
SectionLabel
>
{
t
(
"common.properties"
)
}
</
SectionLabel
>
<
div
className=
"flex flex-wrap gap-1.5
"
>
{
property
.
hasLink
&&
(
<
div
className=
"inline-flex items-center gap-1.5 px-2 py-1 bg-muted/50 border border-border/50 rounded-md
text-xs text-muted-foreground"
>
<
span
className=
"inline-flex items-center gap-1.5 px-2 py-1 rounded-md border border-border/60 bg-muted/60
text-xs text-muted-foreground"
>
<
LinkIcon
className=
"w-3.5 h-3.5"
/>
<
span
>
{
t
(
"memo.links"
)
}
</
span
>
</
div
>
{
t
(
"memo.links"
)
}
</
span
>
)
}
{
property
.
hasTaskList
&&
(
<
div
className=
"inline-flex items-center gap-1.5 px-2 py-1 bg-muted/50 border border-border/50 rounded-md
text-xs text-muted-foreground"
>
<
span
className=
"inline-flex items-center gap-1.5 px-2 py-1 rounded-md border border-border/60 bg-muted/60
text-xs text-muted-foreground"
>
<
CheckCircleIcon
className=
"w-3.5 h-3.5"
/>
<
span
>
{
t
(
"memo.to-do"
)
}
</
span
>
</
div
>
{
t
(
"memo.to-do"
)
}
</
span
>
)
}
{
property
.
hasCode
&&
(
<
div
className=
"inline-flex items-center gap-1.5 px-2 py-1 bg-muted/50 border border-border/50 rounded-md
text-xs text-muted-foreground"
>
<
span
className=
"inline-flex items-center gap-1.5 px-2 py-1 rounded-md border border-border/60 bg-muted/60
text-xs text-muted-foreground"
>
<
Code2Icon
className=
"w-3.5 h-3.5"
/>
<
span
>
{
t
(
"memo.code"
)
}
</
span
>
</
div
>
{
t
(
"memo.code"
)
}
</
span
>
)
}
</
div
>
</
div
>
...
...
@@ -72,24 +77,23 @@ const MemoDetailSidebar = ({ memo, className, parentPage }: Props) => {
{
memo
.
tags
.
length
>
0
&&
(
<
div
className=
"w-full space-y-2"
>
<
div
className=
"flex flex-row justify-start items-center gap-1.5 px-1
"
>
<
p
className=
"text-xs font-medium text-muted-foreground/60 uppercase tracking-wide"
>
{
t
(
"common.tags"
)
}
</
p
>
<
span
className=
"text-xs text-muted-foreground/4
0"
>
(
{
memo
.
tags
.
length
}
)
</
span
>
<
div
className=
"flex items-center gap-1.5
"
>
<
SectionLabel
>
{
t
(
"common.tags"
)
}
</
SectionLabel
>
<
span
className=
"text-xs text-muted-foreground/3
0"
>
(
{
memo
.
tags
.
length
}
)
</
span
>
</
div
>
<
div
className=
"w-full flex flex-row justify-start items-center flex-wrap gap-1.5 px-1
"
>
<
div
className=
"flex flex-wrap gap-1.5
"
>
{
memo
.
tags
.
map
((
tag
)
=>
(
<
div
<
span
key=
{
tag
}
className=
"inline-flex items-center gap-1 px-2 py-0.5 bg-muted/50 border border-border/50 rounded-md text-xs text-muted-foreground hover:bg-muted transition-colors cursor-pointer group
"
className=
"inline-flex items-center gap-1 px-1 rounded-md border border-border/60 bg-muted/60 text-sm text-muted-foreground hover:bg-muted hover:text-foreground/80 transition-colors cursor-pointer
"
>
<
HashIcon
className=
"w-3 h-3 opacity-40 group-hover:opacity-60 transition-opacity
"
/>
<
span
className=
"opacity-80 group-hover:opacity-100 transition-opacity"
>
{
tag
}
</
span
>
</
div
>
<
HashIcon
className=
"w-3 h-3 opacity-50
"
/>
{
tag
}
</
span
>
))
}
</
div
>
</
div
>
)
}
</
div
>
</
aside
>
);
};
...
...
web/src/components/MemoDetailSidebar/MemoDetailSidebarDrawer.tsx
View file @
16576be1
...
...
@@ -22,7 +22,7 @@ const MemoDetailSidebarDrawer = ({ memo, parentPage }: Props) => {
return
(
<
Sheet
open=
{
open
}
onOpenChange=
{
setOpen
}
>
<
SheetTrigger
asChild
>
<
Button
variant=
"ghost"
className=
"bg-transparent!
px-2"
>
<
Button
variant=
"ghost"
size=
"sm"
className=
"
px-2"
>
<
GanttChartIcon
className=
"w-5 h-auto text-muted-foreground"
/>
</
Button
>
</
SheetTrigger
>
...
...
web/src/pages/MemoDetail.tsx
View file @
16576be1
...
...
@@ -99,18 +99,6 @@ const MemoDetail = () => {
{
t
(
"memo.comment.self"
)
}
</
h2
>
<
div
className=
"relative mx-auto grow w-full min-h-full flex flex-col justify-start items-start gap-y-1"
>
{
showCommentEditor
&&
(
<
div
className=
"w-full mb-2"
>
<
MemoEditor
cacheKey=
{
`${memo.name}-${memo.updateTime}-comment`
}
placeholder=
{
t
(
"editor.add-your-comment-here"
)
}
parentMemoName=
{
memo
.
name
}
autoFocus
onConfirm=
{
handleCommentCreated
}
onCancel=
{
()
=>
setShowCommentEditor
(
false
)
}
/>
</
div
>
)
}
{
comments
.
length
===
0
?
(
showCreateCommentButton
&&
(
<
div
className=
"w-full flex flex-row justify-center items-center py-6"
>
...
...
@@ -121,7 +109,6 @@ const MemoDetail = () => {
</
div
>
)
)
:
(
<>
<
div
className=
"w-full flex flex-row justify-between items-center h-8 pl-3 mb-2"
>
<
div
className=
"flex flex-row justify-start items-center"
>
<
MessageCircleIcon
className=
"w-5 h-auto text-muted-foreground mr-1"
/>
...
...
@@ -134,6 +121,19 @@ const MemoDetail = () => {
</
Button
>
)
}
</
div
>
)
}
{
showCommentEditor
&&
(
<
div
className=
"w-full mb-2"
>
<
MemoEditor
cacheKey=
{
`${memo.name}-${memo.updateTime}-comment`
}
placeholder=
{
t
(
"editor.add-your-comment-here"
)
}
parentMemoName=
{
memo
.
name
}
autoFocus
onConfirm=
{
handleCommentCreated
}
onCancel=
{
()
=>
setShowCommentEditor
(
false
)
}
/>
</
div
>
)
}
{
comments
.
map
((
comment
)
=>
(
<
MemoView
key=
{
`${comment.name}-${comment.displayTime}`
}
...
...
@@ -143,8 +143,6 @@ const MemoDetail = () => {
compact
/>
))
}
</>
)
}
</
div
>
</
div
>
</
div
>
...
...
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