Skip to content

Conversation

@jasonyuezhang
Copy link
Owner

Add a flag to opt users into UI2 and the new experience


Copied from getsentry#101988
Original PR: getsentry#101988

@propel-test-bot propel-test-bot bot changed the title ui2: add enforce flag ui2: Add 'chonk-ui-enforce' feature flag to force Chonk UI adoption Oct 23, 2025
@propel-test-bot
Copy link

Support chonk-ui-enforce flag in theme switching & prompt logic

This PR introduces a new feature-flag pathway (chonk-ui-enforce) to force the UI2 ("chonk") experience for all users in an organization. Two production hooks (useThemeSwitcher, useChonkPrompt) are updated so that the new flag overrides user preference checks and disables associated onboarding prompts. Unit tests are expanded to cover enforced scenarios.

Key Changes

• Updated static/app/utils/theme/useThemeSwitcher.tsx to apply chonk themes when organization has chonk-ui-enforce, independent of prefersChonkUI
• Enhanced static/app/utils/theme/useChonkPrompt.tsx with hasChonkUIEnforce logic to disable banner/dot prompts when enforcement is active
• Added new test cases in useThemeSwitcher.spec.tsx and useChonkPrompt.spec.tsx validating enforced behavior
• Refactored flag checks: split hasChonkUIAccess vs hasChonkUIEnforce, adjusted early-return conditions and prompt enablement

Affected Areas

static/app/utils/theme/useThemeSwitcher.tsx
static/app/utils/theme/useChonkPrompt.tsx
• Associated unit tests

This summary was automatically generated by @propel-code-bot

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.

3 participants