Skip to content

fix: remove wordWrap on passkey prompt label to keep single line on greeter - #77

Draft
MyLeeJiEun wants to merge 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fix/passkey-wordwrap
Draft

fix: remove wordWrap on passkey prompt label to keep single line on greeter#77
MyLeeJiEun wants to merge 1 commit into
linuxdeepin:masterfrom
MyLeeJiEun:fix/passkey-wordwrap

Conversation

@MyLeeJiEun

@MyLeeJiEun MyLeeJiEun commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

背景

登录界面(greeter)的安全密钥 FIDO 认证提示文案跨两行显示,而锁屏界面同样场景下一行展示正常。

关联 PMS bug:https://pms.uniontech.com/bug-view-370733.html

根因

greeter 在 src/app/lightdm-deepin-greeter.cpp 中显式把应用字体设为 10.5pt(为修复 bug 161915),而 AuthPasskeym_textLabel 没有显式绑定字号、直接继承应用字体。initUI()m_textLabel->setWordWrap(true)m_stretchLayout->addWidget(m_textLabel, 0)(stretch 0)组合,使标签上报一个很小的 sizeHint 宽度,导致外层 SFAWidget 居中列收缩到很窄,标签被分配到约 100px 固定宽度;一旦文案自然宽度(随字号增大)超过该宽度就换行成两行。

改动

src/session-widgets/auth_passkey.cpp::initUI() 删除一行 m_textLabel->setWordWrap(true);,与兄弟控件 auth_fingerprint.cpp(不设 wordWrap、greeter/锁屏均正常单行)的写法对齐。

@@ -37,7 +37,6 @@ void AuthPasskey::initUI()

     /* 文案提示 */
     m_textLabel->setText(tr("Please plug in the security key"));
-    m_textLabel->setWordWrap(true);

     /* 旋转提示和文案提示布局 */

删除 wordWrap 后,标签 sizeHint 即文案自然宽度,打破「小 sizeHint → 外层列收缩 → 标签被挤 → 换行」的反馈链,FIDO 短提示可稳定单行展示。spinner 与两侧 addStretch(1) 的居中布局保持不变。

注意事项

  • 不改动 greeter 的 10.5pt 字体设置(那是修复 bug 161915 的有意设置)。
  • 仅改 dde-session-shell,未动 dde-session-shell-snipe。
  • 四条提示文案(请插入安全密钥 / 正在识别安全密钥 / 验证成功 / 验证失败)均走同一个 m_textLabel,行为一致。

验证

建议在 greeter(10.5pt 字体)与锁屏两种场景下分别切到安全密钥认证界面,确认上述文案单行展示且无截断。

Summary by Sourcery

Prevent passkey prompt labels from wrapping so security-key authentication messages remain readable on one line.

Bug Fixes:

  • Keep passkey authentication prompt text on a single line in the greeter and lock-screen flows.

Chores:

  • Update the copyright year in the passkey authentication widget source file.

@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.

@sourcery-ai

sourcery-ai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adjusts the AuthPasskey prompt label so that the FIDO security key text consistently renders on a single line in the greeter, aligning its behavior with the fingerprint auth widget by removing word wrapping from the label.

Flow diagram for AuthPasskey label layout behavior before and after wordWrap removal

flowchart TD
    A[AuthPasskey::initUI sets m_textLabel text] --> B{m_textLabel wordWrap enabled?}
    B -- Yes (before PR) --> C[m_textLabel setWordWrap true]
    C --> D[m_textLabel reports small sizeHint width]
    D --> E[SFAWidget column shrinks to narrow width]
    E --> F[FIDO prompt wraps to two lines on greeter]

    B -- No (after PR) --> G[m_textLabel uses natural text width in sizeHint]
    G --> H[SFAWidget column keeps adequate width]
    H --> I[FIDO prompt renders as single line on greeter]
Loading

File-Level Changes

Change Details Files
Disable word wrapping on the AuthPasskey prompt label so its sizeHint matches the natural text width and avoids forced line breaks in the greeter.
  • Remove the explicit word-wrap setting on the passkey prompt text label in AuthPasskey::initUI so the label reports a wider sizeHint and is not constrained to a narrow fixed width.
  • Keep the existing layout structure (spinner plus stretches) intact so only the label’s wrapping behavior changes, matching the behavior of the fingerprint auth widget.
  • Ensure all AuthPasskey status messages (plug in key, recognizing, success, failure) share the same non-wrapping label behavior across greeter and lockscreen.
src/session-widgets/auth_passkey.cpp

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

…reeter

FIDO 认证提示文案在 greeter(10.5pt 字体)下因 `m_textLabel->setWordWrap(true)` + stretch 0 导致 sizeHint 过小、外层列收缩、短文案被挤换行。删除 wordWrap 使标签按自然宽度布局,与 auth_fingerprint 写法对齐,FIDO 提示文案稳定单行展示。同时更新文件头版权年份至 2026。关联 PMS bug 370733。

Log: 修复登录界面安全密钥 FIDO 认证提示文案跨两行显示
Bug: https://pms.uniontech.com/bug-view-370733.html
@MyLeeJiEun
MyLeeJiEun force-pushed the fix/passkey-wordwrap branch from 9369d31 to d51d20d Compare August 25, 2026 12:36
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