Selecting a language inside an instrument preview switches the app language and closes the preview on Manage Group

オープン
#1,946 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
react, tailwindcss, typescript
領域
frontend, web-dev

調査の方向性

Start in apps/web/src/components/InstrumentPreviewDialog/InstrumentPreviewDialog.tsx around lines 93-99, where InstrumentRenderer gets no language prop, then follow useInstrumentLanguage to see how changeContentLanguage binds to the global changeLanguage. Next, check useInstrumentInfoQuery and the queryKey in apps/web/src/routes/_app/group/manage.tsx (lines 854-870 and 976-987) to see why refetching unmounts ManageGroupForm. Done means preview language changes stay local and the dialog stays open while the query refetches.

索引モデルが issue の本文から書いたものです。

説明

Area: Web Bug Difficulty: Low Priority: Low

InstrumentPreviewDialog (apps/web/src/components/InstrumentPreviewDialog/InstrumentPreviewDialog.tsx:93-99) renders InstrumentRenderer with no language prop. useInstrumentLanguage(undefined) therefore binds changeContentLanguage to libui's global changeLanguage, so switching languages from inside a previewed interactive instrument (its "Select Language" screen, its toolbar language toggle, or a changeLanguage event from the iframe) switches the whole web app's interface language.

On /group/manage (apps/web/src/routes/_app/group/manage.tsx:854-870, 976-987), useInstrumentInfoQuery includes resolvedLanguage in its queryKey. Switching to an uncached language sets instrumentInfoQuery.data to undefined while refetching, which makes data null and causes WithFallback to unmount ManageGroupForm (where previewItem state lives), closing the open InstrumentPreviewDialog immediately.

Reproduce

  1. Open /group/manage in English.
  2. Click the preview icon on a bilingual interactive instrument (or a series containing one) with enableLanguageSelect: true or enableLanguageToggle: true, click Preview Form, and click Begin.
  3. Pick Français on the "Select Language" screen (or from the toolbar language toggle).

Actual: the entire web interface switches to French and the preview dialog unmounts and closes while useInstrumentInfoQuery refetches for fr.
Expected: the preview stays open (and language switches inside a preview stay local to the preview, or ManageGroupForm keeps previous instrumentInfoQuery data while refetching).

主要言語
TypeScript
スター
119
フォーク
19
平均マージ
1日 18時間
マージ済み PR(30日)
60

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DouglasNeuroInformatics/OpenDataCapture のほかの issue

DouglasNeuroInformatics/OpenDataCapture の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。