Skip to content

fix: clicking the left and right keys no response in fullscreen.#543

Merged
BLumia merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-289091
Apr 28, 2025
Merged

fix: clicking the left and right keys no response in fullscreen.#543
BLumia merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-289091

Conversation

@wjyrich
Copy link
Copy Markdown
Contributor

@wjyrich wjyrich commented Apr 28, 2025

event added the key_right and key_left.

pms-bug-289091

Summary by Sourcery

Bug Fixes:

  • Enable Left and Right arrow keys to correctly set focus to the list view when in fullscreen.

event added the key_right and key_left.

pms-bug-289091
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

在提供的代码更改中,添加了对 Qt.Key_LeftQt.Key_Right 键的监听。这是一个好的改进,因为它增加了用户交互的灵活性。然而,为了确保代码的质量、性能和安全性,我建议进行以下检查和改进:

  1. 代码质量

    • 确保在 switch 语句中添加的 Qt.Key_LeftQt.Key_Right 情况处理逻辑是正确的,并且与现有的 Qt.Key_UpQt.Key_Down 键处理逻辑一致。
    • 检查 listviewPage.focus = true 是否适用于所有情况,特别是当用户按下 Qt.Key_LeftQt.Key_Right 键时,确保焦点移动到正确的元素。
  2. 代码性能

    • 如果 listviewPage.focus = true 操作非常耗时,考虑是否有优化的空间,比如使用更高效的数据结构或算法。
    • 确保没有不必要的重复计算或资源消耗。
  3. 代码安全性

    • 确保在处理键盘事件时,没有安全漏洞,比如跨站脚本攻击(XSS)或跨站请求伪造(CSRF)。
    • 如果 listviewPage 是从用户输入中动态生成的,确保对用户输入进行适当的验证和清理。
  4. 代码注释

    • switch 语句中添加注释,说明为什么需要处理 Qt.Key_LeftQt.Key_Right 键,以及它们的具体行为。
  5. 测试

    • 编写单元测试来验证 Qt.Key_LeftQt.Key_Right 键的按下是否正确地改变了焦点。
    • 确保所有相关的功能测试都覆盖了这些新增的键盘事件处理。

通过这些改进,可以确保代码不仅功能正确,而且具有良好的性能和安全性。

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 28, 2025

Reviewer's Guide by Sourcery

This pull request fixes a bug where the left and right arrow keys did not respond in fullscreen mode. The implementation adds handlers for the left and right arrow key events within the InputEventItem in FullscreenFrame.qml to ensure the listviewPage gains focus when these keys are pressed.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added handling for the left and right arrow keys in fullscreen mode.
  • Added cases for Qt.Key_Left and Qt.Key_Right to the key event handling switch statement.
  • Ensured that pressing the left or right arrow key sets focus to the list view page when in fullscreen mode.
qml/FullscreenFrame.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 @wjyrich - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, wjyrich

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

@BLumia BLumia merged commit 08bbc80 into linuxdeepin:master Apr 28, 2025
9 of 10 checks passed
@wjyrich wjyrich deleted the fix-bug-289091 branch June 6, 2025 00:36
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