Skip to content

fix: restore Download button single-click (#1309)#1319

Open
echopi wants to merge 1 commit intoavwo:masterfrom
echopi:fix/download-button-1309
Open

fix: restore Download button single-click (#1309)#1319
echopi wants to merge 1 commit intoavwo:masterfrom
echopi:fix/download-button-1309

Conversation

@echopi
Copy link
Copy Markdown
Contributor

@echopi echopi commented Apr 6, 2026

Summary

  • Fixes 无法保存body到文件 #1309 — 单击 Download 按钮无法弹出文件名输入框
  • Dark mode 重构 (0ae2073) 意外删除了 className="w-download",导致 showNameInput 无法识别点击来源

Changes

  • biz/webui/htdocs/src/js/textarea.js: 恢复 className="w-download"
  • biz/webui/htdocs/src/js/json-viewer.js: 同上

Root cause

showNameInput 通过 /w-download/.test(e.target.className) 判断是否显示文件名输入框。没有这个 class,单击 Download 会错误地显示 Key 输入框而非文件名输入框。

Test plan

  • 单击 Download → 弹出文件名输入框(而非 Key 输入框)
  • 双击 Download → 直接下载(行为不变)

🤖 Generated with Claude Code

The dark mode refactoring (0ae2073) accidentally removed className="w-download"
from the Download <a> elements. The showNameInput handler checks this class to
decide whether to show the filename input dialog. Without it, single-click
download was broken (showed key input instead of filename input).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@echopi echopi force-pushed the fix/download-button-1309 branch from 5b3c160 to e9db448 Compare April 6, 2026 15:47
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.

无法保存body到文件

1 participant