Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore chat interface full height #10314

Merged
merged 7 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shaky-shirts-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Restore chat interface full height
48 changes: 26 additions & 22 deletions gradio/chat_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,19 @@ def __init__(

with Column():
self._render_header()
with Row():
self._render_history_area()
with Column(scale=6):
self._render_chatbot_area(
chatbot, textbox, submit_btn, stop_btn
)
self._render_footer()
self._setup_events()
if self.save_history:
with Row():
self._render_history_area()
with Column(scale=6):
self._render_chatbot_area(
chatbot, textbox, submit_btn, stop_btn
)
self._render_footer()
else:
self._render_chatbot_area(chatbot, textbox, submit_btn, stop_btn)
self._render_footer()

self._setup_events()

def _render_header(self):
if self.title:
Expand All @@ -275,20 +280,19 @@ def _render_header(self):
Markdown(self.description)

def _render_history_area(self):
if self.save_history:
with Column(scale=1, min_width=100):
self.new_chat_button = Button(
"New chat",
variant="primary",
size="md",
icon=utils.get_icon_path("plus.svg"),
)
self.chat_history_dataset = Dataset(
components=[Textbox(visible=False)],
show_label=False,
layout="table",
type="index",
)
with Column(scale=1, min_width=100):
self.new_chat_button = Button(
"New chat",
variant="primary",
size="md",
icon=utils.get_icon_path("plus.svg"),
)
self.chat_history_dataset = Dataset(
components=[Textbox(visible=False)],
show_label=False,
layout="table",
type="index",
)

def _render_chatbot_area(
self,
Expand Down
Loading