← Back to Pull requests

Make tags that scroll out of view reachable in the tag field #514

Open
tonygermano opened this pull request with 405 lines diff across 3 files
View on GitHub
tonygermano tonygermano commented on Oct 26, 2026 03:10 UTC
Author

Summary

Follow-up to #437. When a tag field has more tags than fit, the first ones scroll past the left edge, and there was no way to get back to them (see @NicoPiel's review). In the channel editor, which has no clear button, the only way to remove the first tag was to backspace through every tag after it.

This PR makes every tag reachable from both the mouse and the keyboard, and removes a license notice #437 left behind. It applies to all three tag fields: the channel editor and the Dashboard and Channels filters.

Changes

Keyboard navigation with an edit mode. The text editor can now sit between chips, and new tags are inserted where it is. Typing enters an edit mode, shown by an outline around the text, and the keys behave differently in each mode:

| Key | Navigating | Edit mode |
|-|-|-|
| Left / Right | Move the editor past a chip | Move the caret |
| Home / End | Move the editor to the first or last slot | Move the caret |
| Backspace / Delete | Remove the chip before or after the editor | Edit the text |
| Enter / comma | Nothing | Commit the text |
| Escape | Passed on to the window | Clear the text and leave edit mode without committing |

Edit mode lasts until the text is committed, Escape is pressed, or the field loses focus with no text. Deleting the text doesn't end it, so holding Backspace to clear what you typed can't run on into the chips.

Mouse wheel scrolling. The wheel and sideways trackpad swipes scroll the chips. When all the chips fit, the wheel event is passed on, so an enclosing scroll pane still scrolls. Before, the field swallowed it.

Mouse deletion and placement.

  • Like a browser tab, a middle click anywhere on a chip deletes it.

  • The "×" deletes on release, and only if the pointer is still over it.

  • After a mouse delete, the row stays where it is, so the next chip slides under the pointer.

  • A left click in a gap between chips puts the editor there, so tags can be inserted with the mouse.
  • Third-party notice. #437 removed the last bundled copy of bootstrap-tokenfield, so its section of THIRD-PARTY-README.txt is removed. The jQuery and Bootstrap sections stay, since server/public_api_html still ships both.

    Commits

    Each commit builds on its own.

    1. Navigate tag chips from the keyboard with an edit mode. The editor sits between chips, edit mode works as described above, and the editor is sized to its text. The editor and its outline use TagChip's font and corner radius, so typed text looks like the chips.
    2. Drop the bootstrap-tokenfield third-party notice.
    3. Scroll the tag chips with the mouse wheel. This includes sideways scrolling on Linux. X11 reports it as mouse buttons 4 and 5 rather than as wheel events, so it needs its own listener.
    4. Delete tag chips with a middle click and place the editor by clicking.

    Testing

  • I tested the channel editor and the Dashboard and Channels filters on Linux (X11) with a trackpad, a trackpoint, and a mouse with a tilt wheel. The mouse's back and forward buttons have no effect on the field.

  • On Windows, I tested scrolling with the tilt-wheel mouse.

  • I haven't tested on macOS. There, sideways scrolling arrives as wheel events with Shift, the same as on Windows.

  • ./gradlew clean build passes.

  • Claude checked the keyboard, mouse and scrolling behavior with a headless test harness, which isn't part of this PR. A separate Claude review with no prior context checked each commit on its own. The fixes from that review are included.
  • ---
    _Drafted with Claude Code_

    Diff: 405 lines (+346 / -59) across 3 files Reviewer: NicoPiel Review duration: 21909m
    All Vouch review confidence checks passed
    Residual risk 0.09 = Change Risk (0.42) × (1 − Review Confidence (0.79)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 405 lines diff across 3 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.74 · 3 substantive comment(s)
    0.74
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    79%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.359
    Real PR Conversation Timeline
    7 items
    github-actions[bot] github-actions[bot] commented on Oct 26, 2026 03:22 UTC
    Bot

    Test Results


      141 files  ±0    141 suites  ±0   3m 9s ⏱️ -11s
      919 tests ±0    919 ✅ ±0  0 💤 ±0  0 ❌ ±0 
    1 051 runs  ±0  1 045 ✅ ±0  6 💤 ±0  0 ❌ ±0 

    Results for commit 911c0bcd. ± Comparison against base commit 0638c21b.

    [test-results]:data:application/gzip;base64,H4sIAFF76moC/13NTQ6DIBCG4asY1l3MKBDoZRoZICH1p0FYmd69aJXYLt9nkm9W5sPgFnZvkOOtYUsO6ZI2xz6FedpA6QLlmLazxlqPJRP90zO8CkEF34fhB1yMczwk5ml/CQKPOjcRuKj03ZRnXyb3vi7SPI4hlWAakcCQVS10rpWKg1CdtC1Z3nvU3AiwWhpi7w9NB3ILCwEAAA==

    :recycle: This comment has been updated with latest results.

    NicoPiel NicoPiel commented on Oct 28, 2026 10:31 UTC
    Contributor

    Bugs:
    1. Typed text carries over to the next channel. Text typed but not committed stays in the editor, still in edit mode, when you open another channel: editChannel → setChannelTags never clears it. Saving the second channel then adds that text as a tag via createTagOnFocusLost.
    2. Editor stuck between chips. If you type between two chips and click Save, the tag is added but the editor stays where it was, empty and unfocused, with no prompt.

    Lower priority:

  • getPreferredSize reaches the editor through the outer editor field, which is still null while the text field is being built. It's a possible null pointer error if the size is ever asked for that early.

  • editorIndex is reset by hand before setTokens in three places, but update() and clear() don't do it. One reset inside setTokens would cover all of them.

  • moveEditor rebuilds every chip on each arrow-key press. setComponentZOrder would move the editor and keep focus.

  • On X11, each tag field installs its own app-wide mouse listener, so every mouse event in the client goes through up to three of them.

  • The edit outline's color comes from MetalLookAndFeel rather than UIManager.
  • gibson9583 gibson9583 commented on Oct 30, 2026 10:48 UTC
    Reviewer

    Looks safe to merge.

    tonygermano tonygermano commented on Oct 31, 2026 08:29 UTC
    Author

    [!NOTE]

    I marked as draft because I pushed each point as a separate fixup! commit so that the individual fixes were easy to make out from the previous code. I wanted to make sure those commits were autosquashed after review and before merging, but I don't plan on making any more changes.

    @NicoPiel Thanks for the careful look. All of these are addressed in the latest push, either with a fix or an explanation below.

    Bugs:

    1. Typed text carries over to the next channel. Fixed: setChannelTags now clears the editor and leaves edit mode. The text already carried over before this PR, but edit mode made it much easier to notice.
    2. Editor stuck between chips. Fixed: when createTagOnFocusLost commits while the editor doesn't have focus, as with Save, it moves the editor back to the end, where the prompt shows again. If you save with Ctrl+S while still typing, the editor keeps focus and stays where it is.

    Lower priority:

  • getPreferredSize before editor is set. Fixed: isShowingPrompt() treats a null editor as unfocused.

  • Resetting editorIndex in setTokens. I left this one as is, on purpose. The three places that reset it by hand load a different set of tags, so the editor goes to the end. update() re-resolves the same tags on every Dashboard refresh. Resetting there would pull the editor back to the end every few seconds while someone is moving it or typing. clear() empties the tags, so the clamp in setTokens already puts the editor at 0, which is the end.

  • moveEditor rebuilding every chip. Done: it now moves the editor with setComponentZOrder and leaves the chips alone.

  • One app-wide listener per field on X11. Only one tag field is displayable at a time. Frame.setCurrentContentPage removes the previous page from the viewport, and removeNotify takes that field's listener with it. The listener checks only the event ID and button before returning, so the cost per mouse event is negligible.

  • Outline color from MetalLookAndFeel. Done: the outline reads UIManager.getColor("Button.focus") each time it paints, so it follows the look and feel. Under the client's Plastic theme, it's the same color as before.
  • ---
    _Drafted with Claude Code_

    NicoPiel NicoPiel approved these changes on Nov 03, 2026 22:27 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    tonygermano tonygermano
    Labels
    risk: low confidence: 79.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 41.9% (MEDIUM) · Higher = larger blast radius
    41.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 79.2% · Lower = rushed or shallow review
    79.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 8.7% · Safe to merge
    8.7%