Skip to content

🎨 Palette: Improve Team Lab unit selection UX with max_selections - #65

Open
Gunnarguy wants to merge 1 commit into
mainfrom
palette-team-lab-multiselect-ux-16017722740603441430
Open

Gunnarguy wants to merge 1 commit into
mainfrom
palette-team-lab-multiselect-ux-16017722740603441430

Conversation

@Gunnarguy

@Gunnarguy Gunnarguy commented Jul 14, 2026

Copy link
Copy Markdown
Owner
  • What: Refactored the st.multiselect in the Team Lab section to use max_selections=4 natively. Added a placeholder and updated the help text. Removed manual validation (st.warning) for selecting >4 units. Updated .Jules/palette.md journal.
  • Why: To provide immediate, native feedback and prevent users from making invalid choices interactively, avoiding a frustrating post-selection feedback loop.
  • Accessibility: Improves clarity with an explicit placeholder before interaction.

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

Summary by Sourcery

Enforce native selection limits for Team Lab unit multiselect and update the associated UX journal entry.

New Features:

  • Use Streamlit's native max_selections constraint on the Team Lab unit multiselect with an explicit placeholder and updated help text.

Enhancements:

  • Remove manual post-selection validation and warnings for selecting more than four units in the Team Lab view.

Documentation:

  • Extend the Palette journal with guidance on using Streamlit's max_selections and placeholder text for constrained multiselect inputs.

- **What:** Refactored the `st.multiselect` in the Team Lab section to use `max_selections=4` natively. Added a `placeholder` and updated the `help` text. Removed manual validation (`st.warning`) for selecting >4 units. Updated `.Jules/palette.md` journal.
- **Why:** To provide immediate, native feedback and prevent users from making invalid choices interactively, avoiding a frustrating post-selection feedback loop.
- **Accessibility:** Improves clarity with an explicit placeholder before interaction.

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 14, 2026 07:47
@sourcery-ai

sourcery-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors the Team Lab unit multiselect to use Streamlit’s native max_selections with clearer UX copy, and updates the Jules palette journal accordingly.

Sequence diagram for updated Team Lab multiselect max_selections UX

sequenceDiagram
    actor User
    participant StreamlitApp as TeamLab

    User->>TeamLab: st.multiselect(label, options, max_selections=4, placeholder)
    Note over User,TeamLab: User begins selecting units

    loop up to 4 selections
        User->>TeamLab: select unit
        TeamLab-->>User: update selected_variant_ids
    end

    alt [user attempts 5th selection]
        User->>TeamLab: select 5th unit
        TeamLab-->>User: enforce max_selections=4
    end

    alt [no units selected]
        TeamLab->>User: st.info("Select up to 4 units to inspect SP economy and defensive coverage.")
    else [units selected]
        TeamLab-->>User: proceed to SP economy and defensive coverage analysis
    end
Loading

File-Level Changes

Change Details Files
Use Streamlit’s native multiselect selection limiting and improve UX messaging for Team Lab unit selection.
  • Add max_selections=4 to the Team Lab st.multiselect configuration to enforce the unit cap natively.
  • Add a placeholder to the multiselect to clarify the 4-unit limit before interaction.
  • Update the help text to describe inspecting SP economy and defensive coverage instead of warning about post-hoc truncation.
  • Remove manual validation logic that showed a warning and truncated selections beyond 4 units.
  • Keep the empty-state st.info message aligned with the new help/placeholder language.
src/grandchase_meta_analyzer/explorer_app.py
Document the UX decision to prefer native selection limits over manual validation in the Jules palette journal.
  • Add a learning note about using max_selections on st.multiselect to avoid frustrating feedback loops.
  • Add an action item recommending max_selections combined with clear placeholder text for future multiselect constraints.
.Jules/palette.md

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 reviewed your changes and they look great!


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 Team Lab unit selection UX by using Streamlit’s native st.multiselect(max_selections=4) constraint, adding clearer guidance via placeholder/help, and removing the prior post-selection warning/truncation behavior. It also records the UX rationale in the Palette journal for future consistency.

Changes:

  • Enforce a 4-unit cap in Team Lab via max_selections=4 and remove manual st.warning + slicing logic.
  • Add a placeholder plus updated help text to better guide selection intent.
  • Extend .Jules/palette.md with guidance on preferring native selection constraints.

Reviewed changes

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

File Description
src/grandchase_meta_analyzer/explorer_app.py Refactors Team Lab’s unit multiselect to use Streamlit-native selection limits and improved widget guidance.
.Jules/palette.md Documents the UX guideline to prefer max_selections + placeholder over manual validation for multiselect constraints.

Comment thread .Jules/palette.md
**Action:** Utilize built-in visual aids via Streamlit's native Material Symbols shortcodes (e.g. `icon=":material/search:"` for search, `icon=":material/menu_book:"` for database views). This improves UX and ensures pixel-perfect, cross-browser compatibility across Safari and Chrome without needing custom CSS.

## 2025-07-14 - Native Selection Limits in Streamlit Multiselect
**Learning:** For constraints on multi-selection lists (like choosing exactly 4 units for a team), using Streamlit's native `max_selections` argument on `st.multiselect` is vastly superior to allowing unbounded selection and showing an `st.warning` post-selection. It prevents the user from making invalid choices interactively, avoiding frustrating feedback loops.
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