Skip to content

fix(webapp): move CSS to launch() for Gradio 6 and disable analytics#1373

Open
natoscott wants to merge 1 commit into
ai-dynamo:mainfrom
natoscott:fix/webapp-gradio6-css
Open

fix(webapp): move CSS to launch() for Gradio 6 and disable analytics#1373
natoscott wants to merge 1 commit into
ai-dynamo:mainfrom
natoscott:fix/webapp-gradio6-css

Conversation

@natoscott

@natoscott natoscott commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Overview:

Fixes Gradio 6.0 deprecation warning and suppresses noisy telemetry requests on webapp startup.

Details:

  • Moved the css parameter from gr.Blocks() constructor to demo.launch(), as required by Gradio 6.0. Eliminates the UserWarning: The parameters have been moved from the Blocks constructor to the launch() method warning on every startup.
  • Disabled Gradio telemetry by default via os.environ.setdefault("GRADIO_ANALYTICS_ENABLED", "False"). AIC is a self-hosted tool and the HuggingFace/Gradio analytics HTTP requests add startup noise without user benefit. Uses setdefault so users can re-enable with GRADIO_ANALYTICS_ENABLED=True if desired.

Where should the reviewer start?

  • src/aiconfigurator/webapp/main.py — single file, ~10 lines changed

Related Issues:

  • None

Summary by CodeRabbit

  • Enhancements
    • Disabled Gradio analytics during application startup.
    • Improved consistency of custom styling across the web app.

Gradio 6.0 moved the css parameter from Blocks() to launch().
Disable Gradio telemetry by default -- AIC is a self-hosted tool and
the HuggingFace/Gradio analytics requests add startup noise without
user benefit. Uses os.environ.setdefault so users can re-enable with
GRADIO_ANALYTICS_ENABLED=True if desired.

Signed-off-by: Nathan Scott <nathans@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@natoscott
natoscott requested review from a team as code owners July 16, 2026 04:24
@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the fix label Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b707aaab-04d4-479c-a149-7366fae4a2a5

📥 Commits

Reviewing files that changed from the base of the PR and between f4c5845 and 64f1d8f.

📒 Files selected for processing (1)
  • src/aiconfigurator/webapp/main.py
📜 Recent review details
⏰ Context from checks skipped due to timeout. (6)
  • GitHub Check: Collect snapshot (new)
  • GitHub Check: Collect snapshot (old)
  • GitHub Check: Rust/Python engine-step parity
  • GitHub Check: Build and Test (e2e)
  • GitHub Check: Cargo Deny
  • GitHub Check: Build and Test (unit)
🧰 Additional context used
📓 Path-based instructions (3)
**/*

📄 CodeRabbit inference engine (.claude/rules/repo-guide.md)

**/*: Treat this file as the only always-injected rule file; do not add new always-on rules here without human approval. New rule files must include paths: frontmatter.
When reviewing changes in a governed area, read that area's rule files first, even if path-based auto-loading does not occur during a read-only review. Rule violations are review findings even when the code works.
A task must remain within its module: collector tasks may change only collector/ and its tests, generator tasks only src/aiconfigurator/generator/ and its tests, and SDK tasks must not modify either. Cross-module contract changes require explicit human approval.

Files:

  • src/aiconfigurator/webapp/main.py

⚙️ CodeRabbit configuration file

**/*: - Prefer applicable inline comments. When the correct fix is clear, small, and limited to the commented diff hunk, include it as a GitHub Suggested Change so the author can apply it with one click.

  • Do not use a suggested change when the fix requires broader design choices, multiple files, generated artifacts, unavailable context, or validation that cannot be inferred from the diff.
  • If a comment is not directly applicable, state the smallest concrete next step and why a one-click suggestion is not safe.

Files:

  • src/aiconfigurator/webapp/main.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (AGENTS.md)

Run ruff check . and ruff format --check . to validate Python linting and formatting.

Files:

  • src/aiconfigurator/webapp/main.py
src/aiconfigurator/webapp/**

⚙️ CodeRabbit configuration file

src/aiconfigurator/webapp/**: - Verify UI changes preserve support-matrix navigation, filtering, and rendering behavior across local static previews and the webapp.

  • Check that webapp flows handle missing Git LFS performance data gracefully when the change touches default-mode or support data loading.

Files:

  • src/aiconfigurator/webapp/main.py
🔇 Additional comments (1)
src/aiconfigurator/webapp/main.py (1)

54-57: LGTM!

Also applies to: 104-131, 196-196


Walkthrough

Changes

Gradio startup and styling

Layer / File(s) Summary
Startup configuration and CSS wiring
src/aiconfigurator/webapp/main.py
Disables Gradio analytics, extracts the stylesheet into _css, and applies it through both gr.Blocks and demo.launch.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

Analytics sleep,
CSS flows through every gate,
Blocks bloom bright and neat.
Launch carries the style,
A tidy startup sails.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: Gradio 6 CSS relocation and analytics disablement.
Description check ✅ Passed The description follows the template and covers overview, details, review focus, and related issues.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@Arsene12358 Arsene12358 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against the pinned gradio 6.8.0 wheel (pyproject pins gradio==6.8.0): Blocks(css=...) pops the kwarg and emits exactly the quoted UserWarning (blocks.py:1094-1103), and launch() falls back to self._deprecated_css (blocks.py:2591), so the move is behavior-preserving — not just warning-silencing. The analytics claim also checks out: analytics.py:46 reads GRADIO_ANALYTICS_ENABLED with default "True" at Blocks construction time, and setdefault before import gradio preserves the user's ability to opt back in.

One nit, non-blocking: import os could sit at module top with the other imports; it only needs to precede import gradio, which is also inside main().

Coordination note: this PR, #1368, and #1369 all touch the same region of webapp/main.py (the css block / launch call). Suggest merging this one first since it defines where CSS lives going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants