Skip to content

Fix the sidebar's link-card hover, doubled key title and people count - #858

Merged
alexeyzimarev merged 2 commits into
mainfrom
fix/sidebar-card-hover-key-title-who-count
Sep 10, 2026
Merged

Fix the sidebar's link-card hover, doubled key title and people count#858
alexeyzimarev merged 2 commits into
mainfrom
fix/sidebar-card-hover-key-title-who-count

Conversation

@alexeyzimarev

Copy link
Copy Markdown
Member

Closes #857 — AI-2683

What & why

Three sidebar defects on a key-only work item. The link card's wrapper button left Fluent's hover chrome in place, so hovering painted a square-cornered fill behind the rounded card; the wrapper now paints nothing and the card's border carries the hover cue. The server serves the key as the title for an item with no tracker or generated title, so the card printed the key twice; a title equal to the key is dropped, and an untitled issue or pull-request link shows its key alone under its eyebrow. The "Who's on it" header counted sessions while the section lists people; it now reads people first, then sessions.

Where to look

WhoCountText replaces SessionCountText. With nobody listed the requester row stands in and the session count alone is shown, as before.

Verification

  • dotnet run --project test/Capacitor.App.Tests.Unit/Capacitor.App.Tests.Unit.csproj: 1641 passed, 0 failed.
  • New WorkContextViewSmokeTests hosts the pane headlessly, hovers the issue card, checks the hover registered, and asserts the presenter paints nothing and the card border carries the cue. Every new assertion was watched failing before its fix.
  • dotnet build src/Capacitor.App/Capacitor.App.csproj --no-incremental: 0 warnings.
  • The "2 sessions" case is real data: the analytics views show two attached sessions on AI-2681, both the same owner.

…#857)

Fluent paints a button's hover fill on its presenter at the button's own radius, so the
card wrapper paints nothing in any state and the card's border carries the hover cue.
The server serves the key as the title for an item with no tracker or generated title.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T14:14:05.746722Z fed8b7c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix sidebar card hover, duplicate titles, and people count

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Removes Fluent wrapper hover chrome and moves link-card feedback to rounded borders.
• Suppresses duplicate key-derived titles and hides empty work-item or link titles.
• Reports people before sessions in “Who’s on it,” with unit and headless coverage.
Diagram

graph TD
  Read["Work Context Read"] --> VM["ViewModel Projections"] --> View["Sidebar View"] --> Cards["Rendered Cards"]
  VM --> Count["Who Count"] --> View
  Tests["Unit and Smoke Tests"] -. validates .-> VM
  Tests -. renders .-> View
Loading
High-Level Assessment

The current approach is appropriate: normalize server fallback titles in the view model, keep visual-state handling in AXAML, and verify both projection and rendered behavior. Handling duplicate titles solely with view converters was considered but would scatter domain fallback rules across presentation markup and weaken non-visual testing.

Files changed (5) +231 / -24

Bug fix (2) +40 / -15
WorkContextViewModel.Projections.csNormalize fallback titles and format people/session counts +21/-9

Normalize fallback titles and format people/session counts

• Drops work-item titles that duplicate the key and leaves untitled issue or pull-request links empty so their keys render alone. Replaces SessionCountText with WhoCountText, reporting contributor count before session count and raising notifications when either changes.

src/Capacitor.App/ViewModels/WorkContextViewModel.Projections.cs

WorkContextView.axamlCorrect card hover chrome and empty-title visibility +19/-6

Correct card hover chrome and empty-title visibility

• Prevents Fluent's button presenter from painting hover or pressed chrome outside rounded cards, using the card border as the hover cue instead. Hides empty work-item and link titles and binds the people section to WhoCountText.

src/Capacitor.App/Views/WorkContextView.axaml

Tests (3) +191 / -9
WorkContextViewModelTests.csCover title normalization and people-first count formatting +47/-8

Cover title normalization and people-first count formatting

• Adds projection tests for key-derived work-item titles, untitled issues and pull requests, and singular/plural people-session combinations. Updates existing expectations from SessionCountText to WhoCountText.

test/Capacitor.App.Tests.Unit/WorkContextViewModelTests.cs

WorkContextViewSmokeTests.csAdd headless sidebar rendering regression tests +143/-0

Add headless sidebar rendering regression tests

• Introduces a headless WorkContextView host for key-only item scenarios. Verifies single-key rendering, hidden empty titles, people-first counts, transparent button presenter chrome, matching corner radii, and card-border hover feedback.

test/Capacitor.App.Tests.Unit/WorkContextViewSmokeTests.cs

WorkspaceViewSmokeTests.csUpdate workspace binding lookup for WhoCountText +1/-1

Update workspace binding lookup for WhoCountText

• Updates the workspace smoke test's named-control checks to resolve WhoCountText after the sidebar count binding rename.

test/Capacitor.App.Tests.Unit/WorkspaceViewSmokeTests.cs

@qodo-code-review

qodo-code-review Bot commented Sep 10, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Smoke failures contaminate later tests ✓ Resolved 🐞 Bug ☼ Reliability
Description
A_key_only_item_and_an_untitled_issue_each_show_their_key_once and the other new smoke tests call
CloseAsync only after every assertion rather than from a finally block. When an assertion
throws, the shown window and view model remain alive in the process-global Avalonia session,
including subscriptions and timer or read work normally stopped by TeardownAsync.
Code

test/Capacitor.App.Tests.Unit/WorkContextViewSmokeTests.cs[98]

+            await host.CloseAsync();
Relevance

●●● Strong

Recent precedent accepts finally-based cleanup to prevent leaked test resources after assertion
failures.

PR-#540

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each new test shows a window and performs assertions before its sole cleanup call. CloseAsync
closes the window and invokes TeardownAsync, which disposes subscriptions, the timer, cancellation
sources, and outstanding reads; the test infrastructure documents that the Avalonia session and
scheduler are process-global.

test/Capacitor.App.Tests.Unit/WorkContextViewSmokeTests.cs[34-51]
test/Capacitor.App.Tests.Unit/WorkContextViewSmokeTests.cs[81-99]
test/Capacitor.App.Tests.Unit/WorkContextViewSmokeTests.cs[106-142]
src/Capacitor.App/ViewModels/WorkContextViewModel.cs[287-300]
test/Capacitor.App.Tests.Unit/AvaloniaSession.cs[12-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new smoke tests only close their host after all assertions succeed. A failed assertion therefore leaves the window and view model alive in the shared Avalonia test session.

## Fix Focus Areas
- test/Capacitor.App.Tests.Unit/WorkContextViewSmokeTests.cs[81-142]

## Recommended Fix
Wrap each test's host usage in `try`/`finally` and call `await host.CloseAsync()` from the `finally` block, or make the host asynchronously disposable and use `await using` so cleanup runs on every exit path.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Cross-repo context — repo relationships
  Explored: repo: kurrent-io/kcap-server (sha: df4c3b28)
Review mode: ⚖️ Balanced: This is a behavioral UI/view-model change spanning production logic, styling, data presentation, and smoke tests, with several independent edge cases but not enough broad logic density to warrant extended review.

Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display preferences

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread test/Capacitor.App.Tests.Unit/WorkContextViewSmokeTests.cs Outdated
A failed assertion otherwise leaves the shown window and its view model alive in the
shared headless session for the tests that follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@alexeyzimarev
alexeyzimarev merged commit b645056 into main Sep 10, 2026
7 checks passed
@alexeyzimarev
alexeyzimarev deleted the fix/sidebar-card-hover-key-title-who-count branch September 10, 2026 16:11
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.

Desktop sidebar: link-card hover corners, doubled key title, people vs session count

1 participant