Skip to content

test my brain - #35

Merged
joshunrau merged 6 commits into
mainfrom
TMB
Jun 17, 2026
Merged

test my brain#35
joshunrau merged 6 commits into
mainfrom
TMB

Conversation

@joshunrau

@joshunrau joshunrau commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator
  • update odc packages to v2
  • set defaultFullscreen for all TMB tasks
  • add two new TMB tasks
  • add translations for two existing TMB tasks

Summary by CodeRabbit

  • New Features

    • Added Flanker Attention interactive task with support for keyboard, mouse, and touch input methods.
    • Added French language support for Verbal Paired Associates tests.
  • Improvements

    • Multiple interactive tests now default to fullscreen display.
    • Enhanced language selection and locking capabilities across tests.
    • Improved localized interface assets for Letter-Number Switching.

@joshunrau
joshunrau merged commit 66ccd16 into main Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d1cd6f61-6d89-4da0-812d-67c252b1c831

📥 Commits

Reviewing files that changed from the base of the PR and between e8ebd2c and 29af207.

⛔ Files ignored due to path filters (12)
  • lib/interactive/TMB_FLANKER_ATTENTION/TestMyBrain.12.18.min.js is excluded by !**/*.min.js
  • lib/interactive/TMB_FLANKER_ATTENTION/fingerLeft.png is excluded by !**/*.png
  • lib/interactive/TMB_FLANKER_ATTENTION/fingerRight.png is excluded by !**/*.png
  • lib/interactive/TMB_FLANKER_ATTENTION/fingerUp.png is excluded by !**/*.png
  • lib/interactive/TMB_FLANKER_ATTENTION/fonts/Inconsolata-Regular.ttf is excluded by !**/*.ttf
  • lib/interactive/TMB_FLANKER_ATTENTION/leftButton.png is excluded by !**/*.png
  • lib/interactive/TMB_FLANKER_ATTENTION/pressM_icon.png is excluded by !**/*.png
  • lib/interactive/TMB_FLANKER_ATTENTION/pressX_icon.png is excluded by !**/*.png
  • lib/interactive/TMB_FLANKER_ATTENTION/rightButton.png is excluded by !**/*.png
  • lib/interactive/TMB_VERBAL_PA_STUDY/TestMyBrain.12.18.min.js is excluded by !**/*.min.js
  • lib/interactive/TMB_VERBAL_PA_TEST/TestMyBrain.12.18.min.js is excluded by !**/*.min.js
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (41)
  • lib/interactive/TMB_DIGIT_SYMBOL_MATCHING/index.ts
  • lib/interactive/TMB_EMOTION_RECOGNITION/index.ts
  • lib/interactive/TMB_FLANKER_ATTENTION/TestHelper.v1.Oct23.js
  • lib/interactive/TMB_FLANKER_ATTENTION/chooseInput.v1.Feb24.js
  • lib/interactive/TMB_FLANKER_ATTENTION/font.ts
  • lib/interactive/TMB_FLANKER_ATTENTION/fragment.html
  • lib/interactive/TMB_FLANKER_ATTENTION/index.ts
  • lib/interactive/TMB_FLANKER_ATTENTION/render.d.ts
  • lib/interactive/TMB_FLANKER_ATTENTION/render.js
  • lib/interactive/TMB_FLANKER_ATTENTION/styles.css
  • lib/interactive/TMB_FLANKER_ATTENTION/translator.ts
  • lib/interactive/TMB_LN_SWITCHING/_Inst0_en.webp
  • lib/interactive/TMB_LN_SWITCHING/_Inst0_fr.webp
  • lib/interactive/TMB_LN_SWITCHING/_Inst2_en.webp
  • lib/interactive/TMB_LN_SWITCHING/_Inst2_fr.webp
  • lib/interactive/TMB_LN_SWITCHING/_Inst3_en.webp
  • lib/interactive/TMB_LN_SWITCHING/_Inst3_fr.webp
  • lib/interactive/TMB_LN_SWITCHING/_Inst4_en.webp
  • lib/interactive/TMB_LN_SWITCHING/_Inst4_fr.webp
  • lib/interactive/TMB_LN_SWITCHING/_letterInst_click_en.webp
  • lib/interactive/TMB_LN_SWITCHING/_letterInst_click_fr.webp
  • lib/interactive/TMB_LN_SWITCHING/_letterInst_en.webp
  • lib/interactive/TMB_LN_SWITCHING/_letterInst_fr.webp
  • lib/interactive/TMB_LN_SWITCHING/_numberInst_click_en.webp
  • lib/interactive/TMB_LN_SWITCHING/_numberInst_click_fr.webp
  • lib/interactive/TMB_LN_SWITCHING/_numberInst_en.webp
  • lib/interactive/TMB_LN_SWITCHING/_numberInst_fr.webp
  • lib/interactive/TMB_LN_SWITCHING/index.ts
  • lib/interactive/TMB_LN_SWITCHING/render.js
  • lib/interactive/TMB_MATRIX_REASONING/index.ts
  • lib/interactive/TMB_MOT/index.ts
  • lib/interactive/TMB_SIMPLE_RT/index.ts
  • lib/interactive/TMB_VERBAL_PA_STUDY/index.ts
  • lib/interactive/TMB_VERBAL_PA_STUDY/render.js
  • lib/interactive/TMB_VERBAL_PA_STUDY/translator.ts
  • lib/interactive/TMB_VERBAL_PA_TEST/index.ts
  • lib/interactive/TMB_VERBAL_PA_TEST/render.js
  • lib/interactive/TMB_VERBAL_PA_TEST/translator.ts
  • lib/interactive/TMB_VISUAL_PA_STUDY/index.ts
  • lib/interactive/TMB_VISUAL_PA_TEST/index.ts
  • package.json

Walkthrough

Adds the complete TMB_FLANKER_ATTENTION interactive instrument (helpers, render logic, styles, translations, Zod schema). Extends TMB_VERBAL_PA_STUDY, TMB_VERBAL_PA_TEST, and TMB_LN_SWITCHING with French localization. Sets defaultFullscreen: true (and related flags) on seven existing instruments. Bumps three @opendatacapture dependencies to ^2.0.0.

Changes

TMB_FLANKER_ATTENTION – New Instrument

Layer / File(s) Summary
Browser UI helpers
lib/interactive/TMB_FLANKER_ATTENTION/TestHelper.v1.Oct23.js, lib/interactive/TMB_FLANKER_ATTENTION/chooseInput.v1.Feb24.js
Adds debounce, disableSelect, tmbUI.getInput (full input-capture controller with RT/dwell/highlight/timeout), showAlert, setBodyScale, deviceScan, parseQuery, and the chooseInput input-modality selection prompt.
Instrument definition, schema, and translations
lib/interactive/TMB_FLANKER_ATTENTION/index.ts, lib/interactive/TMB_FLANKER_ATTENTION/translator.ts, lib/interactive/TMB_FLANKER_ATTENTION/fragment.html, lib/interactive/TMB_FLANKER_ATTENTION/render.d.ts
Defines the INTERACTIVE instrument with staticAssets, computed measures, and a Zod validationSchema for per-trial results and aggregated outcomes. Exports EN/FR translator. Adds stimulus/button HTML markup and the render type declaration.
Render logic and styles
lib/interactive/TMB_FLANKER_ATTENTION/render.js, lib/interactive/TMB_FLANKER_ATTENTION/styles.css
Implements render(done) with onreadyUI response handling, nextTrial frame progression, setFrameSequence randomized trial plan, and startup IIFE. Adds full stylesheet covering layout, stimulus, response buttons, highlight states, and blink animation.

French Localization – Verbal PA Study/Test and LN Switching

Layer / File(s) Summary
TMB_VERBAL_PA_STUDY: FR data, translator, render
lib/interactive/TMB_VERBAL_PA_STUDY/translator.ts, lib/interactive/TMB_VERBAL_PA_STUDY/index.ts, lib/interactive/TMB_VERBAL_PA_STUDY/render.js
New translator with EN/FR strings. Index adds easyFr/hardFr/defaultInputFr datasets, _fr.txt staticAssets, language: ['en','fr'], localized metadata, and fullscreen/lock flags. Render initializes translator, uses tFormat, localizes all UI text, and loads _fr.txt when French.
TMB_VERBAL_PA_TEST: FR data, translator, render
lib/interactive/TMB_VERBAL_PA_TEST/translator.ts, lib/interactive/TMB_VERBAL_PA_TEST/index.ts, lib/interactive/TMB_VERBAL_PA_TEST/render.js
New translator with EN/FR strings. Index adds French datasets, staticAssets, bilingual config. Render localizes alerts, counters, frame messages, practice stimuli, and rewrites input filename to _fr.txt on startup when French.
TMB_LN_SWITCHING: localized image assets
lib/interactive/TMB_LN_SWITCHING/index.ts, lib/interactive/TMB_LN_SWITCHING/render.js
Index replaces generic image imports with _en/_fr variants and rewrites staticAssets paths. Render computes imgLang from resolvedLanguage and uses it in begin-frame HTML, instruction image URLs, and the preload list.

Fullscreen / language-lock flags + dependency bump

Layer / File(s) Summary
Config flag additions and dependency update
lib/interactive/TMB_DIGIT_SYMBOL_MATCHING/index.ts, lib/interactive/TMB_EMOTION_RECOGNITION/index.ts, lib/interactive/TMB_MATRIX_REASONING/index.ts, lib/interactive/TMB_MOT/index.ts, lib/interactive/TMB_SIMPLE_RT/index.ts, lib/interactive/TMB_VISUAL_PA_STUDY/index.ts, lib/interactive/TMB_VISUAL_PA_TEST/index.ts, package.json
Adds defaultFullscreen: true (and enableLanguageLock: true where applicable) to seven existing instruments. Bumps @opendatacapture/runtime-v1, instrument-guidelines, and serve-instrument to ^2.0.0.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • DouglasNeuroInformatics/ODC_Instruments#1: Introduces the same TestHelper.v1.Oct23.js globals (debounce, tmbUI.getInput, showAlert, setBodyScale) for TMB_MATRIX_REASONING, making it the direct predecessor of the Flanker helper file added here.
  • DouglasNeuroInformatics/ODC_Instruments#28: Updated the runtime spec to introduce/clarify defaultFullscreen for INTERACTIVE content, which is the flag being applied to all instruments in this PR.

Poem

🎯 Flankers left and right, arrows in a row,
The French strings arrive — bonjour, let's go!
defaultFullscreen: true for every brain task,
RT and dwell time, no need to ask.
tmbUI.getInput listens, debounced and tight —
Attention, mémoire, all rendered right. 🧠

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch TMB

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant