Skip to content

feat: show loader during background effect initialization [WPB-24453]#21441

Open
zskhan wants to merge 1 commit into
devfrom
feat/show-loader-during-bg-effect-initialization
Open

feat: show loader during background effect initialization [WPB-24453]#21441
zskhan wants to merge 1 commit into
devfrom
feat/show-loader-during-bg-effect-initialization

Conversation

@zskhan
Copy link
Copy Markdown
Contributor

@zskhan zskhan commented Jun 4, 2026

BugWPB-24453 Virtual background appears 2 seconds late when the effect is applied.

During the initialization and application of background effect, there will be a spinner displayed to improve the UX

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 15
  • Failed: 0
  • Skipped: 0
  • 🔁 Flaky: 0
  • 📊 Total: 15
  • Total Runtime: 127.7s (~ 2 min 8 sec)

@EnricoSchw EnricoSchw self-requested a review June 5, 2026 06:34

const {name} = useKoSubscribableChildren(participant?.user, ['name']);

const isBackgroundEffectInitializing = useBackgroundEffectsStore(state => state.isInitializing);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you add some tests for this state tansition? ideally unit, integration and e2e. Lets start with some unit tests?

  • should show loading overlay when background effect is initializing
  • should hide loading overlay when background effect is done initializing
  • should show loading overlay while video is loading (hasActiveVideo && !isVideoReady)
  • should hide loading overlay when video is ready (onCanPlay)
  • should not show overlay for non-self participants

const isSelfInitializing =
isSelfParticipant && isBackgroundEffectInitializing && is.nullOrUndefined(processedVideoStream);
const hasActiveVideo = (sharesCamera || sharesScreen) && !!videoStream && !isSelfInitializing;
const showLoadingOverlay =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This logic to showLoadingOverlay is a bit complex. we could extract it in a custom hook and that would make it easily testable too

// Simple, readable call to the custom hook
const showLoadingOverlay = useShowLoadingOverlay(
isSelfParticipant,
hasActiveVideo,
processedVideoStream,
);

</div>
)}

{showLoadingOverlay && (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please test(cmd+F5) that the loading overlay is properly announced to screen readers. Consider adding aria-label or aria-busy attributes

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