Skip to content

fix(hub-ui): dont throw on browser autocomplete - #471

Merged
antfu merged 2 commits into
devframes:mainfrom
OrbisK:fix/chrome-autocomplete
Oct 30, 2026
Merged

antfu merged 2 commits into
devframes:mainfrom
OrbisK:fix/chrome-autocomplete

Conversation

@OrbisK

@OrbisK OrbisK commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

For some reason chrome default autocomplete emits the key as undefined not ''.

We had a releated issue at vueuse: vueuse/vueuse#5225

The current implementation throws an runtime error when using autocomplete on the page.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 12:56
@vercel

vercel Bot commented Oct 30, 2026

Copy link
Copy Markdown

@OrbisK is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/471?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-10-30 12:57 UTC
🔗 head 0b1a609
🤖 automated by pulls.review

{
  "headSha": "0b1a6099e90fa7c73ceb7d78c216ecc37cc024d3",
  "result": {
    "overallSummary": "Fixes a runtime error triggered by Chrome's native autocomplete/autofill, which dispatches keydown events with `key` set to `undefined` instead of an empty string, crashing `normalizeKeyEvent`. Adds a defensive fallback and corresponding unit tests.",
    "groups": [
      {
        "key": "fix",
        "label": "Fix autocomplete crash",
        "summary": "Guards against `undefined` `key` values that Chrome's native autofill dispatches on keydown events, which previously caused a runtime error in `normalizeKeyEvent`.",
        "category": "core",
        "filePaths": [
          "packages/hub-ui/src/client/state/keybindings.ts"
        ],
        "lineNotes": [
          {
            "path": "packages/hub-ui/src/client/state/keybindings.ts",
            "side": "additions",
            "line": 33,
            "text": "Falls back to empty string when `e.key` is `undefined`, matching the related vueuse fix.",
            "critical": true
          }
        ]
      },
      {
        "key": "tests",
        "label": "Tests for normalizeKeyEvent",
        "summary": "Adds unit tests covering the autofill edge case (missing `key`) and a regular shortcut normalization case.",
        "category": "tests",
        "filePaths": [
          "packages/hub-ui/src/client/state/keybindings.test.ts"
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-10-30T12:57:10.173Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

@antfu
antfu merged commit 62cd51e into devframes:main Oct 30, 2026
2 of 3 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.

3 participants