Skip to content

fix(settings): fix Tavily key label cursor and reunite the apply link - #3821

Merged
Astro-Han merged 1 commit into
apache:mainfrom
liuxiaocs7:fix/web-search-tavily-cursor-and-apply-link
Aug 26, 2026
Merged

fix(settings): fix Tavily key label cursor and reunite the apply link#3821
Astro-Han merged 1 commit into
apache:mainfrom
liuxiaocs7:fix/web-search-tavily-cursor-and-apply-link

Conversation

@liuxiaocs7

@liuxiaocs7 liuxiaocs7 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Two small UI papercuts in Settings → Web search's Tavily key field:

  • Misleading cursor. The key label ("Tavily 密钥" / "Tavily key") showed a hand (pointer) cursor on hover but forwards no click. Astryx FieldLabel renders an InputGroup label as a bare <span class="astryx-field-label"> (isGroupLabel), which carries StyleX cursor: pointer; native-cursor.css (the single owner of the "hand cursor is for links only" convention) only neutralized real <label> elements, so the span slipped through. Match the stable themeProps class (.astryx-field-label) so group-label spans get cursor: default like every other field label. This is app-wide by design — the same shared PasswordInput backs bot tokens, provider API keys, and the proxy password.
  • Apply URL split from its label. "申请地址:" / "Apply at:" rendered above the input as the field description, while the tavily.com link rendered on its own line below the input, so the key input split the label from its URL. Fold the link into the description as a ReactNode so "申请地址:tavily.com" reads as one unit above the input — a pattern Astryx FieldLabel supports (its click forwarding skips nested interactive content); only InputGroup/Field under-declare the description prop as string, papered over by one cast in PasswordInput.

Fixes #3820

Verification

  • tsc -p tsconfig.renderer.json --noEmit — passes
  • biome lint on the changed files — passes

Before / after (Tavily key field):

Before                               After
─────────────────────────────       ─────────────────────────────
Tavily 密钥        (hand cursor)     Tavily 密钥        (arrow cursor)
密钥只保存在本机。申请地址:           密钥只保存在本机。申请地址:tavily.com
┌───────────────────────────┐        ┌───────────────────────────┐
│ tvly-xxxxxxxx      👁 📋 │          │ tvly-xxxxxxxx      👁 📋 │
└───────────────────────────┘        └───────────────────────────┘
tavily.com   ← split below input

before

tavily-key-field-before

after
tavily-key-field-after

Review focus

The cursor fix in native-cursor.css is intentionally app-wide: it neutralizes the hand cursor on every InputGroup group-label span, not just this page.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code (Opus 4.8) — investigated the root cause, wrote the code changes, and drafted this PR. Reviewed by the author. The squash commit carries a Generated-by trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update on 4df006b: GO — no P0-P3. Fixes cursor on field label and groups Tavily apply link into description, hosted test green.

简体中文该头无阻断。

Two UI papercuts in Settings → Web search's Tavily key field:

- The key label ("Tavily 密钥") showed a hand cursor on hover but
  forwards no click. Astryx FieldLabel renders an InputGroup label as a
  bare <span class="astryx-field-label"> (isGroupLabel), which carries
  StyleX cursor:pointer; native-cursor.css only neutralized real <label>
  elements, so the span slipped through. Match the stable themeProps
  class so group-label spans get cursor:default like every other field
  label (app-wide — the same shared PasswordInput backs bot tokens,
  provider keys, and the proxy password).

- "申请地址:" rendered above the input as the field description while the
  tavily.com link rendered below it, so the key input split the label
  from its URL. Fold the link into the description as a ReactNode so
  "申请地址:tavily.com" reads as one unit above the input — a pattern
  Astryx FieldLabel supports (its click forwarding skips nested
  interactive content); only InputGroup/Field under-declare the prop as
  string, papered over by one cast in PasswordInput.

Generated-by: Claude Code (Opus 4.8)
@M4n5ter
M4n5ter force-pushed the fix/web-search-tavily-cursor-and-apply-link branch from 4df006b to 2310d75 Compare August 26, 2026 08:57

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving.

Both diagnoses check out against the installed Astryx. FieldLabel.js:120 is const LabelElement = isGroupLabel ? 'span' : 'label', which is exactly why the label selector missed it, and .astryx-field-label is a naming.ts externally-observable class — matching it is stable and consistent with the existing .astryx-lightbox / .astryx-empty-state rules in this repo.

The nested link is safer than your note suggests: forwardsDescriptionClick = !isGroupLabel && inputID != null, so an InputGroup description forwards no clicks at all. The "skips nested interactive content" path is not even reached here.

Two things worth pushing upstream so these become deletable rather than permanent:

  1. FieldLabel types description as ReactNode while InputGroup and Field type it as string. That inconsistency is what forces the cast here.
  2. A group label that forwards no click arguably should not carry cursor: pointer — fixing that removes the need for the CSS rule in every consumer, not just ours.

Astryx turns this kind of thing around quickly. Not blocking either way.

AI use: Claude Code assisted with source and issue investigation; the analysis and conclusions are my own.

简体中文

通过。

两处诊断对照已安装的 Astryx 都成立。FieldLabel.js:120const LabelElement = isGroupLabel ? 'span' : 'label',这正是 label 选择器漏掉它的原因;而 .astryx-field-labelnaming.ts 声明的对外可见类,匹配它是稳定的,也与本仓库既有的 .astryx-lightbox.astryx-empty-state 规则一致。

嵌套链接比你注释里说的更安全:forwardsDescriptionClick = !isGroupLabel && inputID != null,所以 InputGroup 的 description 根本不转发点击,「跳过嵌套交互内容」那条路径在这里都不会走到。

有两件事值得推到上游,让这些变通可以被删掉而不是长期留着:

  1. FieldLabeldescription 声明为 ReactNode,而 InputGroupField 声明为 string。正是这个不一致逼出了这里的类型断言。
  2. 一个不转发点击的 group label 本就不该带 cursor: pointer;上游修掉之后,每个使用方都不再需要这条 CSS 规则,而不只是我们。

Astryx 对这类改动接得很快。两条都不阻塞。

@Astro-Han
Astro-Han merged commit 4b6aadf into apache:main Aug 26, 2026
2 checks 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.

Web search settings: Tavily key label shows a hand cursor and the apply URL is split from its label

2 participants