Skip to content

[STUD-577][Enhancement]: Disable "Distribute & Mint Song" toggle option and "Upload" button and render updated tooltip#952

Open
ITurres wants to merge 6 commits intomasterfrom
STUD-577-Disable-Distribute-Mint-Song-toggle-option-and-Upload-button-and-render-updated-tooltip
Open

[STUD-577][Enhancement]: Disable "Distribute & Mint Song" toggle option and "Upload" button and render updated tooltip#952
ITurres wants to merge 6 commits intomasterfrom
STUD-577-Disable-Distribute-Mint-Song-toggle-option-and-Upload-button-and-render-updated-tooltip

Conversation

@ITurres
Copy link
Member

@ITurres ITurres commented Feb 13, 2026

Pull Request — Issue STUD-577

Overview

This PR disables the "Distribute & Mint Song" toggle option and "Upload" button on the Upload a Song page when the webStudioDisableDistributionAndSales feature flag is enabled, and displays an updated tooltip with the official statement CTA.
Context: As part of NEWM Studio's service sunset, we need to prevent users from creating new releases and uploading songs. This PR implements the UI-level blocking for the upload flow, complementing the route-level blocking implemented in previous PRs. The new flag takes precedence over the existing webStudioDisableTrackDistributionAndMinting flag for tooltip content while maintaining backward compatibility.


Files Summary

Total Changes: 4 files modified
(Counts of added, modified, and deleted files can be seen in the PR diff view.)

Modified (4)
  • apps/studio/src/pages/home/uploadSong/BasicSongDetails.tsx

    • — Added support for webStudioDisableDistributionAndSales feature flag
    • — Disabled "Distribute & Mint Song" toggle when either flag is enabled (isDistributionDisabled)
    • — Disabled "Upload"/"Next"/"Save" button when distribution is disabled (via isSubmitDisabled logic)
    • — Implemented tooltip logic that prioritizes new flag's OfficialStatementCTA component over old flag's string tooltip
    • — Wrapped Upload button in Tooltip component to show tooltip on hover
    • — Refactored tooltip content to be reusable for both toggle and button
  • packages/elements/src/lib/SwitchInput.tsx

    • — Updated toggleTooltipText prop type from string to ReactNode to support JSX tooltip content
    • — Reorganized imports for better consistency
  • packages/elements/src/lib/form/SwitchInputField.tsx

    • — Updated toggleTooltipText prop type from string to ReactNode to match SwitchInput interfaceF
    • — Reorganized imports for better consistency
  • apps/studio/src/components/index.ts

    • — Added OfficialStatementCTA component to barrel exports

Impact

  • User Experience: When webStudioDisableDistributionAndSales is enabled, users cannot toggle on distribution/minting or submit the upload form. Tooltips provide clear messaging about the service discontinuation with a link to the official statement.
  • Backward Compatibility: The existing webStudioDisableTrackDistributionAndMinting flag continues to work as before. When both flags are enabled, the new flag's tooltip takes precedence.
  • Component API: The toggleTooltipText prop in SwitchInput and SwitchInputField now accepts ReactNode instead of just string, enabling richer tooltip content (backward compatible since ReactNode includes string).
  • Route-Level Protection: The Upload a Song path (/home/upload-song) is blocked as part of STUD-576 changes, so users won't be able to reach this page. However, since UploadSong component uses BasicSongDetails, the switch/toggle and buttons will still be disabled and show tooltips as a defense-in-depth measure.

Testing

  • Manual Testing:

    • ✅ Verified "Distribute & Mint Song" toggle is disabled when webStudioDisableDistributionAndSales is enabled
    • ✅ Verified toggle shows OfficialStatementCTA tooltip on hover when new flag is enabled
    • ✅ Verified toggle shows old tooltip text when only webStudioDisableTrackDistributionAndMinting is enabled
    • ✅ Verified "Upload"/"Next"/"Save" button is disabled when distribution is disabled
    • ✅ Verified Upload button shows tooltip on hover when flag is enabled
    • ✅ Verified backward compatibility with existing webStudioDisableTrackDistributionAndMinting flag
    • ✅ Verified tooltip content renders correctly with link to official statement
  • Component Testing:

    • ✅ Verified SwitchInput and SwitchInputField accept both string and ReactNode for toggleTooltipText prop

Related Issues

  • Closes STUD-577
  • Related to STUD-576 (Route-level blocking for upload/release creation paths)
  • Related to STUD-574 (Create LaunchDarkly flag for halted distribution and stream token creation functionality)

Dependencies

  • No new dependencies.
  • Uses existing OfficialStatementCTA component (already implemented in previous PRs)
  • Uses existing NEWM_STUDIO_OFFICIAL_STATEMENT_URL constant from common/constants.ts

Demo

  • When webStudioDisableDistributionAndSales is enabled:
    • "Distribute & Mint Song" toggle appears disabled and shows tooltip with official statement CTA on hover
    • "Upload" button appears disabled and shows same tooltip on hover
    • Tooltip includes link to https://newm.io/sunset/ for official statement
STUD-577-demo.mp4

Additional Notes

  • Flag Precedence: The new webStudioDisableDistributionAndSales flag takes precedence over webStudioDisableTrackDistributionAndMinting for tooltip content, but both flags contribute to disabling the controls (OR logic).
  • Route Blocking: The Upload a Song path (/home/upload-song) is blocked as part of STUD-576 changes, preventing users from accessing the page. This PR implements UI-level disabling as defense in depth—since UploadSong component uses BasicSongDetails, the switch/toggle and buttons will be disabled and show tooltips even if users somehow access the page (e.g., cached page, or edge cases).
  • Component Type Update: The change from string to ReactNode for toggleTooltipText is backward compatible since ReactNode includes string in its type definition.
  • Future Cleanup: Once the new flag is deployed to Production and the old webStudioDisableTrackDistributionAndMinting flag is disabled, only the new flag will be active for this functionality.

Other Issues

Circular Dependency Issue Discovered: During development, reordering exports in apps/studio/src/components/index.ts (alphabetically) exposed a pre-existing circular dependency: store.tsmodules/sessionslice.tsapi/actions.tsmodules/session (barrel), causing "Cannot access 'sessionReducer' before initialization" errors. The reorder was rolled back to keep this PR scoped.

  • Possible Fix:
    • Update api/actions.ts and api/utils.ts to import NewmAuthResponse from ../modules/session/types instead of ../modules/session (barrel) to break the cycle. Action Item: Open a new ticket to fix this circular dependency properly so barrel exports can be safely reordered in the future. --> Stop the dev server -> Delete .nx cache folder (or run nx reset) -> Restart the dev server

--END--

…pload buttons with new tooltip

- Add support for 'webStudioDisableDistributionAndSales' flag.
- Disable 'Distribute & Mint Song' toggle when flag is enabled.
- Disable 'Upload' button when flag is enabled.
- Show 'OfficialStatementCTA' tooltip for new flag (takes precedence over old flag).
- Maintain backward compatibility with 'webStudioDisableTrackDistributionAndMinting'.
@ITurres ITurres self-assigned this Feb 13, 2026
@ITurres ITurres requested a review from a team as a code owner February 13, 2026 16:19
@ITurres ITurres requested a review from Copilot February 13, 2026 16:20
@github-actions
Copy link

Visit the studio preview URL for this PR 🚀 : https://952.artist.preview.newm.io/

Copy link

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 implements UI-level blocking for the song upload flow when the webStudioDisableDistributionAndSales feature flag is enabled, as part of NEWM Studio's service sunset. The changes disable the "Distribute & Mint Song" toggle and "Upload" button, displaying tooltips with an official statement when users hover over these disabled controls.

Changes:

  • Updated SwitchInput and SwitchInputField to accept ReactNode for toggleTooltipText prop (instead of just string) to support richer tooltip content
  • Modified BasicSongDetails to check both feature flags and display appropriate tooltip content, with the new flag taking precedence
  • Added OfficialStatementCTA component to barrel exports

Reviewed changes

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

File Description
packages/elements/src/lib/SwitchInput.tsx Updated toggleTooltipText prop type from string to ReactNode; reorganized imports
packages/elements/src/lib/form/SwitchInputField.tsx Updated toggleTooltipText prop type to match SwitchInput interface; reorganized imports
apps/studio/src/pages/home/uploadSong/BasicSongDetails.tsx Added feature flag logic, disabled toggle and button when distribution is disabled, wrapped Upload button with Tooltip, implemented tooltip content with precedence logic
apps/studio/src/components/index.ts Added OfficialStatementCTA to exports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 539 to 554
<Tooltip title={ tooltipContent }>
<span>
<Button
disabled={ isSubmitDisabled }
isLoading={ isSubmitting }
type="submit"
width={
windowWidth && windowWidth > theme.breakpoints.values.md
? "compact"
: "default"
}
>
{ isMintingVisible ? "Next" : isInEditMode ? "Save" : "Upload" }
</Button>
</span>
</Tooltip>
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The tooltip appears on the Upload/Save button whenever a distribution flag is enabled, even when the button itself is not disabled. This can occur when editing an existing song with isMinting: false after agreeing to cover art guidelines. In this scenario, the button is clickable but shows a tooltip about distribution being disabled, which may confuse users. Consider only displaying the tooltip on the button when it's actually disabled due to distribution restrictions by checking if isSubmitDisabled is true and the disabled state is caused by isDistributionDisabled.

Suggested change
<Tooltip title={ tooltipContent }>
<span>
<Button
disabled={ isSubmitDisabled }
isLoading={ isSubmitting }
type="submit"
width={
windowWidth && windowWidth > theme.breakpoints.values.md
? "compact"
: "default"
}
>
{ isMintingVisible ? "Next" : isInEditMode ? "Save" : "Upload" }
</Button>
</span>
</Tooltip>
{ isSubmitDisabled && isDistributionDisabled ? (
<Tooltip title={ tooltipContent }>
<span>
<Button
disabled={ isSubmitDisabled }
isLoading={ isSubmitting }
type="submit"
width={
windowWidth && windowWidth > theme.breakpoints.values.md
? "compact"
: "default"
}
>
{ isMintingVisible ? "Next" : isInEditMode ? "Save" : "Upload" }
</Button>
</span>
</Tooltip>
) : (
<Button
disabled={ isSubmitDisabled }
isLoading={ isSubmitting }
type="submit"
width={
windowWidth && windowWidth > theme.breakpoints.values.md
? "compact"
: "default"
}
>
{ isMintingVisible ? "Next" : isInEditMode ? "Save" : "Upload" }
</Button>
) }

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Done ✅

export { default as ViewPDF } from "./ViewPDF";
export { default as WalletEnvMismatchModal } from "./WalletEnvMismatchModal";
export { default as InfoBanner } from "./InfoBanner";
export { default as OfficialStatementCTA } from "./OfficialStatementCTA";
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The export for OfficialStatementCTA is added at the end of the file, but according to the comment on line 1, exports should be in alphabetical order by component name. OfficialStatementCTA should be placed between NEWMLogo (line 19) and Owners (line 20). Note that there are other exports that are also out of alphabetical order in this file (e.g., AppleLogin and GoogleLogin after DistributionPricingDialog), but those are pre-existing issues.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Done ✅

@ITurres
Copy link
Member Author

ITurres commented Feb 13, 2026

Circular Dependency Issue Discovered @dmkirshon

During development, reordering exports in apps/studio/src/components/index.ts (alphabetically) exposed a pre-existing circular dependency: store.tsmodules/sessionslice.tsapi/actions.tsmodules/session (barrel), causing "Cannot access 'sessionReducer' before initialization" errors. The reorder was rolled back to keep this PR scoped.

  • Possible Fix:
    • Update api/actions.ts and api/utils.ts to import NewmAuthResponse from ../modules/session/types instead of ../modules/session (barrel) to break the cycle. Action Item: Open a new ticket to fix this circular dependency properly so barrel exports can be safely reordered in the future. --> Stop the dev server -> Delete .nx cache folder (or run nx reset) -> Restart the dev server

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.

1 participant