prettier edit message

This commit is contained in:
Paul Gauthier 2024-04-27 08:13:50 -07:00
parent 701103a9cc
commit 1b6f038590

View file

@ -86,16 +86,17 @@ class GUI:
show_undo = False show_undo = False
res = "" res = ""
if commit_hash: if commit_hash:
prefix = "aider: "
if commit_message.startswith(prefix):
commit_message = commit_message[len(prefix) :]
res += f"Commit `{commit_hash}`: {commit_message} \n" res += f"Commit `{commit_hash}`: {commit_message} \n"
if commit_hash == self.coder.last_aider_commit_hash: if commit_hash == self.coder.last_aider_commit_hash:
show_undo = True show_undo = True
if len(fnames) == 1: if fnames:
res += f"Applied edits to `{fnames[0]}`" fnames = [f"`{fname}`" for fname in fnames]
elif len(fnames) > 1: fnames = ", ".join(fnames)
res += "Applied edits to: \n" res += f"Applied edits to {fnames}."
for fname in fnames:
res += f"- `{fname}` \n"
with st.container(border=True): with st.container(border=True):
st.write(res) st.write(res)