Skip to content

🎨 Palette: [UX improvement] Add selectbox placeholders to defer detailed UI rendering - #78

Open
Gunnarguy wants to merge 1 commit into
mainfrom
palette/selectbox-placeholders-11297757717167151722
Open

Gunnarguy wants to merge 1 commit into
mainfrom
palette/selectbox-placeholders-11297757717167151722

Conversation

@Gunnarguy

@Gunnarguy Gunnarguy commented Jul 27, 2026

Copy link
Copy Markdown
Owner

💡 What: Added index=None and placeholder text to st.selectbox components in the "Unit Roster", "Builds", and "Content Teams" tabs of the Meta Database. Wrapped the detail rendering logic in if selection: blocks to defer rendering.
🎯 Why: Previously, the first item in the list was automatically selected on page load, causing immediate rendering of the detail panels. This created initial UI clutter. Users prefer an empty state that prompts them to make a selection first.
♿ Accessibility: Improves cognitive load by preventing overwhelming amounts of information from rendering immediately before the user has made an explicit choice.


PR created automatically by Jules for task 11297757717167151722 started by @Gunnarguy

Summary by Sourcery

Defer detailed meta database panel rendering until a user explicitly selects an item in key Streamlit selectboxes.

New Features:

  • Add unselected default state with placeholder text to selectboxes in Unit Roster, Builds, and Content Teams tabs to prompt explicit user choice before showing details.

Enhancements:

  • Gate unit, build, and content team detail rendering behind selection checks to reduce initial UI clutter and cognitive load.
  • Update Palette documentation with guidance on using selectbox placeholders and conditional rendering to defer UI detail panels.

…led UI rendering

💡 What: Added `index=None` and `placeholder` text to `st.selectbox` components in the "Unit Roster", "Builds", and "Content Teams" tabs of the Meta Database. Wrapped the detail rendering logic in `if selection:` blocks to defer rendering.
🎯 Why: Previously, the first item in the list was automatically selected on page load, causing immediate rendering of the detail panels. This created initial UI clutter. Users prefer an empty state that prompts them to make a selection first.
♿ Accessibility: Improves cognitive load by preventing overwhelming amounts of information from rendering immediately before the user has made an explicit choice.

Co-authored-by: Gunnarguy <110250624+Gunnarguy@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings July 27, 2026 07:51
@sourcery-ai

sourcery-ai Bot commented Jul 27, 2026

Copy link
Copy Markdown

🧙 Sourcery has finished reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new index=None + if selection: pattern is now duplicated across multiple tabs; consider extracting a small helper (e.g., select_with_placeholder(label, options, key, placeholder)) to keep this UX behavior consistent and easier to maintain.
  • When no selection is made, the panels now render nothing; consider rendering a lightweight empty-state message (e.g., st.caption(...)) so users get an explicit prompt rather than a visually blank area.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `index=None` + `if selection:` pattern is now duplicated across multiple tabs; consider extracting a small helper (e.g., `select_with_placeholder(label, options, key, placeholder)`) to keep this UX behavior consistent and easier to maintain.
- When no selection is made, the panels now render nothing; consider rendering a lightweight empty-state message (e.g., `st.caption(...)`) so users get an explicit prompt rather than a visually blank area.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the Streamlit “Meta Database — Community Spreadsheet” UX by preventing automatic selection in key st.selectbox controls, so detailed panels don’t render until the user explicitly chooses an item—reducing initial clutter and cognitive load.

Changes:

  • Added index=None + placeholder=... to selectboxes in the Unit Roster, Builds, and Content Teams tabs.
  • Wrapped detail rendering in conditional blocks so the UI stays in an “unselected” empty state until a selection is made.
  • Updated the Palette documentation with guidance on using selectbox placeholders + deferred rendering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/grandchase_meta_analyzer/explorer_app.py Adds selectbox placeholders and gates detail rendering in three Meta Database tabs.
.Jules/palette.md Documents the selectbox placeholder + deferred rendering pattern (currently overwrites prior Palette entries).
Comments suppressed due to low confidence (2)

src/grandchase_meta_analyzer/explorer_app.py:3711

  • Same as above: if build_hero: gates on truthiness, which also excludes valid falsey option values (e.g., empty string). Since the placeholder state from index=None is None, check explicitly for is not None.
                index=None,
                placeholder="Select a hero to view builds...",
            )
            if build_hero:
                hero_builds = builds_df[builds_df["name"] == build_hero]
                for _, brow in hero_builds.iterrows():

src/grandchase_meta_analyzer/explorer_app.py:3781

  • Same truthiness issue for the content teams panel: using if content_pick: will skip rendering for any valid falsey option (e.g., empty string). With index=None, the unselected state is None, so gate on is not None instead.
            content_pick = st.selectbox(
                "Content",
                contents,
                key="ct_content",
                index=None,
                placeholder="Select content to view teams...",
            )
            if content_pick:
                ct_data = teams_df[teams_df["content"] == content_pick]

st.write(f"Main: {tc1} → T3: {tt1}, T6: {tt2}")
else:
st.write("—")
if pick:
Comment thread .Jules/palette.md
Comment on lines +1 to +3
## 2026-07-27 - Deferring detailed UI rendering with selectbox placeholders
**Learning:** When using `st.selectbox` in Streamlit to select an item for detailed inspection, the default behavior automatically selects the first item (`index=0`), immediately rendering the detail panel on page load. This causes initial UI clutter. Users prefer an empty state that prompts them to make a selection first.
**Action:** Set `index=None` and provide a `placeholder` string in the `st.selectbox`. Wrap the detail rendering block in an `if selection:` conditional to defer rendering until the user explicitly chooses an item.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants