Skip to content

Translate: Log StringNotFound UX events for experimentation - #4454

Merged
ayshushus merged 4 commits into
mozilla:mainfrom
ayshushus:4360-snf-usage-data
Sep 1, 2026
Merged

Translate: Log StringNotFound UX events for experimentation#4454
ayshushus merged 4 commits into
mozilla:mainfrom
ayshushus:4360-snf-usage-data

Conversation

@ayshushus

@ayshushus ayshushus commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Fix #4360

Log the 2 buttons for all 3 panels:

  • filters: the active filters the string doesn't match
  • project: the project and resource the string lives in
  • resource: only the resource, the string being in the current project

Changes:

  • Log StringNotFound UX events, similar to how it's done for Notifications.
  • Add tests to log cases for different panel load cases.

@ayshushus ayshushus self-assigned this Aug 27, 2026
@ayshushus
ayshushus requested a review from eemeli August 27, 2026 00:52
@ayshushus

Copy link
Copy Markdown
Contributor Author

@eemeli I tried to copy the approach we have for the Notifications experiment. Let me know if there's anything to change with that context and your opinion on using that approach.

@ayshushus
ayshushus marked this pull request as ready for review August 27, 2026 00:53
Comment thread translate/src/modules/entities/components/StringNotFound.tsx Outdated
Comment thread translate/src/modules/entities/components/StringNotFound.tsx Outdated
all_projects: allProjects,
same_project: sameProject,
same_resource: sameResource,
filtered_out: filteredOut,

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.

The filteredOut value is derived solely from the previous ones, and leaves out the ... && entityLocation.filters.length > 0 that's also applied below.

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.

There was also a bug in the test (along with this oversight), commented below.

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.

Dropping filtered_out was the wrong fix here, as it's now not possible to reconstruct from the log data what was rendered.

The filteredOut value should be refactored to incorporate the condition that's included inline in the render method, and it should be included in the log data.

You should also assess whether it's desirable for the logged data to be a bag of booleans, or an enum. I'm not sure which; that depends on how we're intending to use this data.

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.

incorporate the condition that's included inline in the render method, and it should be included in the log data.

Refactored filteredOut to incorporate && entityLocation.filters.length > 0.

assess whether it's desirable for the logged data to be a bag of booleans, or an enum

Used an enum and added a panel constant. Currently have 3 × 2 = 6 click cells plus 3 render counts as denominators.

@ayshushus

Copy link
Copy Markdown
Contributor Author

@eemeli, 2 other changes:

  1. I removed the UX_* constants because they're not really constants anymore (used only once).
  2. The test had an bug with a loose assertion (from expect.anything()) which I fixed by using it.each so this allows a fresh mount per button.

@ayshushus
ayshushus requested a review from eemeli August 27, 2026 23:20

@eemeli eemeli left a comment

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.

See comment reply above.

For future reference, please do not resolve and close my review comments, unless you're using the GitHub website UI to merge a suggestion I've made in a review comment.

In particular for reviews that end up taking multiple rounds, it's much easier for me to assess if my previous feedback has been accounted for by having me resolve and close threads.

@ayshushus
ayshushus requested a review from eemeli September 1, 2026 05:07

@eemeli eemeli left a comment

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 decent now; left one more minor question inline that might just need an answer, rather than any code changes.


const logAction = (action: string) => {
if (isAuthUser) {
logUXAction(action, 'String Not Found 1.0', { panel });

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.

If the data is an enum-ish string value, why wrap it inside an object?

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.

To be honest it's because the only consumption is manual queries. This way just seems more self-describing to me in case we want to track this a lot later.

@ayshushus
ayshushus merged commit e781a02 into mozilla:main Sep 1, 2026
10 checks passed
@ayshushus
ayshushus deleted the 4360-snf-usage-data branch September 1, 2026 18:48
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.

Translate: Collect usage data on StringNotFound actions

2 participants