Skip to content

feat: 移除「猫咪设置 > 模型设置 > 单键模式」配置项#909

Merged
ayangweb merged 1 commit into
masterfrom
remove-single-key
Apr 14, 2026
Merged

feat: 移除「猫咪设置 > 模型设置 > 单键模式」配置项#909
ayangweb merged 1 commit into
masterfrom
remove-single-key

Conversation

@ayangweb
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the “猫咪设置 > 模型设置 > 单键模式” preference and related i18n entries, and updates key-press handling to no longer rely on that setting.

Changes:

  • Remove model.single from the Cat store state and drop the deprecated singleMode migration field.
  • Remove the “Single Key Mode” toggle from the preferences UI and delete the corresponding translation strings.
  • Update useModel.handlePress to release the previous key within the same key-group without checking a single flag.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/stores/cat.ts Removes the single config and deprecated singleMode ref from the cat store model settings.
src/pages/preference/components/cat/index.vue Removes the “Single Key Mode” switch from the preferences panel.
src/locales/zh-TW.json Deletes singleMode label/hint entries.
src/locales/zh-CN.json Deletes singleMode label/hint entries.
src/locales/vi-VN.json Deletes singleMode label/hint entries.
src/locales/pt-BR.json Deletes singleMode label/hint entries.
src/locales/en-US.json Deletes singleMode label/hint entries.
src/composables/useModel.ts Makes single-key behavior unconditional by always releasing the previous key in the same group.
Comments suppressed due to low confidence (1)

src/composables/useModel.ts:154

  • handlePress now always releases any previously pressed key in the same left-keys/right-keys group, effectively forcing the old “Single Key Mode” behavior for all users. Previously this behavior was gated behind catStore.model.single (default false), so this is a user-facing default behavior change; please confirm this is intended. If the goal is only to remove the UI/config entry while keeping the previous default behavior, the release-on-press logic should be removed (or reintroduced behind a new, explicit setting). If it is intended to be always-on, consider updating the PR title/description or release notes to reflect the behavior change.
  const handlePress = (key: string) => {
    const path = modelStore.supportKeys[key]

    if (!path) return

    const dirName = nth(path.split(sep()), -2)!
    const prevKey = findKey(modelStore.pressedKeys, (value) => {
      return value.includes(dirName)
    })

    if (prevKey) {
      handleRelease(prevKey)
    }

    modelStore.pressedKeys[key] = path
  }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ayangweb ayangweb merged commit 204797b into master Apr 14, 2026
4 checks passed
@ayangweb ayangweb deleted the remove-single-key branch April 14, 2026 12:22
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.

2 participants