Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Aug 21, 2025

Summary

This PR adds a VSCode notification to inform users when their organization's MDM policy requires authentication and they attempt to navigate away from the AccountView without being authenticated.

Changes

Core Functionality

  • Added logic in App.tsx to send a notification message when MDM blocks navigation (when mdmCompliant === false and user tries to switch tabs)
  • Added showMdmAuthRequiredNotification message type to the WebviewMessage interface
  • Implemented handler in webviewMessageHandler.ts to display a VSCode warning notification

Localization

  • Added translation key mdm.info.organization_requires_auth with value "Your organization requires authentication" to all 17 supported language files
  • Fixed translation key path to use common:mdm.info.organization_requires_auth for proper message display

Testing

  • Verified that the notification appears when:
    • User is under MDM policy (mdmCompliant === false)
    • User attempts to navigate away from AccountView
    • User is not authenticated

Related Issues

Fixes the issue where users under MDM policy had no feedback when navigation was blocked due to authentication requirements.


Important

Adds MDM authentication notification in App.tsx to inform users when navigation is blocked due to policy requirements.

  • Behavior:
    • In App.tsx, added logic to block tab switching and notify users when mdmCompliant === false and they try to switch away from account tab.
    • Added showMdmAuthRequiredNotification message type to WebviewMessage interface.
  • Localization:
    • Added translation key mdm.info.organization_requires_auth to all supported language files for the message "Your organization requires authentication".
  • Testing:
    • Verified notification appears when user is under MDM policy (mdmCompliant === false), attempts to navigate away from AccountView, and is not authenticated.

This description was created by Ellipsis for 277e7bc. You can customize this summary. It will automatically update as commits are pushed.

- Show VSCode warning when users under MDM policy try to leave AccountView without auth
- Add showMdmAuthRequiredNotification message type to WebviewMessage interface
- Implement handler in webviewMessageHandler to display localized warning
- Add 'Your organization requires authentication' translation in all 17 languages
- Fix translation key path to use common:mdm.info.organization_requires_auth
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners August 21, 2025 16:08
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Aug 21, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Aug 21, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I've reviewed the changes and the implementation looks solid. The MDM authentication notification feature correctly addresses the issue of providing user feedback when navigation is blocked. The localization is comprehensive across all supported languages, and the logic properly distinguishes between having no MDM policy vs. being non-compliant. I have some suggestions for improvement below.

// If mdmCompliant is undefined or true, allow tab switching
if (mdmCompliant === false && newTab !== "account") {
// Notify the user that authentication is required by their organization
vscode.postMessage({ type: "showMdmAuthRequiredNotification" })
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding test coverage for this new notification feature. It would be valuable to verify:

  • The notification is triggered when mdmCompliant === false and user tries to switch tabs
  • The correct message is displayed to the user
  • The notification handler works correctly

Also, have you considered the UX for repeated attempts? Currently, the notification will show every time the user clicks a different tab. Would it make sense to throttle this or show it only once per session with a more persistent indicator?

// If mdmCompliant is undefined or true, allow tab switching
if (mdmCompliant === false && newTab !== "account") {
// Notify the user that authentication is required by their organization
vscode.postMessage({ type: "showMdmAuthRequiredNotification" })
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a telemetry event here to track when users encounter MDM blocks. This could help understand usage patterns and potential friction points:


// Check MDM compliance and send user to account tab if not compliant
if (!this.checkMdmCompliance()) {
// Only redirect if there's an actual MDM policy requiring authentication
Copy link
Contributor

Choose a reason for hiding this comment

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

Great improvement to only check MDM compliance when there's actually an MDM policy! Consider adding JSDoc comments to document the three states of mdmCompliant:

  • undefined: No MDM policy exists
  • true: MDM policy exists and user is compliant
  • false: MDM policy exists and user is non-compliant

This would help future developers understand the distinction.

codebaseIndexSearchMinScore: codebaseIndexConfig?.codebaseIndexSearchMinScore,
},
mdmCompliant: this.checkMdmCompliance(),
// Only set mdmCompliant if there's an actual MDM policy
Copy link
Contributor

Choose a reason for hiding this comment

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

Good consistency with the MDM compliance check. The comment clearly explains the three states, which is helpful.

// Check MDM compliance before allowing tab switching
// Only check MDM compliance if mdmCompliant is explicitly false (meaning there's an MDM policy and user is non-compliant)
// If mdmCompliant is undefined or true, allow tab switching
if (mdmCompliant === false && newTab !== "account") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider extracting this MDM check logic into a custom hook or utility function for better reusability and testability. For example:

This would make the logic easier to test and reuse if needed elsewhere.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 21, 2025
@mrubens mrubens merged commit 4216618 into main Aug 21, 2025
38 of 41 checks passed
@mrubens mrubens deleted the feat/mdm-auth-notification branch August 21, 2025 18:12
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 21, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants