Skip to content

Add component-level auto-advance timeout controls and warning configuration#1227

Merged
JackWilb merged 7 commits into
devfrom
copilot/add-timeout-options-component
May 21, 2026
Merged

Add component-level auto-advance timeout controls and warning configuration#1227
JackWilb merged 7 commits into
devfrom
copilot/add-timeout-options-component

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

This adds component-level timeout configuration to automatically advance participants to the next component without saving responses, while preserving completion timing and a timed-out marker in stored data. It also makes the warning lead time and warning copy configurable from study config, including base components.

  • Config surface

    • Added new BaseIndividualComponent fields in src/parser/types.ts:
      • nextButtonAutoAdvanceTime
      • nextButtonAutoAdvanceWarningTime
      • nextButtonAutoAdvanceWarningMessage
    • Updated generated study/library schemas so these fields validate in both direct components and baseComponents.
  • Participant flow

    • Extended NextButton timeout behavior to support automatic forward navigation via goToNextStep(false).
    • Added configurable warning timing and message rendering before auto-advance.
    • Warning messages support placeholders for countdown text:
      • {seconds} → remaining number
      • {unit}second / seconds
  • Data semantics

    • Ensured forced advance persists:
      • timedOut: true
      • component endTime
      • empty answer
    • Updated next-step/skip evaluation to use the cleared answer state so auto-advanced components do not participate as if they were answered.
  • Coverage

    • Added focused parser/runtime unit coverage for the new config and timed-out persistence path.
    • Added a dedicated Playwright study/test covering the warning UI and automatic advance flow.

Example config:

{
  "baseComponents": {
    "timedQuestion": {
      "type": "questionnaire",
      "response": [],
      "nextButtonAutoAdvanceTime": 2500,
      "nextButtonAutoAdvanceWarningTime": 1500,
      "nextButtonAutoAdvanceWarningMessage": "Advancing in {seconds} {unit} without saving this component."
    }
  }
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.ipify.org
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl de_modules/@esbuild/linux-x64/bin/esbuild committer.name .tsx (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl .tsx credential.helpebash (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl rgo/bin/bash user.name (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

🪓 PR closed, deleted preview.

Copilot AI changed the title [WIP] Add configuration options for component timeout settings Add component-level auto-advance timeout controls and warning configuration May 14, 2026
Copilot AI requested a review from JackWilb May 14, 2026 07:17
- Remove unnecessary useMemo calls for trivial config value reads
  in NextButton (nextButtonDisableTime, nextButtonEnableTime,
  nextOnEnter, previousButtonText)
- Remove unnecessary useMemo for modes.dataCollectionEnabled
  destructuring in useNextStep
- Fix consistent-return lint error by unconditionally returning
  cleanup function in nextOnEnter useEffect
- Fix prefer-destructuring lint warning in useNextStep
@JackWilb JackWilb marked this pull request as ready for review May 15, 2026 03:38
JackWilb added 2 commits May 14, 2026 22:11
- Use correct tab name 'Tests' instead of 'Test Studies'
- Activate the Tests tab before opening the study
- Handle custom studyEndMsg instead of relying on default message
- Simplify study card locator to avoid strict mode violation
@JackWilb JackWilb merged commit 26214e5 into dev May 21, 2026
7 checks passed
@JackWilb JackWilb deleted the copilot/add-timeout-options-component branch May 21, 2026 03:58
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.

Allow setting timeout to advance to next component and additional configuration options

2 participants