Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Son Of Anton
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
Administrator
Son Of Anton
Commits
acd7d896
Commit
acd7d896
authored
Apr 10, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GoCommitinChat
parent
8bb1768b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
ChatView.jsx
frontend/src/components/ChatView.jsx
+15
-0
MessageBubble.jsx
frontend/src/components/MessageBubble.jsx
+7
-2
No files found.
frontend/src/components/ChatView.jsx
View file @
acd7d896
...
@@ -256,6 +256,19 @@ export default function ChatView({ chatId }) {
...
@@ -256,6 +256,19 @@ export default function ChatView({ chatId }) {
setShowCommitModal
(
true
);
setShowCommitModal
(
true
);
}
}
function
openCommitAllForMessage
(
messageContent
)
{
const
blocks
=
extractCodeBlocks
(
messageContent
);
if
(
!
blocks
.
length
)
return
;
const
map
=
new
Map
();
blocks
.
forEach
((
b
)
=>
map
.
set
(
b
.
file_path
,
b
));
const
deduped
=
Array
.
from
(
map
.
values
());
setCommitFiles
(
deduped
);
setCommitBranch
(
selectedBranch
||
"main"
);
setCommitMessage
(
`Update
${
deduped
.
length
}
file
${
deduped
.
length
>
1
?
"s"
:
""
}
from Son of Anton`
);
setCommitResult
(
null
);
setShowCommitModal
(
true
);
}
async
function
executeCommit
()
{
async
function
executeCommit
()
{
if
(
!
commitFiles
.
length
||
committing
)
return
;
if
(
!
commitFiles
.
length
||
committing
)
return
;
setCommitting
(
true
);
setCommitting
(
true
);
...
@@ -288,6 +301,7 @@ export default function ChatView({ chatId }) {
...
@@ -288,6 +301,7 @@ export default function ChatView({ chatId }) {
<
MessageBubble
<
MessageBubble
key=
{
m
.
id
}
message=
{
m
}
token=
{
state
.
token
}
key=
{
m
.
id
}
message=
{
m
}
token=
{
state
.
token
}
onCommitFile=
{
hasLinkedRepo
?
openCommitSingle
:
undefined
}
onCommitFile=
{
hasLinkedRepo
?
openCommitSingle
:
undefined
}
onCommitAll=
{
hasLinkedRepo
?
openCommitAllForMessage
:
undefined
}
/>
/>
))
}
))
}
{
streaming
&&
(
streamData
.
thinking
||
streamData
.
text
)
&&
(
{
streaming
&&
(
streamData
.
thinking
||
streamData
.
text
)
&&
(
...
@@ -295,6 +309,7 @@ export default function ChatView({ chatId }) {
...
@@ -295,6 +309,7 @@ export default function ChatView({ chatId }) {
message=
{
{
id
:
"streaming"
,
role
:
"assistant"
,
content
:
streamData
.
text
,
thinking_content
:
streamData
.
thinking
||
null
,
attachments
:
[]
}
}
message=
{
{
id
:
"streaming"
,
role
:
"assistant"
,
content
:
streamData
.
text
,
thinking_content
:
streamData
.
thinking
||
null
,
attachments
:
[]
}
}
isStreaming
isThinking=
{
streamData
.
isThinking
}
token=
{
state
.
token
}
isStreaming
isThinking=
{
streamData
.
isThinking
}
token=
{
state
.
token
}
onCommitFile=
{
hasLinkedRepo
?
openCommitSingle
:
undefined
}
onCommitFile=
{
hasLinkedRepo
?
openCommitSingle
:
undefined
}
onCommitAll=
{
hasLinkedRepo
?
openCommitAllForMessage
:
undefined
}
/>
/>
)
}
)
}
{
streaming
&&
!
streamData
.
text
&&
!
streamData
.
thinking
&&
(
{
streaming
&&
!
streamData
.
text
&&
!
streamData
.
thinking
&&
(
...
...
frontend/src/components/MessageBubble.jsx
View file @
acd7d896
...
@@ -5,14 +5,14 @@ import CodeBlock from "./CodeBlock";
...
@@ -5,14 +5,14 @@ import CodeBlock from "./CodeBlock";
import
{
getAttachmentUrl
}
from
"../api"
;
import
{
getAttachmentUrl
}
from
"../api"
;
import
{
import
{
User
,
Flame
,
ChevronDown
,
ChevronRight
,
Brain
,
Copy
,
Check
,
User
,
Flame
,
ChevronDown
,
ChevronRight
,
Brain
,
Copy
,
Check
,
Image
,
Film
,
FileText
,
ExternalLink
,
Image
,
Film
,
FileText
,
ExternalLink
,
GitCommitHorizontal
,
}
from
"lucide-react"
;
}
from
"lucide-react"
;
const
FILE_TYPE_ICONS
=
{
const
FILE_TYPE_ICONS
=
{
image
:
Image
,
video
:
Film
,
document
:
FileText
,
text
:
FileText
,
image
:
Image
,
video
:
Film
,
document
:
FileText
,
text
:
FileText
,
};
};
const
MessageBubble
=
React
.
memo
(
function
MessageBubble
({
message
,
isStreaming
,
isThinking
,
token
,
onCommitFile
})
{
const
MessageBubble
=
React
.
memo
(
function
MessageBubble
({
message
,
isStreaming
,
isThinking
,
token
,
onCommitFile
,
onCommitAll
})
{
const
{
role
,
content
,
thinking_content
,
input_tokens
,
output_tokens
,
attachments
}
=
message
;
const
{
role
,
content
,
thinking_content
,
input_tokens
,
output_tokens
,
attachments
}
=
message
;
const
isUser
=
role
===
"user"
;
const
isUser
=
role
===
"user"
;
const
[
showThinking
,
setShowThinking
]
=
useState
(
false
);
const
[
showThinking
,
setShowThinking
]
=
useState
(
false
);
...
@@ -139,6 +139,11 @@ const MessageBubble = React.memo(function MessageBubble({ message, isStreaming,
...
@@ -139,6 +139,11 @@ const MessageBubble = React.memo(function MessageBubble({ message, isStreaming,
{
copied
?
<
Check
size=
{
11
}
className=
"text-anton-success"
/>
:
<
Copy
size=
{
11
}
/>
}
{
copied
?
<
Check
size=
{
11
}
className=
"text-anton-success"
/>
:
<
Copy
size=
{
11
}
/>
}
{
copied
?
"Copied"
:
"Copy"
}
{
copied
?
"Copied"
:
"Copy"
}
</
button
>
</
button
>
{
onCommitAll
&&
/```
\S
*:
\S
+/
.
test
(
content
)
&&
(
<
button
onClick=
{
()
=>
onCommitAll
(
content
)
}
className=
"flex items-center gap-1 text-[11px] text-green-500/70 hover:text-green-400 transition"
>
<
GitCommitHorizontal
size=
{
11
}
/>
Commit All
</
button
>
)
}
{
(
input_tokens
>
0
||
output_tokens
>
0
)
&&
(
{
(
input_tokens
>
0
||
output_tokens
>
0
)
&&
(
<
span
className=
"text-[11px] text-anton-muted"
>
<
span
className=
"text-[11px] text-anton-muted"
>
{
input_tokens
?.
toLocaleString
()
}
↓ /
{
output_tokens
?.
toLocaleString
()
}
↑ tokens
{
input_tokens
?.
toLocaleString
()
}
↓ /
{
output_tokens
?.
toLocaleString
()
}
↑ tokens
...
...
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