Skip to content

Add version footer to MainMenu#14028

Merged
mayagbarnes merged 11 commits intofeature/new-app-menufrom
menu-footer
Feb 20, 2026
Merged

Add version footer to MainMenu#14028
mayagbarnes merged 11 commits intofeature/new-app-menufrom
menu-footer

Conversation

@mayagbarnes
Copy link
Copy Markdown
Collaborator

@mayagbarnes mayagbarnes commented Feb 19, 2026

Describe your changes

  • Adds a "Made with Streamlit v{version}" footer inside the main menu, with a hover-to-reveal copy button that copies the full version string to the clipboard.
  • Merges the About menu item into the standard items section (removing its separate divider).
  • Adds the missing ESC keyboard shortcut hint on the Record screen item during active recording (parity with develop).
  • Nightly .dev versions are truncated for display (e.g., v1.54.1.dev) but the full version (e.g., 1.54.1.dev20260217) is copied.
Screenshot 2026-02-19 at 2 23 54 p m Screenshot 2026-02-19 at 2 23 48 p m

Testing Plan

  • JS Unit Tests: ✅ Added
  • E2E Tests: ✅ Added
  • Manual Testing: ✅

@mayagbarnes mayagbarnes added security-assessment-completed change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Feb 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 19, 2026

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-14028/streamlit-1.54.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-14028.streamlit.app (☁️ Deploy here if not accessible)

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Feb 19, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds a version footer to the MainMenu displaying "Made with Streamlit v{version}" with a hover-to-reveal copy button, merges the About menu item into the standard items section (removing its separate divider), and adds the ESC keyboard shortcut hint to the Record screen item during active recording. The version footer truncates nightly .dev versions for display (e.g., v1.54.1.dev) but copies the full version string (e.g., 1.54.1.dev20260217) to the clipboard.

Changes:

  • Adds a new version footer component to MainMenu with truncated display and full version copy functionality
  • Restructures menu sections by merging the About item into the standard items section alongside Print and Record screen
  • Adds missing ESC shortcut display for Record screen item during COUNTDOWN and RECORDING states

Reviewed changes

Copilot reviewed 5 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/app/src/components/MainMenu/MainMenu.tsx Adds formatDisplayVersion utility, integrates version footer rendering, updates menu structure to merge About item, adds ESC shortcut to screencast items
frontend/app/src/components/MainMenu/styled-components.ts Defines three new styled components for version footer: container, row (with hover-to-reveal styles), and muted text
frontend/app/src/components/MainMenu/MainMenu.test.tsx Adds comprehensive unit tests for version footer rendering, display truncation, clipboard copy, and ESC shortcut display
frontend/app/src/App.tsx Passes streamlitVersion from SessionInfo to MainMenu component
e2e_playwright/main_menu_test.py Adds E2E tests for version footer visibility and clipboard copy, updates snapshot test to replace dynamic version with placeholder
e2e_playwright/__snapshots__/ Updated screenshot snapshots for all themes and browsers showing the new version footer

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 20, 2026

📈 Frontend coverage change detected

The frontend unit test (vitest) coverage has increased by 0.1300%

  • Current PR: 87.5300% (14285 lines, 1781 missed)
  • Latest develop: 87.4000% (14190 lines, 1787 missed)

🎉 Great job on improving test coverage!

📊 View detailed coverage comparison

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 16 changed files in this pull request and generated no new comments.

@mayagbarnes mayagbarnes added the ai-review If applied to PR or issue will run AI review workflow label Feb 20, 2026
@github-actions github-actions bot removed the ai-review If applied to PR or issue will run AI review workflow label Feb 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Summary

This PR adds a "Made with Streamlit v{version}" footer to the MainMenu with a hover-to-reveal copy button, merges the About menu item into the standard items section (removing its separate divider), and adds the missing ESC keyboard shortcut hint on the Record screen item during active recording. The openMenu test helper is improved to auto-detect fake vs. real timers. Updated snapshot images and new unit/E2E tests accompany the changes.

Code Quality

The code is well-structured and follows the established patterns in the codebase:

  • formatDisplayVersion is cleanly implemented as an exported pure function with a JSDoc comment and thorough unit tests.
  • The styled components use theme tokens consistently (no pixel values), the hover/focus-within reveal pattern is well done, and the naming convention (StyledMenuVersion*, stMenuVersionCopyButton) follows project conventions.
  • CopyButton usage is correct: it passes the full version string (text={streamlitVersion}) for clipboard copy while displaying the truncated version (formatDisplayVersion(streamlitVersion)) in the UI.
  • The streamlitVersion prop is properly sourced from SessionInfo in App.tsx with a guard for sessionInfo.isSet, and is optional (?) so MainMenu degrades gracefully when undefined.
  • The openMenu test helper refactoring (using vi.isFakeTimers() to auto-adapt) is a nice improvement that reduces coupling between individual tests and timer setup.
  • The menu structure refactoring (merging aboutItem into the standardItems section and commonItems section for minimal mode) is clean and the updated JSDoc block comment accurately reflects the new structure.

One minor observation:

  • In MainMenu.tsx line 617, the useEmotionTheme() hook is newly called in MenuContent solely to pass theme.iconSizes.md / theme.iconSizes.sm to CopyButton. This is fine (the hook was already used elsewhere in the component tree), but the theme variable could alternatively be avoided by passing string literals if these icon sizes are stable. This is purely cosmetic and not actionable.

Test Coverage

Test coverage is thorough:

Unit tests (MainMenu.test.tsx):

  • Version footer rendering (present when streamlitVersion is provided, absent when undefined).
  • Nightly .dev version truncation for display.
  • Full untruncated version string is passed to clipboard.
  • Footer renders in minimal mode.
  • Standalone formatDisplayVersion tests cover stable, nightly, and edge cases.
  • ESC shortcut tests for COUNTDOWN, RECORDING, and OFF states (including negative assertion for OFF).
  • About item ordering tests (after standard items in normal mode, last in minimal mode).

E2E tests (main_menu_test.py):

  • test_main_menu_version_footer_visible verifies the footer text is visible.
  • test_main_menu_version_footer_copies_version tests hover-to-reveal and clipboard copy (chromium-only, which is appropriate for clipboard API testing).
  • Snapshot test updated with version placeholder to avoid breakage across releases — a smart approach.

App.test.tsx:

  • Correctly moved vi.useRealTimers() and removed now-unnecessary vi.useFakeTimers() calls, since the updated openMenu helper handles both modes.

Backwards Compatibility

No breaking changes:

  • The streamlitVersion prop is optional — existing consumers of MainMenu that don't pass it will see no footer.
  • The About item moving from its own section to within the standard items section is a pure UI change with no API impact.
  • The ESC shortcut on the recording item is an additive enhancement.

Security & Risk

No security concerns identified:

  • The version string originates from sessionInfo.current.streamlitVersion (server-provided) and is rendered as React text content (no dangerouslySetInnerHTML).
  • Clipboard copy uses the existing useCopyToClipboard hook which delegates to the browser's Clipboard API.
  • No user-controlled input is involved in the footer.

Accessibility

Good overall accessibility posture:

  • The CopyButton has a descriptive aria-label ("Copy version to clipboard") and a copiedLabel ("Copied") for the post-copy state.
  • The focus-within CSS rule on StyledMenuVersionRow ensures the copy button becomes visible when it receives focus, so keyboard/screen reader users who tab to it will see it.
  • The version text itself is plain text content and naturally discoverable by screen readers.

One minor note:

  • The CopyButton inside StyledMenuVersionFooter sits within the role="menu" container but is not a menuitem/menuitemcheckbox/menuitemradio. WAI-ARIA technically requires direct interactive children of role="menu" to have menu-specific roles. In practice this is a common pattern for supplementary UI (the existing dividers are also non-menuitem children), and screen readers handle this reasonably. The copy button is not part of the roving tabindex navigation (ArrowUp/ArrowDown), so keyboard-only users who don't use a screen reader may not discover it easily. However, this is a supplementary action (copying the version), and the same version + copy pattern exists in the Settings dialog, so this is consistent and acceptable.

Recommendations

  1. Consider consolidating the two new E2E tests into a single scenario test. Per the E2E AGENTS.md guidance to "prefer a single aggregated scenario test over many micro-tests when they share the same setup and page state," test_main_menu_version_footer_visible and test_main_menu_version_footer_copies_version could be merged since the visible check is a natural precondition of the copy test. The visible test runs on all browsers while the copy test is chromium-only, so keeping them separate is also defensible — this is a minor suggestion.

  2. Minor: negative assertion opportunity in E2E. The E2E AGENTS.md recommends adding at least one "must NOT happen" check per scenario. test_main_menu_version_footer_visible could add a quick assertion that the copy button starts non-interactable (pointer-events: none) before hover. This is already covered in the copy test but would strengthen the visibility test too.

Verdict

APPROVED: Well-implemented feature with thorough test coverage, clean code following project conventions, and no backwards-compatibility or security concerns. The minor accessibility observation about the copy button's placement within role="menu" is consistent with existing patterns and does not block merging.


This is an automated AI review by opus-4.6-thinking.

@mayagbarnes mayagbarnes marked this pull request as ready for review February 20, 2026 06:24
Copy link
Copy Markdown
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This snapshot might also need th XX.XX... replacement to prevent flakiness

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch 👍🏼

@mayagbarnes mayagbarnes added the update-snapshots Trigger snapshot autofix workflow label Feb 20, 2026
@github-actions github-actions bot removed the update-snapshots Trigger snapshot autofix workflow label Feb 20, 2026
@mayagbarnes mayagbarnes merged commit 6171f6c into feature/new-app-menu Feb 20, 2026
39 checks passed
@mayagbarnes mayagbarnes deleted the menu-footer branch February 20, 2026 21:06
sfc-gh-mbarnes pushed a commit that referenced this pull request Feb 24, 2026
- Adds a "Made with Streamlit v{version}" footer inside the main menu, with a hover-to-reveal copy button that copies the full version string to the clipboard.
- Merges the About menu item into the standard items section (removing its separate divider).
- Adds the missing `ESC` keyboard shortcut hint on the Record screen item during active recording (parity with `develop`).
- Nightly `.dev` versions are truncated for display (e.g., `v1.54.1.dev`) but the full version (e.g., `1.54.1.dev20260217`) is copied.
mayagbarnes added a commit that referenced this pull request Feb 24, 2026
This PR is the culmination of the following PRs approved into this feature branch:
- [Core `MainMenu` Refactor](#13833)
- [`MainMenu` accessibility improvements](#13878)
- [Add theme switcher to `MainMenu`](#13937)
- [Add auto-rerun toggle to `MainMenu`](#13988)
- [Add version footer to `MainMenu`](#14028)
- [Remove `SettingsDialog`](#14048)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants