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
a2ccf6b2
Unverified
Commit
a2ccf6b2
authored
Nov 08, 2025
by
Johnny
Committed by
GitHub
Nov 08, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(web): improve list auto-completion and tag insertion UX (#5240)
Co-authored-by:
Claude
<
noreply@anthropic.com
>
parent
e8b02734
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
TagSuggestions.tsx
web/src/components/MemoEditor/Editor/TagSuggestions.tsx
+2
-2
useListAutoCompletion.ts
...src/components/MemoEditor/Editor/useListAutoCompletion.ts
+22
-2
No files found.
web/src/components/MemoEditor/Editor/TagSuggestions.tsx
View file @
a2ccf6b2
...
@@ -43,9 +43,9 @@ const TagSuggestions = observer(({ editorRef, editorActions }: TagSuggestionsPro
...
@@ -43,9 +43,9 @@ const TagSuggestions = observer(({ editorRef, editorActions }: TagSuggestionsPro
return
items
.
filter
((
tag
)
=>
tag
.
toLowerCase
().
includes
(
searchQuery
));
return
items
.
filter
((
tag
)
=>
tag
.
toLowerCase
().
includes
(
searchQuery
));
},
},
onAutocomplete
:
(
tag
,
word
,
index
,
actions
)
=>
{
onAutocomplete
:
(
tag
,
word
,
index
,
actions
)
=>
{
// Replace the trigger word with the complete tag
// Replace the trigger word with the complete tag
and add a trailing space
actions
.
removeText
(
index
,
word
.
length
);
actions
.
removeText
(
index
,
word
.
length
);
actions
.
insertText
(
`#
${
tag
}
`
);
actions
.
insertText
(
`#
${
tag
}
`
);
},
},
});
});
...
...
web/src/components/MemoEditor/Editor/useListAutoCompletion.ts
View file @
a2ccf6b2
...
@@ -52,8 +52,28 @@ export function useListAutoCompletion({ editorRef, editorActions, isInIME }: Use
...
@@ -52,8 +52,28 @@ export function useListAutoCompletion({ editorRef, editorActions, isInIME }: Use
if
(
listInfo
.
type
)
{
if
(
listInfo
.
type
)
{
event
.
preventDefault
();
event
.
preventDefault
();
const
continuation
=
generateListContinuation
(
listInfo
);
actions
.
insertText
(
"
\n
"
+
continuation
);
// Check if current list item is empty (GitHub-style behavior)
// Extract the current line
const
lines
=
contentBeforeCursor
.
split
(
"
\n
"
);
const
currentLine
=
lines
[
lines
.
length
-
1
];
// Check if line only contains list marker (no content after it)
const
isEmptyListItem
=
/^
(\s
*
)([
-*+
])\s
*$/
.
test
(
currentLine
)
||
// Empty unordered list
/^
(\s
*
)([
-*+
])\s
+
\[([
xX
])\]\s
*$/
.
test
(
currentLine
)
||
// Empty task list
/^
(\s
*
)(\d
+
)[
.)
]\s
*$/
.
test
(
currentLine
);
// Empty ordered list
if
(
isEmptyListItem
)
{
// Remove the empty list marker and exit list mode
const
lineStartPos
=
cursorPosition
-
currentLine
.
length
;
actions
.
removeText
(
lineStartPos
,
currentLine
.
length
);
actions
.
insertText
(
"
\n
"
);
}
else
{
// Continue the list with the next item
const
continuation
=
generateListContinuation
(
listInfo
);
actions
.
insertText
(
"
\n
"
+
continuation
);
}
}
}
};
};
...
...
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