Skip to content

Conversation

@BLumia
Copy link
Member

@BLumia BLumia commented Jul 22, 2025

修正麦克风开启/关闭 OSD 提示的图标和文案不正确的问题

Summary by Sourcery

Fix the microphone OSD display by swapping the mute icons and updating labels from “Mute on/off” to “Microphone off/on” and synchronize translation files accordingly.

Bug Fixes:

  • Swap OSD icons and text for AudioMicMuteOn/AudioMicMuteOff to correctly reflect microphone off/on states

Enhancements:

  • Add "Microphone off"/"Microphone on" translations across all locales, remove obsolete "Mute on"/"Mute off" entries, and standardize TS file headers

修正麦克风开启/关闭 OSD 提示的图标和文案不正确的问题

PMS: BUG-323793 BUG-323797
Log:
@sourcery-ai
Copy link

sourcery-ai bot commented Jul 22, 2025

Reviewer's Guide

This PR corrects the microphone OSD by swapping icons and labels in QML and adding corresponding translation entries across all TS files, while standardizing TS file headers.

Class diagram for OSD ListElement changes (Mic ON/OFF)

classDiagram
    class AppletItem {
      ListElement[] osdElements
    }
    class ListElement {
      string type
      string iconName
      string text
    }
    AppletItem "1" *-- "*" ListElement
    %% Highlight the updated elements
    class AudioMicMuteOn {
      type = "AudioMicMuteOn"
      iconName = "osd_mic_off" %% changed from osd_mic_on
      text = "Microphone off" %% changed from "Mute on"
    }
    class AudioMicMuteOff {
      type = "AudioMicMuteOff"
      iconName = "osd_mic_on" %% changed from osd_mic_off
      text = "Microphone on" %% changed from "Mute off"
    }
    AppletItem -- AudioMicMuteOn
    AppletItem -- AudioMicMuteOff
Loading

File-Level Changes

Change Details Files
Updated OSD list entries for microphone state in QML
  • Swapped iconName for AudioMicMuteOn/Off elements
  • Replaced text labels from 'Mute on/off' to 'Microphone off/on'
panels/notification/osd/default/package/main.qml
Refreshed translation TS files with new microphone entries and standardized format
  • Removed obsolete 'Mute on/off' messages and added 'Microphone off/on' entries in each localization
  • Added XML encoding and DOCTYPE headers and enforced newline at EOF in TS files
panels/notification/osd/default/translations/org.deepin.ds.osd.default_*.ts

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

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 代码修改

    • main.qml文件中,AudioMicMuteOnAudioMicMuteOff的图标和文本进行了修改,从“Mute on”和“Mute off”变为了“Microphone off”和“Microphone on”。这可能是为了更准确地反映功能,但需要确认这一改动是否符合产品需求。
  2. 翻译文件

    • 在多个翻译文件中,Mute onMute off被替换为了Microphone offMicrophone on。这需要确保所有相关的翻译文件都已经更新,并且这些改动已经通过了语言团队的审核。
  3. 编码规范

    • 在所有翻译文件中,添加了encoding="utf-8"属性,这是一个好的实践,确保了文件能够正确处理非ASCII字符。
  4. 未完成翻译

    • 在多个翻译文件中,Microphone offMicrophone on的翻译标记为type="unfinished",这表明这些翻译尚未完成。需要确保这些翻译在发布前已经完成。
  5. 文件格式

    • org.deepin.ds.osd.default_zh_HK.tsorg.deepin.ds.osd.default_zh_TW.ts文件中,去掉了<!DOCTYPE TS><TS>标签之间的换行符,这可能是为了保持文件的一致性。但是,这可能会影响XML解析器的行为,需要确认这一改动不会引起问题。
  6. 代码质量

    • 没有发现明显的代码质量问题,但是建议在未来的提交中保持代码风格的一致性,例如缩进和空格的使用。
  7. 性能

    • 没有发现与性能相关的改动,但是建议定期进行性能测试,以确保应用运行流畅。
  8. 安全性

    • 没有发现与安全性相关的改动,但是建议定期进行安全审计,以确保应用的安全性。

总体来说,这次提交的改动是合理的,但是需要确保所有相关的翻译都已经完成,并且文件格式的一致性不会受到影响。同时,建议在未来的提交中保持代码风格的一致性,并定期进行性能和安全性测试。

Copy link

@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 @BLumia - I've reviewed your changes - here's some feedback:

  • Verify that the QML icon assets osd_mic_on and osd_mic_off exist in the assets folder and render correctly with the updated entries.
  • Consider renaming the QML type fields (currently AudioMicMuteOn/AudioMicMuteOff) to something like MicrophoneOff/MicrophoneOn to more clearly reflect the new semantics.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Verify that the QML icon assets `osd_mic_on` and `osd_mic_off` exist in the assets folder and render correctly with the updated entries.
- Consider renaming the QML `type` fields (currently `AudioMicMuteOn`/`AudioMicMuteOff`) to something like `MicrophoneOff`/`MicrophoneOn` to more clearly reflect the new semantics.

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

@BLumia: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
deepin-auto-translation 35edb7c link true /test deepin-auto-translation

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 025635e into linuxdeepin:master Jul 22, 2025
9 of 11 checks passed
@BLumia BLumia deleted the mic-osd branch July 22, 2025 12:17
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