8000 paradata: log invisible widgets at the end of sections by tahini · Pull Request #1033 · chairemobilite/evolution · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

paradata: log invisible widgets at the end of sections #1033

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

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

tahini
Copy link
Contributor
@tahini tahini commented Jun 13, 2025

fixes #1016

When the user navigates to another section or when a button is clicked, we save the list of hidden widgets on the current section so we can know which widgets were seen by the participant or not.

Update log export to add the hidden widgets

Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds tracking of widgets that were not visible when a user leaves a section or clicks a button, and includes those hidden widget paths in both the frontend update flow and the backend export CSV.

  • Frontend now computes hidden widget paths and attaches them to UserAction during updates and navigation.
  • UserAction type is extended to include an optional hiddenWidgets array.
  • Backend export logic includes a hiddenWidgets column in CSV output, and tests are updated accordingly.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/evolution-frontend/src/actions/tests/Survey.test.ts Added tests to verify hiddenWidgets in update and navigation.
packages/evolution-frontend/src/actions/Survey.ts Implemented getHiddenWidgets and enhanced user actions.
packages/evolution-common/src/services/questionnaire/types/Data.ts Extended UserAction type with optional hiddenWidgets.
packages/evolution-backend/src/services/adminExport/exportInterviewLogs.ts Exported hiddenWidgets in CSV rows.
packages/evolution-backend/src/services/adminExport/tests/exportInterviewLogs.test.ts Updated export tests to assert hiddenWidgets field.

event_date: new Date((2) * 1000).toISOString(),
modifiedFields: modifiedKeys,
initializedFields: initializedKeys,
unsetFields: buttonLogs[1].unset_paths !== undefined ? buttonLogs[0].unset_paths.join('|') : '',
Copy link
Preview
Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

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

In the second button_click row assertion, the test uses buttonLogs[0].unset_paths but should use buttonLogs[1].unset_paths to match the second log entry.

Suggested change
unsetFields: buttonLogs[1].unset_paths !== undefined ? buttonLogs[0].unset_paths.join('|') : '',
unsetFields: buttonLogs[1].unset_paths !== undefined ? buttonLogs[1].unset_paths.join('|') : '',

Copilot uses AI. Check for mistakes.

event_date: new Date((2) * 1000).toISOString(),
modifiedFields: modifiedKeys2,
initializedFields: initializedKeys2,
unsetFields: sectionChangeLogs[1].unset_paths !== undefined ? sectionChangeLogs[0].unset_paths.join('|') : '',
Copy link
Preview
Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

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

In the second section_change row assertion, the test references sectionChangeLogs[0].unset_paths instead of sectionChangeLogs[1].unset_paths, causing a mismatch with the second log.

Suggested change
unsetFields: sectionChangeLogs[1].unset_paths !== undefined ? sectionChangeLogs[0].unset_paths.join('|') : '',
unsetFields: sectionChangeLogs[1].unset_paths !== undefined ? sectionChangeLogs[1].unset_paths.join('|') : '',

Copilot uses AI. Check for mistakes.

fixes chairemobilite#1016

When the user navigates to another section or when a button is clicked,
we save the list of hidden widgets on the current section so we can know
which widgets were seen by the participant or not.

Update log export to add the hidden widgets
@tahini tahini force-pushed the logHiddenWidgets branch from 9c85b7d to b70de60 Compare June 13, 2025 18:55
@tahini tahini merged commit 07b5173 into chairemobilite:main Jun 13, 2025
6 checks passed
@tahini tahini deleted the logHiddenWidgets branch June 13, 2025 20:30
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.

paradata: log invisible widgets at the end of a section
2 participants
0