Skip to content

fix(ui): [hidden] global defensive rule — inline-edit display no longer overrides hidden attr (v1.19.1) - #64

Merged
argszero merged 1 commit into
mainfrom
feat/fix-inline-edit-hidden
Aug 17, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/fix-inline-edit-hidden

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Bug fix — settings page "生成新 Key" (Generate New Key) inline form was visible on page load without clicking the button (rant 2026-08-17T21:36:27).

Root cause: .inline-edit { display: inline-flex; } (style.css) overrides the UA stylesheet's [hidden] { display: none } — the hidden attribute on #ak-new-inline lost to the author rule with higher specificity, so the form was always shown.

Fix: add a global defensive rule next to .hidden:

[hidden] { display: none !important; }
  • !important beats any author display rule regardless of specificity/order — the hidden attribute now always wins (covers future components too)
  • Only the hidden attribute path is affected; elements using the .hidden class (help panel, views, etc.) keep their existing behavior
  • Verified: other hidden-attribute elements (search-clear, inline-edit, share/topup/raise/dept cards) unaffected

Per rant: branch feat/fix-inline-edit-hidden, no version bump (v1.19.1).

Rant (verbatim)

Rant: BUG — 设置页「生成新 Key」表单未点击按钮就一直显示(宿主 2026-08-17 反馈)

现象

宿主反馈:设置页面,生成新 key 的表单应该在点击「生成新 Key」按钮后才出现。
实测:#ak-new-inline 带 hidden 属性,但页面加载时就一直显示。

根因

ui/css/style.css 第 137 行:.inline-edit { display: inline-flex; }
HTML hidden 属性依赖 UA 样式 [hidden] { display: none },但作者类样式的 display 优先级更高,
导致 hidden 属性失效 —— 表单始终 inline-flex 显示。

修复(ui/css/style.css)

  1. 在通用区(如 .hidden 规则附近)加全局防御规则:
    [hidden] { display: none !important; }
  2. 验证行为:
    • 页面加载 → 表单不可见;点击「生成新 Key」→ 表单出现且输入框聚焦;
    • 确认/取消/Esc → 表单收起;切换视图再回来 → 表单保持正确状态。

验收标准

  • 加载设置页表单不显示;点击按钮后出现;确认/取消/Esc 后收起
  • 其它用 hidden 的元素(搜索清空按钮、行内编辑、帮助面板、share/topup/raise/dept 卡片)不受影响
  • 无 JS 报错;分支 feat/fix-inline-edit-hidden,提交 PR 自 merge(可不升版本号,或标注 v1.19.1)

Related

  • Rant timestamp: 2026-08-17T21:36:27.606368 (project aitokenpool, status in_progress)
  • Branch: feat/fix-inline-edit-hidden (per rant)

Tests

  • Static smoke — 9/9 (root cause confirmed, [hidden] rule + !important, positioning near .hidden, HTML/JS wiring, no regression on other hidden elements)
  • Interaction smoke — 7/7 (initial hidden, open + focus, cancel/Esc/confirm close)
  • cargo test — 1 passed
  • cargo fmt --check

@argszero
argszero merged commit 4ea8bde into main Aug 17, 2026
1 check passed
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