feat: 移除「猫咪设置 > 模型设置 > 单键模式」配置项#909
Merged
Merged
Conversation
There was a problem hiding this comment.
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.singlefrom the Cat store state and drop the deprecatedsingleModemigration field. - Remove the “Single Key Mode” toggle from the preferences UI and delete the corresponding translation strings.
- Update
useModel.handlePressto release the previous key within the same key-group without checking asingleflag.
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
handlePressnow always releases any previously pressed key in the sameleft-keys/right-keysgroup, effectively forcing the old “Single Key Mode” behavior for all users. Previously this behavior was gated behindcatStore.model.single(defaultfalse), 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.