Skip to content

Fixes #5517. DropDownList dropped list uses Menu scheme for distinct background - #5545

Merged
tig merged 6 commits into
developfrom
fix-5517-dropdownlist-scheme
Jun 27, 2026
Merged

Fixes #5517. DropDownList dropped list uses Menu scheme for distinct background#5545
tig merged 6 commits into
developfrom
fix-5517-dropdownlist-scheme

Conversation

@tig

@tig tig commented Jun 27, 2026

Copy link
Copy Markdown
Member

Fixes #5517

Problem

When a DropDownList is dropped (expanded), the open list popup shared its SuperView's background attribute, so the open list blended into the surrounding content and its bounds were hard to see.

This was a regression. The original implementation gave the dropped list a distinct background, but commit c6d67e362 replaced that with a GettingAttributeForRole handler that forced the popover's Normal attribute to match App.TopRunnableView.MostFocused — i.e. the SuperView — reintroducing the bug.

Fix

Resolve the dropped list's scheme to the Menu scheme — the same approach used by Menu, StatusBar, and PopupAutocomplete for popover/floating views. Its Normal attribute now differs from the SuperView by construction, so the open list visibly "floats".

SchemeName = SchemeManager.SchemesToSchemeName (Schemes.Menu)

The GettingAttributeForRole workaround is removed.

Test

Adds DroppedList_UsesBackgroundDistinctFromSuperView to UnitTestsParallelizable, which opens a DropDownList and asserts the dropped list's Normal background != its SuperView's. Verified it fails against the unfixed source and passes with the fix. All 50 DropDownListTests pass.

🤖 Generated with Claude Code

tig and others added 3 commits June 25, 2026 12:05
…background

The expanded (dropped) DropDownList list shared its SuperView's background
attribute, making the open list blend into surrounding content. A
`GettingAttributeForRole` handler forced the popover's Normal attribute to
match the most-focused view — reintroducing the bug the original
implementation avoided.

Resolve the dropped list's scheme to the Menu scheme (consistent with Menu,
StatusBar, and PopupAutocomplete) so its Normal attribute differs from the
SuperView by construction and the list visibly "floats".

Adds a regression test asserting the dropped list's Normal background differs
from its SuperView's.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…5517)

Re-recorded via docfx/scripts/generate-views-doc.ps1's tuirec + OutputView
pipeline (built against the fixed library). The dropped list now renders with
the Menu scheme's LightBlue background, clearly floating over the host window.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

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.

Pull request overview

Fixes a visual regression where a DropDownList’s dropped (expanded) list popup blended into its SuperView by ensuring the dropped list resolves to the Menu scheme, giving it a distinct background like other floating/popover UI in Terminal.Gui.

Changes:

  • Set the dropped list ListView’s SchemeName to Schemes.Menu and remove the GettingAttributeForRole workaround.
  • Add a regression test asserting the dropped list background differs from its SuperView when expanded.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
Terminal.Gui/Views/DropDownList.cs Makes the dropped list “float” by assigning the Menu scheme and removing the prior attribute-forcing handler.
Tests/UnitTestsParallelizable/Views/DropDownListTests.cs Adds a regression test covering distinct background behavior for the expanded list.

Comment thread Tests/UnitTestsParallelizable/Views/DropDownListTests.cs Outdated
Comment thread Tests/UnitTestsParallelizable/Views/DropDownListTests.cs
tig and others added 3 commits June 27, 2026 11:32
Ran docfx metadata + generate-views-doc.ps1 -SkipGifs (reusing existing gifs,
including the newly recorded DropDownList.gif). Syncs the ImageView
description with its current XML doc summary (Sixel/Kitty raster modes).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Full re-run of docfx/scripts/generate-views-doc.ps1 (docfx metadata +
tuirec/OutputView recording) against the fixed library, refreshing every
built-in view GIF in docfx/images/views/. The DropDownList GIF shows the
dropped list floating with the Menu scheme's distinct background.

Abstract/base types (LinearRangeViewBase, RunnableWrapper, SelectorBase)
have no GIF as before — they cannot be instantiated for recording.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…5517)

The new regression test was inserted between the `FindDropDownPopover` helper
and its `// Helper to find the DropDownList popover` doc comment, orphaning the
comment above the test. Move the helper comment back directly above the helper
so it documents the method again; the test keeps its own AI-author marker.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tig
tig merged commit 0b11290 into develop Jun 27, 2026
14 checks passed
@tig
tig deleted the fix-5517-dropdownlist-scheme branch June 27, 2026 20:45
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.

DropDownList: dropped (expanded) list should use a background attribute distinct from its SuperView

2 participants