Question menu settings show the old value for 400 ms, and a quick change back is lost
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 64/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript, typescript
- 領域
- frontend
研究方向
Start in src/composables/useQuestion.ts at onExtraSettingsChange() and the debounced saveExtraSettings() (INPUT_DEBOUNCE_MS, 400 ms), then look at the menu controls that bind to props.extraSettings (the rating "Highest rating" select and the linear scale's lowest/highest selects). Reproduce on a form with a rating or linear scale question: pick a new value and watch the control lag, then pick the saved value back within 400 ms. Done when the control reflects the pick immediately and the last pick wins; verify by hand in the editor, since no test is named.
由索引模型根據 Issue 內容生成。
描述
Please use the 👍 reaction to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!
Describe the bug
Settings in a question's menu that are saved as extra settings go through onExtraSettingsChange() in src/composables/useQuestion.ts, which batches them and saves them through a debounced saveExtraSettings() (INPUT_DEBOUNCE_MS, 400 ms). Until that save runs, props.extraSettings still holds the saved value, and the controls are bound to it. This has two effects:
- A select such as "Highest rating" (or the lowest/highest value of a linear scale) keeps showing the old value for up to 400 ms after a new one is picked.
- Picking the saved value again within those 400 ms is lost: the control's model value already equals the saved value, so no change is emitted, and the pending other value is saved instead.
To Reproduce
Steps to reproduce the behavior:
- Edit a form with a rating question (#3637) or a linear scale.
- Open the question's menu and pick another value in the "Highest rating" select, e.g. 7 instead of 10.
- Watch the select: it shows 10 at about 300 ms and 7 at about 600 ms.
- Pick a value, then pick the previously saved value again within 400 ms: the first pick is saved.
Expected behavior
The control shows the picked value at once, and the last pick is the one saved, however quickly the user changes it.
A possible fix: keep the pending extra settings in a reactive local state that the controls read (saved value merged with pending changes), or flush the pending save before a control that shows the saved value is updated. The fix belongs in useQuestion, as all question types that save extra settings from their menu share this path.
Screenshots
N/A
Nextcloud (please complete the following information):
- Nextcloud-Version: 36 (dev)
- Forms-Version:
main(5.5 development) with #3637
Desktop (please complete the following information):
- OS: Windows 11
- Browser: Microsoft Edge (Chromium)
- Version: current
Smartphone (please complete the following information):
N/A
Browser log
No errors are logged; the behaviour follows from the debounce.
Additional context
Found in the review of #3637 (rating question). Validated and reproduced on a live Nextcloud 36 instance with the rating question of #3637: the select timing was measured, and the lost second pick was reproduced for the icon choice before #3637 switched it to @change. The "Highest rating" select is left as is in #3637, as the fix belongs in useQuestion. The linear scale's lowest and highest value selects use the same code path; they were not reproduced separately.
Assisted by Claude Code:claude-opus-5-5
- 主要語言
- JavaScript
- 星號
- 385
- 分支
- 133
- 平均合併
- 7 小時 54 分鐘
- 30 天內合併 PR
- 157
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
nextcloud/forms 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
1. to develop enhancement
難度 5/5 一週以上 新手友好度 35/100
nextcloud/forms#3841 · 1 個 reaction ·
維護者通常 1 天內回覆
-
0. Needs triage bug
難度 3/5 1-2 天 新手友好度 45/100
nextcloud/forms#3831 · 1 則留言 ·
維護者通常 1 天內回覆
-
1. to develop enhancement
難度 4/5 3-5 天 新手友好度 22/100
nextcloud/forms#3829 · 1 則留言 ·
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
cytoscape/cytoscape.js#3597 ·
維護者通常 5 天內回覆
-
priority: low server testing
難度 1/5 1 小時以內 新手友好度 88/100
blamechris/chroxy#9277 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 72/100
sunososobro-hub/cloudball#191 ·
維護者通常 1 天內回覆
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)未關閉
難度 2/5 1-3 小時 新手友好度 62/100
microsoft/playwright#44289 ·
維護者通常 1 天內回覆
-
area:post effort:low enhancement P7 source:agent
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆