Skip to content

[bugfix] Mobile configuration page enable devices button when camera or microphone is available#3944

Merged
edwardlee-msft merged 7 commits intomainfrom
elee/bugfix-mobile-devices-button-config-page
Dec 27, 2023
Merged

[bugfix] Mobile configuration page enable devices button when camera or microphone is available#3944
edwardlee-msft merged 7 commits intomainfrom
elee/bugfix-mobile-devices-button-config-page

Conversation

@edwardlee-msft
Copy link
Copy Markdown
Contributor

What

Enable devices button on localpreview on mobile configuration page when either microphone or camera is available

Why

https://skype.visualstudio.com/SPOOL/_workitems/edit/3520771

Before After
image device button enabled

How Tested

MacOS - Chrome - Calling Sample - Mobile view

Process & policy checklist

  • I have updated the project documentation to reflect my changes if necessary.
  • I have read the CONTRIBUTING documentation.

Is this a breaking change?

  • This change causes current functionality to break.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 22, 2023

CallWithChat bundle size is increased❗.

  • Current size: 6430997
  • Base size: 6430973
  • Diff size: 24

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 22, 2023

Chat bundle size is not changed.

  • Current size: 1533202
  • Base size: 1533202
  • Diff size: 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 22, 2023

Calling bundle size is increased❗.

  • Current size: 5615261
  • Base size: 5615237
  • Diff size: 24

data-ui-id="call-composite-local-device-settings-options-button"
{...devicesButtonProps}
// disable button whilst all other buttons are disabled
disabled={!microphonePermissionGranted || !cameraPermissionGranted || hasNoDevices}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suppose technically we should be checking both the permission cross referencing those if there are devices for each?

const hasNoMics = !microphonePermissionGranted || !devicesButtonProps.microphones.length;
const hasNoSpeakers = !devicesButtonProps.speakers.length; // any permission needed here?
const hasNoCamera = !cameraPermissionGranted || !devicesButtonProps.cameras.length;
disabled = hasNoMics && hasNoSpeakers && hasNoCamera;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thinking of the case where we have cameras, but no camera permission

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Although no permission maybe means we have no cameras... Though not sure if no camera via the role capability means that

Copy link
Copy Markdown
Member

@JamesBurnside JamesBurnside Dec 22, 2023

Choose a reason for hiding this comment

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

Actually yeah no we just need to check the camera permission - ignore all this ^_^

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reopening -- but only because we might have no camera permission and no mic permission -- but still want to change the speaker.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thinking of the case where we have cameras, but no camera permission

No! I was thinking of the case where we have camera permission, but no cameras and we have microphones but no microphone permission (and lets assume no speakers). Then the button won't be disabled when it should be

Copy link
Copy Markdown
Member

@JamesBurnside JamesBurnside Dec 22, 2023

Choose a reason for hiding this comment

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

Can you tell its the Friday before xmas 🎅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like this, as it does a check for when devices have no microphone or camera present despite having permissions.
However, the hasNoDevices does something similar here for this specific case so we are covered I believe.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like there's still a couple edge cases:

  • no camera or microphone permission but user wishes to change speaker (button will be disabled when it should not)
  • we have camera permission and no cameras, and we have no microphone permission but do have mics, and have no speakers (button will be enabled when it should not)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 22, 2023

@azure/communication-react jest test coverage for beta.

Lines Statements Functions Branches
Base 43794 / 70190
62.39%
43794 / 70190
62.39%
910 / 1971
46.16%
2599 / 4208
61.76%
Current 43793 / 70191
62.39%
43793 / 70191
62.39%
910 / 1971
46.16%
2585 / 4200
61.54%
Diff -1 / 1
0%
-1 / 1
0%
0 / 0
0%
-14 / -8
-0.22%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 22, 2023

@azure/communication-react jest test coverage for stable.

Lines Statements Functions Branches
Base 21775 / 34321
63.44%
21775 / 34321
63.44%
594 / 1027
57.83%
1707 / 2718
62.8%
Current 21813 / 34321
63.55%
21813 / 34321
63.55%
594 / 1027
57.83%
1707 / 2722
62.71%
Diff 38 / 0
0.11%
38 / 0
0.11%
0 / 0
0%
0 / 4
-0.09%

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@edwardlee-msft edwardlee-msft enabled auto-merge (squash) December 27, 2023 18:00
@edwardlee-msft edwardlee-msft merged commit 5fa3131 into main Dec 27, 2023
@edwardlee-msft edwardlee-msft deleted the elee/bugfix-mobile-devices-button-config-page branch December 27, 2023 18:07
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