Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCV first pass #10355

Merged
merged 34 commits into from
Feb 6, 2025
Merged

OCV first pass #10355

merged 34 commits into from
Feb 6, 2025

Conversation

srietkerk
Copy link
Contributor

This is the work to plug in the One Customer Voice iframe into our products. Right now, it's only getting triggered from our settings menus, but we can pop this modal up in any context.

Things of note in this PR

  • I likely should have split this into a separate PR, but I added a flag to the CLI to use https rather than always using http. This was needed because the OCV iframe only shows up for domains in an allow list, and the local development options they have for that allow list use https.
  • I added the giveFeedback option to the appTheme object as a starting point for only showing the feedback menu item for our targets.
  • FeedbackListener.ts is where the logic to get OCV to work lives. There is a lot of generic code in there and console logs that I figure we'll want to update to something more clean/helpful, but I kept it in for now for simplicity. A note about the event listener: the ones that I kept in are the ones I figured would be useful for us. There were some others, but I removed them because for our use case, they wouldn't really apply. If you would like to see the other events, I would be happy to showcase them.

To Dos

  • Programmatically changing the theme of the feedback for high contrast and so we can have different colors based on the target we're serving from
  • Use the "kind" flag that I've added to the feedback object to change the feedback config. I'm planning on following a similar pattern that the share modal uses with ShareInfo.
  • Get rating feedback to show upon finishing tutorials

Testing
Unfortunately, I cannot make an upload target that will be useful for these changes because of the allow list that I talked about before. I've pinged the OCV teams a couple of times to get the makecode domain in their allow list but I'm not sure of the progress. If I made an upload target, you would be able to see the "Give Feedback" option in the setting menu, but clicking on it will give you a modal with a broken iframe. If you want to actually try out the forms, you can test locally with https. I'm going to write up a doc on how to test OCV locally.

In the meantime, here's how it looks:
image

image

image

@srietkerk srietkerk requested a review from a team January 28, 2025 00:01
Copy link
Member

@riknoll riknoll left a comment

Choose a reason for hiding this comment

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

would be nice to have typings for these configs! they don't have to be exhaustive, but should include the fields you're referencing. we can expand them later as we add more code

react-common/components/controls/Feedback/Feedback.tsx Outdated Show resolved Hide resolved
react-common/components/controls/Feedback/configs.ts Outdated Show resolved Hide resolved
react-common/styles/controls/Feedback.less Outdated Show resolved Hide resolved
webapp/src/container.tsx Outdated Show resolved Hide resolved
@abchatra
Copy link
Collaborator

Nice work

@@ -0,0 +1,57 @@
export const appId = 50315;
export const feedbackFrameUrl = 'https://admin-ignite.microsoft.com';
Copy link
Contributor

@thsparks thsparks Jan 28, 2025

Choose a reason for hiding this comment

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

Are feedbackFrameUrl and appId things we should store in targetconfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was definitely something I was considering, but these are going to be the same for each of our targets, so it feels redundant to put these in the target config of each target.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose that's true. Ideally, I think we'd want to put this somewhere that wouldn't require a release to change (i.e. what happened with our CDN) but I'm not sure if we have a good option for that without going through our backend.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree this url should go in pxtarget.json, even if it is the same for each target. This is what we do for privacyUrl, termsOfUseUrl, etc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Somewhat related question: is the OCV/feedback feature only enabled for 1st party targets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we should only be showing feedback in our self-hosted targets. There is more work to really verify this, which will be my next priority, but for now, it's just something that gets set in the apptheme as something to include in the target.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Were you able to move these hard-coded config values to pxtarget.json?

webapp/src/container.tsx Outdated Show resolved Hide resolved
localtypings/pxtarget.d.ts Outdated Show resolved Hide resolved
@@ -805,6 +805,7 @@ declare namespace pxt.editor {
extensionsVisible?: boolean;
isMultiplayerGame?: boolean; // Arcade: Does the current project contain multiplayer blocks?
onboarding?: pxt.tour.BubbleStep[];
feedback?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this field mean? Can it be better named? Or add a comment after it?

@@ -0,0 +1,57 @@
export const appId = 50315;
export const feedbackFrameUrl = 'https://admin-ignite.microsoft.com';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Were you able to move these hard-coded config values to pxtarget.json?

Copy link
Collaborator

@eanders-ms eanders-ms left a comment

Choose a reason for hiding this comment

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

Looks good!

@srietkerk srietkerk requested a review from riknoll February 5, 2025 00:55
@srietkerk srietkerk merged commit 7f1a94d into master Feb 6, 2025
6 checks passed
@srietkerk srietkerk deleted the srietkerk/ocv-iframe branch February 6, 2025 23:17
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.

5 participants