Skip to content

fix: resolve shortcut conflict UI state#3207

Open
MyLeeJiEun wants to merge 1 commit intolinuxdeepin:masterfrom
MyLeeJiEun:fork-0430-fix-shortcuts-issue-2
Open

fix: resolve shortcut conflict UI state#3207
MyLeeJiEun wants to merge 1 commit intolinuxdeepin:masterfrom
MyLeeJiEun:fork-0430-fix-shortcuts-issue-2

Conversation

@MyLeeJiEun
Copy link
Copy Markdown

@MyLeeJiEun MyLeeJiEun commented Apr 30, 2026

  1. Fixed shortcut conflict resolution by updating UI state after replacing conflicting keys
  2. Added logic to hide conflict warning text and reset edit state when conflict is resolved
  3. Ensured edit.keys is properly formatted after conflict resolution using dccData.formatKeys
  4. Cleaned up trailing whitespace in ToolTip section for code consistency

Log: Fixed shortcut conflict resolution UI state and warning display

PMS: BUG-359143

Influence:

  1. Test shortcut conflict detection and resolution workflow
  2. Verify conflict warning message appears and disappears correctly
  3. Test editing shortcuts when conflicts exist
  4. Verify edit state resets properly after conflict resolution
  5. Test that formatted keys display correctly after conflict resolution
  6. Verify tooltip behavior with long shortcut names

fix: 修复快捷键冲突的UI状态

  1. 通过替换冲突键后更新UI状态来修复快捷键冲突解决
  2. 添加逻辑以在解决冲突时隐藏冲突警告文本并重置编辑状态
  3. 确保使用dccData.formatKeys在冲突解决后正确格式化edit.keys
  4. 清理工具提示部分的尾随空白以保持代码一致性

Log: 修复快捷键冲突解决UI状态和警告显示

PMS: BUG-359143

Influence:

  1. 测试快捷键冲突检测和解决工作流程
  2. 验证冲突警告消息正确显示和消失
  3. 测试存在冲突时编辑快捷键的功能
  4. 验证冲突解决后编辑状态正确重置
  5. 测试冲突解决后格式化键的正确显示
  6. 验证长快捷键名称的工具提示行为

Summary by Sourcery

Update shortcut conflict resolution to correctly refresh UI state and warning visibility after applying replacement shortcuts.

Bug Fixes:

  • Ensure shortcut conflict resolution updates the edited shortcut keys, hides the conflict warning, and clears edit state after applying conflicting accelerators.

Enhancements:

  • Normalize formatted shortcut keys using dccData.formatKeys when resolving conflicts for consistent key display.

1. Fixed shortcut conflict resolution by updating UI state after
replacing conflicting keys
2. Added logic to hide conflict warning text and reset edit state when
conflict is resolved
3. Ensured edit.keys is properly formatted after conflict resolution
using dccData.formatKeys
4. Cleaned up trailing whitespace in ToolTip section for code
consistency

Log: Fixed shortcut conflict resolution UI state and warning display

PMS: BUG-359143

Influence:
1. Test shortcut conflict detection and resolution workflow
2. Verify conflict warning message appears and disappears correctly
3. Test editing shortcuts when conflicts exist
4. Verify edit state resets properly after conflict resolution
5. Test that formatted keys display correctly after conflict resolution
6. Verify tooltip behavior with long shortcut names

fix: 修复快捷键冲突的UI状态

1. 通过替换冲突键后更新UI状态来修复快捷键冲突解决
2. 添加逻辑以在解决冲突时隐藏冲突警告文本并重置编辑状态
3. 确保使用dccData.formatKeys在冲突解决后正确格式化edit.keys
4. 清理工具提示部分的尾随空白以保持代码一致性

Log: 修复快捷键冲突解决UI状态和警告显示

PMS: BUG-359143

Influence:
1. 测试快捷键冲突检测和解决工作流程
2. 验证冲突警告消息正确显示和消失
3. 测试存在冲突时编辑快捷键的功能
4. 验证冲突解决后编辑状态正确重置
5. 测试冲突解决后格式化键的正确显示
6. 验证长快捷键名称的工具提示行为
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MyLeeJiEun

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link
Copy Markdown

Hi @MyLeeJiEun. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@github-actions
Copy link
Copy Markdown

CLA Assistant Lite bot:
提交邮箱中包含我们的合作伙伴,但您似乎并非合作伙伴的成员或对接人,请联系相关对接人将您添加至组织之中,或由其重新发起 Pull Request。
The commit email domain belongs to one of our partners, but it seems you are not yet a member of the current organization, please contact the contact person to add you to the organization or let them submit the Pull Request.

zhaofangxun seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 30, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates shortcut conflict resolution behavior in the Shortcuts QML so that UI state, formatted keys, and warning visibility are correctly refreshed after conflicts are resolved, along with minor tooltip whitespace cleanup.

Sequence diagram for resolving a shortcut conflict and updating UI state

sequenceDiagram
    actor User
    participant MouseArea
    participant edit
    participant dccData
    participant shortcutSettingsBody
    participant conflictText
    participant shortcutView

    User->>MouseArea: click conflict resolution button
    MouseArea->>shortcutSettingsBody: read conflictAccels
    MouseArea->>edit: modifyShortcut(newAccels)
    edit-->>MouseArea: shortcut updated
    MouseArea->>shortcutSettingsBody: set conflictAccels = ""
    MouseArea->>dccData: formatKeys(newAccels)
    dccData-->>MouseArea: formattedKeys
    MouseArea->>edit: set keys = formattedKeys
    MouseArea->>conflictText: set visible = false
    MouseArea->>shortcutView: set editItem = null
    MouseArea->>shortcutView: set conflictText = null
Loading

File-Level Changes

Change Details Files
Correct shortcut conflict resolution flow to update edit state, formatted keys, and conflict warning visibility after replacing conflicting accelerators.
  • Use a local variable to capture the current conflicting accelerators before modifying the shortcut.
  • Call edit.modifyShortcut with the captured accelerators and then clear the conflictAccels state.
  • Recompute edit.keys using dccData.formatKeys so the edited shortcut displays correctly after resolution.
  • Hide the conflict warning text once the conflict has been resolved by setting its visibility to false.
  • Reset shortcutView edit-related references (editItem and conflictText) to null to exit edit mode cleanly.
src/plugin-keyboard/qml/Shortcuts.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new onClicked handler is indented more deeply than surrounding code; aligning its indentation with nearby QML blocks would keep the file’s structure consistent and easier to read.
  • When setting conflictText.visible and clearing shortcutView.editItem/shortcutView.conflictText, consider guarding against these references being undefined or null to avoid runtime errors if the UI structure changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new onClicked handler is indented more deeply than surrounding code; aligning its indentation with nearby QML blocks would keep the file’s structure consistent and easier to read.
- When setting conflictText.visible and clearing shortcutView.editItem/shortcutView.conflictText, consider guarding against these references being undefined or null to avoid runtime errors if the UI structure changes.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants