Skip to content

Separate font handling in useThemeManager#12759

Merged
mayagbarnes merged 1 commit intodevelopfrom
custom-dark-theme-fe-1
Oct 17, 2025
Merged

Separate font handling in useThemeManager#12759
mayagbarnes merged 1 commit intodevelopfrom
custom-dark-theme-fe-1

Conversation

@mayagbarnes
Copy link
Copy Markdown
Collaborator

@mayagbarnes mayagbarnes commented Oct 10, 2025

Describe your changes

This PR refactors the font handling/setting logic in useThemeManager from setImportedTheme to separate concerns and reduce unnecessary createTheme calls triggered through App.tsx's processing of the themeInput from new session message.

Testing Plan

  • JS Unit Tests: ✅ Added

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Oct 10, 2025

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

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 10, 2025

✅ PR preview is ready!

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

Copy link
Copy Markdown
Collaborator Author

mayagbarnes commented Oct 10, 2025

@mayagbarnes mayagbarnes changed the title separate font handling Separate font handling in useThemeManager Oct 10, 2025
@mayagbarnes mayagbarnes added security-assessment-completed impact:internal PR changes only affect internal code change:refactor PR contains code refactoring without behavior change labels Oct 10, 2025 — with Graphite App
@mayagbarnes mayagbarnes marked this pull request as ready for review October 13, 2025 15:55
@mayagbarnes mayagbarnes requested a review from Copilot October 13, 2025 15:55
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 refactors font handling in the useThemeManager hook by extracting font-related logic into a separate setFonts method. This separation of concerns reduces unnecessary createTheme calls when only font information needs to be processed.

Key Changes

  • Extracted font handling logic from setImportedTheme into a dedicated setFonts method
  • Updated App.tsx to use setFonts instead of setImportedTheme for font-only operations
  • Added comprehensive test coverage for the new setFonts method

Reviewed Changes

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

File Description
frontend/app/src/util/useThemeManager.ts Extracted font handling logic into separate setFonts method and updated interface
frontend/app/src/util/useThemeManager.test.ts Added comprehensive test suite for new setFonts method and reorganized existing tests
frontend/app/src/App.tsx Updated to call setFonts instead of setImportedTheme for font-only processing
frontend/app/src/App.test.tsx Updated test mocks and assertions to reflect the new setFonts method usage

@mayagbarnes mayagbarnes merged commit 92124e7 into develop Oct 17, 2025
37 checks passed
@mayagbarnes mayagbarnes deleted the custom-dark-theme-fe-1 branch October 17, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:refactor PR contains code refactoring without behavior change impact:internal PR changes only affect internal code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants