mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
fix: Improve confirm dialog messages
This commit is contained in:
parent
72ebc7868a
commit
ba746dd211
5 changed files with 14 additions and 20 deletions
|
@ -826,7 +826,7 @@ class Coder:
|
||||||
added_urls = []
|
added_urls = []
|
||||||
for url in urls:
|
for url in urls:
|
||||||
if url not in self.rejected_urls:
|
if url not in self.rejected_urls:
|
||||||
if self.io.confirm_ask(f"Add {url} to the chat?"):
|
if self.io.confirm_ask(f"Add URL to the chat?", subject=url):
|
||||||
inp += "\n\n"
|
inp += "\n\n"
|
||||||
inp += self.commands.cmd_web(url, paginate=False)
|
inp += self.commands.cmd_web(url, paginate=False)
|
||||||
added_urls.append(url)
|
added_urls.append(url)
|
||||||
|
@ -1315,10 +1315,8 @@ class Coder:
|
||||||
if not mentioned_rel_fnames:
|
if not mentioned_rel_fnames:
|
||||||
return
|
return
|
||||||
|
|
||||||
for rel_fname in mentioned_rel_fnames:
|
add_files = "\n".join(mentioned_rel_fnames) + "\n"
|
||||||
self.io.tool_output(rel_fname)
|
if not self.io.confirm_ask("Add these files to the chat?", subject=add_files):
|
||||||
|
|
||||||
if not self.io.confirm_ask("Add these files to the chat?"):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
for rel_fname in mentioned_rel_fnames:
|
for rel_fname in mentioned_rel_fnames:
|
||||||
|
@ -1663,7 +1661,7 @@ class Coder:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if not Path(full_path).exists():
|
if not Path(full_path).exists():
|
||||||
if not self.io.confirm_ask(f"Allow creation of new file {path}?"):
|
if not self.io.confirm_ask(f"Allow creation of new file?", subject=path):
|
||||||
self.io.tool_error(f"Skipping edits to {path}")
|
self.io.tool_error(f"Skipping edits to {path}")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -1682,7 +1680,8 @@ class Coder:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if not self.io.confirm_ask(
|
if not self.io.confirm_ask(
|
||||||
f"Allow edits to {path} which was not previously added to chat?"
|
"Allow edits to file that has not been added to the chat?",
|
||||||
|
subject=path,
|
||||||
):
|
):
|
||||||
self.io.tool_error(f"Skipping edits to {path}")
|
self.io.tool_error(f"Skipping edits to {path}")
|
||||||
return
|
return
|
||||||
|
|
|
@ -46,9 +46,8 @@ class EditBlockCoder(Coder):
|
||||||
if edit[0] is None:
|
if edit[0] is None:
|
||||||
edit = edit[1]
|
edit = edit[1]
|
||||||
# This is a shell command
|
# This is a shell command
|
||||||
self.io.tool_output()
|
if self.io.confirm_ask("Run this shell command?", subject=edit.strip()):
|
||||||
self.io.tool_output(f"{edit.strip()}", bold=True)
|
self.io.tool_output()
|
||||||
if self.io.confirm_ask("Do you want to run this suggested shell command?"):
|
|
||||||
try:
|
try:
|
||||||
# Add the command to input history
|
# Add the command to input history
|
||||||
self.io.add_to_input_history(f"/run {edit.strip()}")
|
self.io.add_to_input_history(f"/run {edit.strip()}")
|
||||||
|
|
|
@ -357,6 +357,7 @@ class InputOutput:
|
||||||
self.num_user_asks += 1
|
self.num_user_asks += 1
|
||||||
|
|
||||||
if subject:
|
if subject:
|
||||||
|
self.tool_output()
|
||||||
self.tool_output(subject, bold=True)
|
self.tool_output(subject, bold=True)
|
||||||
|
|
||||||
if self.yes is True:
|
if self.yes is True:
|
||||||
|
@ -378,6 +379,7 @@ class InputOutput:
|
||||||
self.num_user_asks += 1
|
self.num_user_asks += 1
|
||||||
|
|
||||||
if subject:
|
if subject:
|
||||||
|
self.tool_output()
|
||||||
self.tool_output(subject, bold=True)
|
self.tool_output(subject, bold=True)
|
||||||
|
|
||||||
if self.yes is True:
|
if self.yes is True:
|
||||||
|
|
|
@ -281,10 +281,8 @@ def check_pip_install_extra(io, module, prompt, pip_install_cmd):
|
||||||
|
|
||||||
cmd = get_pip_install(pip_install_cmd)
|
cmd = get_pip_install(pip_install_cmd)
|
||||||
|
|
||||||
text = f"{prompt}:\n\n{' '.join(cmd)}\n"
|
io.tool_error(prompt)
|
||||||
io.tool_error(text)
|
if not io.confirm_ask("Run pip install?", default="y", subject=' '.join(cmd)):
|
||||||
|
|
||||||
if not io.confirm_ask("Run pip install?", default="y"):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
success, output = run_install(cmd)
|
success, output = run_install(cmd)
|
||||||
|
|
|
@ -68,14 +68,10 @@ Newer aider version v{latest_version} is available. To upgrade, run:
|
||||||
|
|
||||||
cmd = utils.get_pip_install(["--upgrade", "aider-chat"])
|
cmd = utils.get_pip_install(["--upgrade", "aider-chat"])
|
||||||
|
|
||||||
text = f"""
|
text = f"Newer aider version v{latest_version} is available. To upgrade, run:"
|
||||||
Newer aider version v{latest_version} is available. To upgrade, run:
|
|
||||||
|
|
||||||
{' '.join(cmd)}
|
|
||||||
"""
|
|
||||||
io.tool_error(text)
|
io.tool_error(text)
|
||||||
|
if io.confirm_ask("Run pip install?", subject=' '.join(cmd)):
|
||||||
if io.confirm_ask("Run pip install?"):
|
|
||||||
success, output = utils.run_install(cmd)
|
success, output = utils.run_install(cmd)
|
||||||
if success:
|
if success:
|
||||||
io.tool_output("Re-run aider to use new version.")
|
io.tool_output("Re-run aider to use new version.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue