mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
cleanup unimplemented UI
This commit is contained in:
parent
ca6349069c
commit
221ddbb9ea
1 changed files with 73 additions and 64 deletions
37
aider/gui.py
37
aider/gui.py
|
@ -141,14 +141,12 @@ class GUI:
|
||||||
def do_sidebar(self):
|
def do_sidebar(self):
|
||||||
with st.sidebar:
|
with st.sidebar:
|
||||||
st.title("Aider")
|
st.title("Aider")
|
||||||
self.cmds_tab, self.settings_tab = st.tabs(["Commands", "Settings"])
|
# self.cmds_tab, self.settings_tab = st.tabs(["Commands", "Settings"])
|
||||||
|
|
||||||
def do_cmd_tab(self):
|
def do_cmd_tab(self):
|
||||||
with self.cmds_tab:
|
with st.sidebar:
|
||||||
# self.do_recommended_actions()
|
# self.do_recommended_actions()
|
||||||
self.do_add_to_chat()
|
self.do_add_to_chat()
|
||||||
self.do_tokens_and_cost()
|
|
||||||
self.do_git()
|
|
||||||
self.do_recent_msgs()
|
self.do_recent_msgs()
|
||||||
|
|
||||||
def do_recommended_actions(self):
|
def do_recommended_actions(self):
|
||||||
|
@ -166,6 +164,11 @@ class GUI:
|
||||||
|
|
||||||
def do_add_to_chat(self):
|
def do_add_to_chat(self):
|
||||||
with st.expander("Add to the chat", expanded=True):
|
with st.expander("Add to the chat", expanded=True):
|
||||||
|
self.do_add_files()
|
||||||
|
self.do_add_web_page()
|
||||||
|
self.do_clear_chat_history()
|
||||||
|
|
||||||
|
def do_add_files(self):
|
||||||
fnames = st.multiselect(
|
fnames = st.multiselect(
|
||||||
"Files for the LLM to edit",
|
"Files for the LLM to edit",
|
||||||
sorted(self.coder.get_all_relative_files()),
|
sorted(self.coder.get_all_relative_files()),
|
||||||
|
@ -187,13 +190,16 @@ class GUI:
|
||||||
self.coder.drop_rel_fname(fname)
|
self.coder.drop_rel_fname(fname)
|
||||||
self.info(f"Removed {fname} from the chat")
|
self.info(f"Removed {fname} from the chat")
|
||||||
|
|
||||||
|
def do_add_web_page(self):
|
||||||
with st.popover("Add web page"):
|
with st.popover("Add web page"):
|
||||||
self.do_web()
|
self.do_web()
|
||||||
|
|
||||||
# with st.popover("Add image"):
|
def do_add_image(self):
|
||||||
# st.markdown("Hello World 👋")
|
with st.popover("Add image"):
|
||||||
# st.file_uploader("Image file", disabled=self.prompt_pending())
|
st.markdown("Hello World 👋")
|
||||||
|
st.file_uploader("Image file", disabled=self.prompt_pending())
|
||||||
|
|
||||||
|
def do_run_shell(self):
|
||||||
with st.popover("Run shell commands, tests, etc"):
|
with st.popover("Run shell commands, tests, etc"):
|
||||||
st.markdown(
|
st.markdown(
|
||||||
"Run a shell command and optionally share the output with the LLM. This is"
|
"Run a shell command and optionally share the output with the LLM. This is"
|
||||||
|
@ -204,10 +210,7 @@ class GUI:
|
||||||
"Share the command output with the LLM?",
|
"Share the command output with the LLM?",
|
||||||
[
|
[
|
||||||
"Review the output and decide whether to share",
|
"Review the output and decide whether to share",
|
||||||
(
|
"Automatically share the output on non-zero exit code (ie, if any tests fail)",
|
||||||
"Automatically share the output on non-zero exit code (ie, if any"
|
|
||||||
" tests fail)"
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
st.selectbox(
|
st.selectbox(
|
||||||
|
@ -221,16 +224,22 @@ class GUI:
|
||||||
|
|
||||||
def do_tokens_and_cost(self):
|
def do_tokens_and_cost(self):
|
||||||
with st.expander("Tokens and costs", expanded=True):
|
with st.expander("Tokens and costs", expanded=True):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def do_show_token_usage(self):
|
||||||
with st.popover("Show token usage"):
|
with st.popover("Show token usage"):
|
||||||
st.write("hi")
|
st.write("hi")
|
||||||
|
|
||||||
|
def do_clear_chat_history(self):
|
||||||
if self.button("Clear chat history"):
|
if self.button("Clear chat history"):
|
||||||
self.coder.done_messages = []
|
self.coder.done_messages = []
|
||||||
self.coder.cur_messages = []
|
self.coder.cur_messages = []
|
||||||
self.info("Cleared chat history. Now the LLM can't see anything before this line.")
|
self.info("Cleared chat history. Now the LLM can't see anything before this line.")
|
||||||
|
|
||||||
# st.metric("Cost of last message send & reply", "$0.0019", help="foo")
|
def do_show_metrics(self):
|
||||||
# st.metric("Cost to send next message", "$0.0013", help="foo")
|
st.metric("Cost of last message send & reply", "$0.0019", help="foo")
|
||||||
# st.metric("Total cost this session", "$0.22")
|
st.metric("Cost to send next message", "$0.0013", help="foo")
|
||||||
|
st.metric("Total cost this session", "$0.22")
|
||||||
|
|
||||||
def do_git(self):
|
def do_git(self):
|
||||||
with st.expander("Git", expanded=False):
|
with st.expander("Git", expanded=False):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue