Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

ux(button): show the label as a tooltip when QueryaButton truncates it

未關閉 適合新手
#1,689 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
78/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
dart, flutter

研究方向

從 querya_button.dart 中約第 375 行和第 513 行提到的標籤配置與 tooltip 邏輯開始。使用 LayoutBuilder 和 TextPainter 檢查單行文字是否超出標籤的可用寬度,同時保留明確指定的 tooltip,並略過純圖示按鈕。為遭截斷的標籤、能完整顯示的標籤,以及明確指定的 tooltip 新增或更新測試;只有遭截斷的標籤會以完整文字作為 tooltip 時,工作才算完成。

由索引模型根據 Issue 內容生成。

描述

enhancement ui

From a review of the component library, checked against dev.

Problem

QueryaButton draws its label with maxLines: 1 and TextOverflow.ellipsis (querya_button.dart, ~line 375). The tooltip is only shown when tooltip is set or the button is icon-only (~line 513). A label cut short by a narrow toolbar or a long translation therefore cannot be read by hovering.

Not this

Do not simply fall back to label as the tooltip: every button would then show "Save" over "Save" on hover.

Change
  • Show the label as the tooltip only when it is actually truncated: lay the text out with a TextPainter (maxLines: 1, the button's text style, the width the label gets) and check didExceedMaxLines, in a LayoutBuilder. An explicit tooltip still wins.
  • Check that a button which fits shows no tooltip, and that one which does not shows the full label.
Acceptance
  • Narrow QueryaButton with a long label shows the full label as a tooltip on hover.
  • A button that fits shows no tooltip of its own.
  • The extra layout pass is not paid by buttons with an explicit tooltip, or by icon-only buttons.
Considered in the same review and left out
  • AppToast keeps its overlay in statics (app_toast.dart: _entry, _overlay). The review wanted an AppToastScope for multi-window use; the app has one window (bitsdojo_window only restyles it), so there is no problem to solve today.
  • QueryaTabStrip announcing a tab change: each tab is a Semantics(button, selected) with its own Focus, and arrow keys move focus, so a screen reader reads the selected tab already. An extra SemanticsService.announce would read it twice.
主要語言
Dart
星號
23
分支
1
平均合併
31 分鐘
30 天內合併 PR
570

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

QueryaHub/Querya-Desktop 的其他 Issue

查看 QueryaHub/Querya-Desktop 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。