Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion shell/plugins/agents/Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,8 @@ Panel {
visible: !section.multi && root.otherTrouble(section.provider) !== ""
width: parent.width
textFormat: Text.PlainText
text: section.provider ? String(section.provider.authHelpText || "") : ""
// Shown for the status, so a record with no help to offer says the status rather than nothing.
text: section.provider ? String(section.provider.authHelpText || section.provider.usageStatusText || "") : ""
color: root.urgent
font.family: root.fontFamily
font.pixelSize: Style.font.caption
Expand Down
1 change: 1 addition & 0 deletions test/shell.d/agents-panel-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ assert(/opacity: stale \? 0\.5 : 1\.0/.test(panelSource) && /"As of " \+ root\.f
assert(/onPickingChanged: resetKeys\(\)/.test(panelSource), 'the cursor starts over when the agent list comes or goes')
assert(!/t === "a" \|\| t === "A"/.test(panelSource), 'adding an account has no hotkey; the + is the way in')
assert(/if \(!accounts\[a\]\.active\) \{/.test(panelSource) && /if \(row\.length > 0\) rows\.push\(row\)/.test(panelSource), 'the active account with nothing to fix is not a keyboard stop')
assert(/text: section\.provider \? String\(section\.provider\.authHelpText \|\| section\.provider\.usageStatusText \|\| ""\) : ""/.test(panelSource), 'the trouble line falls back to the usage status when a record has no auth help')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Status-only case remains untested This assertion checks that the fallback expression appears in the QML source, but it does not check what the card displays for a provider with a status and no auth help. It would still pass if a later change to the separate visibility condition made the card blank again. A test of that visible card and its text would protect against the reported regression.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

const mainSource = fs.readFileSync(root + '/shell/plugins/agents/Main.qml', 'utf8')
assert(/var from = Math\.min\(0\.8, \(threshold - 15\) \/ 100\)/.test(mainSource), 'faster checks start 15 points below the switch threshold')
JS