-
Notifications
You must be signed in to change notification settings - Fork 728
Redesign the layout #698
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
base: main
Are you sure you want to change the base?
Redesign the layout #698
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||||||||||||||
| space and can be placed inside any existing row or header without | ||||||||||||||||||
| creating extra blank rows. | ||||||||||||||||||
| """ | ||||||||||||||||||
| from pathlib import Path | ||||||||||||||||||
| import gradio as gr | ||||||||||||||||||
| from acestep.ui.gradio.i18n import t | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -181,7 +182,7 @@ def create_help_button(section_key: str) -> gr.HTML: | |||||||||||||||||
| </div> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| """, | ||||||||||||||||||
| elem_classes=["help-inline-container"], | ||||||||||||||||||
| elem_classes=["help-inline-container", "no-grow"], | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| return html | ||||||||||||||||||
|
|
@@ -190,108 +191,5 @@ def create_help_button(section_key: str) -> gr.HTML: | |||||||||||||||||
| # --------------------------------------------------------------------------- | ||||||||||||||||||
| # CSS to be injected into the main Blocks CSS string. | ||||||||||||||||||
| # --------------------------------------------------------------------------- | ||||||||||||||||||
| HELP_MODAL_CSS = """ | ||||||||||||||||||
| /* ---- Inline help button container ---- */ | ||||||||||||||||||
| .help-inline-container { | ||||||||||||||||||
| min-height: 0 !important; | ||||||||||||||||||
| padding: 0 !important; | ||||||||||||||||||
| margin: 0 !important; | ||||||||||||||||||
| display: inline-flex !important; | ||||||||||||||||||
| align-items: center !important; | ||||||||||||||||||
| flex-shrink: 0 !important; | ||||||||||||||||||
| max-width: 32px !important; | ||||||||||||||||||
| min-width: 32px !important; | ||||||||||||||||||
| overflow: visible !important; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| .help-inline-wrapper { | ||||||||||||||||||
| display: inline-flex; | ||||||||||||||||||
| align-items: center; | ||||||||||||||||||
| line-height: 1; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| /* ---- Inline help button ---- */ | ||||||||||||||||||
| .help-inline-btn { | ||||||||||||||||||
| width: 22px; | ||||||||||||||||||
| height: 22px; | ||||||||||||||||||
| border-radius: 50%; | ||||||||||||||||||
| border: 1.5px solid var(--border-color-primary, #555); | ||||||||||||||||||
| background: transparent; | ||||||||||||||||||
| color: var(--body-text-color-subdued, #888); | ||||||||||||||||||
| font-size: 12px; | ||||||||||||||||||
| font-weight: 600; | ||||||||||||||||||
| line-height: 20px; | ||||||||||||||||||
| text-align: center; | ||||||||||||||||||
| cursor: pointer; | ||||||||||||||||||
| padding: 0; | ||||||||||||||||||
| transition: all 0.15s ease; | ||||||||||||||||||
| flex-shrink: 0; | ||||||||||||||||||
| } | ||||||||||||||||||
| .help-inline-btn:hover { | ||||||||||||||||||
| background: var(--color-accent, #4a9eff); | ||||||||||||||||||
| color: #fff; | ||||||||||||||||||
| border-color: var(--color-accent, #4a9eff); | ||||||||||||||||||
| transform: scale(1.1); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| /* ---- Modal overlay ---- */ | ||||||||||||||||||
| .help-modal-overlay { | ||||||||||||||||||
| position: fixed; | ||||||||||||||||||
| top: 0; left: 0; right: 0; bottom: 0; | ||||||||||||||||||
| background: rgba(0,0,0,0.5); | ||||||||||||||||||
| z-index: 100000; | ||||||||||||||||||
| display: flex; | ||||||||||||||||||
| justify-content: center; | ||||||||||||||||||
| align-items: center; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| .help-modal-content { | ||||||||||||||||||
| background: var(--background-fill-primary, #fff); | ||||||||||||||||||
| color: var(--body-text-color, #222); | ||||||||||||||||||
| border-radius: 12px; | ||||||||||||||||||
| max-width: 640px; | ||||||||||||||||||
| width: 90%; | ||||||||||||||||||
| max-height: 80vh; | ||||||||||||||||||
| display: flex; | ||||||||||||||||||
| flex-direction: column; | ||||||||||||||||||
| box-shadow: 0 20px 60px rgba(0,0,0,0.3); | ||||||||||||||||||
| position: relative; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| .help-modal-close { | ||||||||||||||||||
| position: absolute; | ||||||||||||||||||
| top: 12px; right: 16px; | ||||||||||||||||||
| background: none; | ||||||||||||||||||
| border: none; | ||||||||||||||||||
| font-size: 20px; | ||||||||||||||||||
| cursor: pointer; | ||||||||||||||||||
| color: var(--body-text-color, #222); | ||||||||||||||||||
| z-index: 1; | ||||||||||||||||||
| opacity: 0.6; | ||||||||||||||||||
| } | ||||||||||||||||||
| .help-modal-close:hover { opacity: 1; } | ||||||||||||||||||
|
|
||||||||||||||||||
| .help-modal-body { | ||||||||||||||||||
| padding: 28px 32px; | ||||||||||||||||||
| overflow-y: auto; | ||||||||||||||||||
| line-height: 1.7; | ||||||||||||||||||
| font-size: 0.92rem; | ||||||||||||||||||
| } | ||||||||||||||||||
| .help-modal-body h3 { margin: 16px 0 8px; font-size: 1.15rem; } | ||||||||||||||||||
| .help-modal-body h4 { margin: 12px 0 6px; font-size: 1.0rem; } | ||||||||||||||||||
| .help-modal-body pre { | ||||||||||||||||||
| background: var(--background-fill-secondary, #f5f5f5); | ||||||||||||||||||
| padding: 10px; | ||||||||||||||||||
| border-radius: 6px; | ||||||||||||||||||
| overflow-x: auto; | ||||||||||||||||||
| font-size: 0.85rem; | ||||||||||||||||||
| } | ||||||||||||||||||
| .help-modal-body code { | ||||||||||||||||||
| background: var(--background-fill-secondary, #f5f5f5); | ||||||||||||||||||
| padding: 1px 4px; | ||||||||||||||||||
| border-radius: 3px; | ||||||||||||||||||
| font-size: 0.88em; | ||||||||||||||||||
| } | ||||||||||||||||||
| .help-modal-body ul { margin: 6px 0; } | ||||||||||||||||||
| .help-modal-body li { margin: 3px 0; } | ||||||||||||||||||
| """ | ||||||||||||||||||
| css_file = Path(__file__).parent / "interfaces" / "css" / "help_modal.css" | ||||||||||||||||||
| HELP_MODAL_CSS = css_file.read_text() | ||||||||||||||||||
|
Comment on lines
+194
to
+195
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unhandled
Also missing an explicit 🛡️ Proposed fix-css_file = Path(__file__).parent / "interfaces" / "css" / "help_modal.css"
-HELP_MODAL_CSS = css_file.read_text()
+_css_file = Path(__file__).parent / "interfaces" / "css" / "help_modal.css"
+try:
+ HELP_MODAL_CSS = _css_file.read_text(encoding="utf-8")
+except FileNotFoundError:
+ logger.warning(f"help_modal.css not found at {_css_file}; help modal will be unstyled.")
+ HELP_MODAL_CSS = ""As per coding guidelines: "Handle errors explicitly in Python; avoid bare 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 79
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 1957
🏁 Script executed:
rg -n "gr\.(Column|Row|Accordion|Tab|Tabs|Blocks|Group)\(" --type py acestep/ui/gradio/events/ -A 2 -B 2Repository: ace-step/ACE-Step-1.5
Length of output: 2088
🏁 Script executed:
sed -n '100,155p' acestep/ui/gradio/events/generation/mode_ui.pyRepository: ace-step/ACE-Step-1.5
Length of output: 2905
🏁 Script executed:
sed -n '1,50p' acestep/ui/gradio/events/generation/mode_ui.pyRepository: ace-step/ACE-Step-1.5
Length of output: 1921
🏁 Script executed:
rg -n "def.*mode_ui|def.*on_generation_mode" acestep/ui/gradio/events/generation/mode_ui.py -A 30Repository: ace-step/ACE-Step-1.5
Length of output: 1374
🏁 Script executed:
rg -n "compute_mode_ui_updates" acestep/ui/gradio/ -B 2 -A 2Repository: ace-step/ACE-Step-1.5
Length of output: 12542
🏁 Script executed:
rg -n "handle_generation_mode_change\|on_generation_mode" acestep/ui/gradio/ -B 5 -A 15 --type pyRepository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 4405
🏁 Script executed:
sed -n '200,260p' acestep/ui/gradio/events/__init__.pyRepository: ace-step/ACE-Step-1.5
Length of output: 2830
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 4200
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 2516
🏁 Script executed:
rg -n "optional_params_section" acestep/ui/gradio/ -B 2 -A 2Repository: ace-step/ACE-Step-1.5
Length of output: 2626
🏁 Script executed:
sed -n '155,170p' acestep/ui/gradio/events/generation/ui_helpers.pyRepository: ace-step/ACE-Step-1.5
Length of output: 685
🏁 Script executed:
sed -n '100,120p' acestep/ui/gradio/events/generation/service_init.pyRepository: ace-step/ACE-Step-1.5
Length of output: 778
🏁 Script executed:
sed -n '25,45p' acestep/ui/gradio/events/results/audio_transfer.pyRepository: ace-step/ACE-Step-1.5
Length of output: 726
🏁 Script executed:
rg -n "update_audio_uploads_accordion" acestep/ui/gradio/ -B 3 -A 3Repository: ace-step/ACE-Step-1.5
Length of output: 1936
🏁 Script executed:
sed -n '100,130p' acestep/ui/gradio/events/generation/service_init.pyRepository: ace-step/ACE-Step-1.5
Length of output: 1358
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
rg -n "update_audio_uploads_accordion\(" acestep/ui/gradio/events/__init__.py -B 2 -A 8Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
sed -n '75,130p' acestep/ui/gradio/events/generation/service_init.pyRepository: ace-step/ACE-Step-1.5
Length of output: 2532
🏁 Script executed:
rg -n "send_audio_to_remix\|send_audio_to_repaint" acestep/ui/gradio/events/results/audio_transfer.py -B 3 -A 20Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
rg -n "reference_audio.*src_audio" acestep/ui/gradio/events/__init__.py -B 5 -A 10Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
rg -n "audio_uploads_accordion" acestep/ui/gradio/events/ -B 3 -A 3Repository: ace-step/ACE-Step-1.5
Length of output: 2493
🏁 Script executed:
sed -n '130,180p' acestep/ui/gradio/events/generation/service_init.pyRepository: ace-step/ACE-Step-1.5
Length of output: 2086
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 296
🏁 Script executed:
sed -n '150,200p' acestep/ui/gradio/events/__init__.pyRepository: ace-step/ACE-Step-1.5
Length of output: 2006
🏁 Script executed:
sed -n '265,280p' acestep/ui/gradio/events/__init__.pyRepository: ace-step/ACE-Step-1.5
Length of output: 758
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 96
🏁 Script executed:
sed -n '140,195p' acestep/ui/gradio/events/generation/mode_ui.pyRepository: ace-step/ACE-Step-1.5
Length of output: 3966
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 2860
🏁 Script executed:
rg -n "def send_audio_to_file" acestep/ui/gradio/events/results/audio_transfer.py -B 5 -A 30Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
sed -n '125,170p' acestep/ui/gradio/events/generation/service_init.pyRepository: ace-step/ACE-Step-1.5
Length of output: 2070
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
grep -n "accordion_state" acestep/ui/gradio/events/generation/service_init.pyRepository: ace-step/ACE-Step-1.5
Length of output: 163
🏁 Script executed:
sed -n '50,100p' acestep/ui/gradio/events/__init__.pyRepository: ace-step/ACE-Step-1.5
Length of output: 2616
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
rg -n "send_audio_to\|send_to_remix" acestep/ui/gradio/events/__init__.py -B 3 -A 15Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
Repository: ace-step/ACE-Step-1.5
Length of output: 1478
🏁 Script executed:
sed -n '20,50p' acestep/ui/gradio/events/results/audio_transfer.pyRepository: ace-step/ACE-Step-1.5
Length of output: 1033
🏁 Script executed:
rg -n "def _send_audio_to_file" acestep/ui/gradio/events/results/audio_transfer.py -A 40Repository: ace-step/ACE-Step-1.5
Length of output: 47
🏁 Script executed:
rg -n "\.then\(|send_audio_to_file" acestep/ui/gradio/events/__init__.py -B 3 -A 15Repository: ace-step/ACE-Step-1.5
Length of output: 15726
gr.Column(...)must begr.update(...)— component instantiation in an event-handler output causes a runtime error.Line 148 returns a new
gr.Columninstance as an event output, which violates Gradio semantics. Event handlers expectgr.update()objects for property updates, not component instances. Every other element in this 44-item tuple correctly usesgr.update().The same bug also exists in
acestep/ui/gradio/events/generation/service_init.py:114wheregr.Accordion(open=not is_model_initialized)is returned as an event output ininit_service_wrapper()instead ofgr.update(open=...).🐛 Proposed fix
Also fix
service_init.py:114:📝 Committable suggestion
🤖 Prompt for AI Agents