Skip to content

fix(ui): keep a clicked row ringless after leaving and coming back to the window - #871

Merged
InstaZDLL merged 1 commit into
mainfrom
fix/866-focus-ring-after-refocus
Oct 16, 2026
Merged

InstaZDLL merged 1 commit into
mainfrom
fix/866-focus-ring-after-refocus

Conversation

@InstaZDLL

@InstaZDLL InstaZDLL commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #868, for #866. It was found by testing that fix on Windows.

The bug

Steps to reproduce:

  1. Click a row.
  2. Press a letter.
  3. Minimise the window (or switch away), then come back.

The row came back with its focus ring (and, in playlists, its inset ring too: a double green line).

Why:

  • When the window lost focus, the row fired focusout, which dropped its data-pointer-focus mark.
  • On return, the row fired focusin again. The last input was a key, so it was treated as keyboard focus and left unmarked.

Fix (src/lib/inputModality.ts)

  • focusout drops the mark only once focus has actually moved elsewhere in the page. It checks document.activeElement on the next tick: when the whole window loses focus, the element stays the active one.
  • focusin only clears a mark when focus moved here from another element (relatedTarget !== null). Focus that returns from outside the page keeps the mark it had. Pointer focus still marks, and keyboard navigation between elements still clears it.

Both cases were tested on Windows (WebView2): a letter or digit after a click or a double-click, then minimise and restore. No ring appears in either.

The same commit goes into the 1.9.2 backport (#870).

@coderabbitai review

Summary by CodeRabbit

  • Corrections
    • La distinction visuelle du focus après une interaction au pointeur est mieux conservée lors d’un retour sur la page.
    • Lors d’un changement de focus, cette distinction n’est retirée que lorsque l’élément n’est plus actif.

… the window

Minimising or leaving the window took focus from the clicked row, which dropped its pointer-focus mark; on return it took focus again, and with a key as the last input it came back unmarked and ringed. The mark is now dropped only once focus has moved elsewhere in the page, and focus that returns from outside the page keeps the mark it had.

Refs #866
@InstaZDLL InstaZDLL added scope: frontend React/Vite frontend (src/) type: fix Bug fix size: s 10-50 lines labels Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: InstaZDLL/WaveFlow/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 03c41283-115b-4482-8515-a53bc7588a08
📥 Commits

Reviewing files that changed from the base of the PR and between 18d12e2 and c148dcc.

📒 Files selected for processing: 1
  • src/lib/inputModality.ts

Limit details: You’ve used the included review currently available. Your 84 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

📝 Walkthrough

Le traitement de pointerFocus change lors de focusin et focusout. La marque est conservée dans certains retours de focus et sa suppression après focusout est différée.

Changes: Gestion de la marque de focus

Layer / File(s) Summary
Mise à jour de la marque de focus
src/lib/inputModality.ts
Après un focus clavier, la marque est supprimée si relatedTarget n’est pas nul. Après focusout, sa suppression est différée et s’effectue seulement si la cible n’est plus l’élément actif.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to c148d

Aucune régression concrète n’est établie dans la gestion de la marque de focus ; le risque de fusion est minimal.

### Architecture Summary

Architecture risk: 🔵 Low · up to c148d

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/lib/inputModality.ts: Lors d’un focus par pointeur, la cible est marquée. Lors d’un focus clavier provenant d’un autre élément, sa marque est supprimée ; si relatedTarget est nul, la marque existante est conservée.
  • observed — Modified behavior in src/lib/inputModality.ts: Le focusout ignore les cibles qui ne sont pas des éléments HTML. La suppression de la marque est différée et ne se produit que si la cible n’est plus l’élément actif ; auparavant, elle était immédiate pour toute cible HTML.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed Le titre respecte Conventional Commits. Il décrit clairement la correction principale : conserver l’absence d’anneau après le retour à la fenêtre.
Description check Passed La description explique le bug, les étapes de reproduction, la cause, la correction et les tests effectués sous Windows avec WebView2. Elle ne reprend pas les sections formelles du modèle ni la checkl…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

La description explique le bug, les étapes de reproduction, la cause, la correction et les tests effectués sous Windows avec WebView2. Elle ne reprend pas les sections formelles du modèle ni la checklist, mais les informations essentielles sont présentes.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

Comment @coderabbitai help to get the list of available commands.

@InstaZDLL InstaZDLL self-assigned this Oct 16, 2026
@InstaZDLL
InstaZDLL merged commit 1b030c5 into main Oct 16, 2026
16 checks passed
@InstaZDLL
InstaZDLL deleted the fix/866-focus-ring-after-refocus branch October 16, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: frontend React/Vite frontend (src/) size: s 10-50 lines type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant