Skip to content

CODAP-1418: onboarding title and reliable "make a table" detection on touch - #159

Merged
kswenson merged 1 commit into
masterfrom
CODAP-1418-onboarding-title-and-no-table
Jun 20, 2026
Merged

kswenson merged 1 commit into
masterfrom
CODAP-1418-onboarding-title-and-no-table

Conversation

@kswenson

Copy link
Copy Markdown
Member

Summary

Companion to the v3 PR in concord-consortium/codap. Touch-device onboarding pre-loads
its dataset via dataContextFromURL. Now that v3 no longer auto-opens a case table for
that request:

  • Pass an explicit title in the dataContextFromURL request so the dataset reads
    "Mammals" (and "NHANES" for onboarding2) when the student opens the table. Adds the
    title strings (en/es).
  • Fix the "make a table" detection — the condition
    (type === 'caseTable', !isAccomplished('Drag')) used the comma operator, discarding
    the type check, so any non-graph component create (e.g. adding a slider) falsely
    completed the task; and 'caseTable' was the wrong type anyway (create notifications
    carry 'table' in both v2 and v3). Now mirrors the graph line:
    else if (type === 'table') handleAccomplishment('MakeTable', !isAccomplished('Drag')).

Dependency

Requires the companion v3 changes (the title handling on dataContextFromURL, and the
component create notification when opening a table). Without them, the title won't apply
and "make a table" won't complete.

Deferred follow-up

The plugin's touch detection hasMouse = !('ontouchstart' in window) is brittle — it
over-reports touch on mouse-capable devices (touchscreen laptops, hybrids, some Chrome
configs), which routes them to the touch onboarding flow. Left unchanged here. A future
fix could use window.matchMedia('(any-pointer: fine)').matches, which maps more closely
to "has a precise pointer that can drag": finger-only iPad → false, iPad with
trackpad/Pencil → true, touchscreen laptop → true.

Deployment

After merge, the rebuilt plugin must be synced to
s3://codap-resources/plugins/onboarding/ (build-and-manual-copy: npm run clean && npm run build in onboarding/, then aws s3 sync + CloudFront invalidation). Merging
does not deploy it.

Relates to CODAP-1418.

🤖 Generated with Claude Code

…(CODAP-1418)

Touch-device onboarding pre-loads its dataset via dataContextFromURL. Now that
v3 no longer auto-opens a case table for that request:

- Pass an explicit `title` so the dataset reads "Mammals" (and "NHANES" for
  onboarding2) when the student opens the table; add the title strings (en/es).
- Fix a comma-operator bug in the "make a table" detection: the condition
  `(type === 'caseTable', !isAccomplished('Drag'))` discarded the type check, so
  any non-graph component create (e.g. a slider) falsely completed the task, and
  'caseTable' was the wrong type anyway. Mirror the graph line instead:
  `else if (type === 'table') handleAccomplishment('MakeTable', !isAccomplished('Drag'))`
  — create notifications carry type 'table' in both v2 and v3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the onboarding plugin to better support CODAP v3 touch onboarding by ensuring loaded datasets get a user-facing title and by correcting the logic that detects when the user creates a table component.

Changes:

  • Adds localized dataset/table titles (en/es) for Mammals and NHANES.
  • Passes an explicit title in the dataContextFromURL create request so the data context/table displays the desired name.
  • Fixes “make a table” task completion logic by removing the comma-operator bug and matching the correct create-notification type.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
onboarding/target/strings.json Adds new localized keys for table/data context titles (en/es).
onboarding/target/onboarding.js Fixes table-create detection and sends title with dataContextFromURL.
onboarding/source/strings.json Mirrors the new localized title keys in the source strings file.
onboarding/source/js/onboarding.js Mirrors the notification fix and dataContextFromURL title addition in source JS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kswenson
kswenson requested a review from bfinzer June 20, 2026 00:18

@bfinzer bfinzer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍🏻LGTM

@kswenson
kswenson merged commit 228bbd9 into master Jun 20, 2026
1 check passed
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