Skip to content

Search the X-Plane Custom Scenery list - #65

Merged
flysimdev merged 2 commits into
flysimdev:developfrom
andrewcarlberg:feature/scenery-search
Nov 28, 2026
Merged

flysimdev merged 2 commits into
flysimdev:developfrom
andrewcarlberg:feature/scenery-search

Conversation

@andrewcarlberg

@andrewcarlberg andrewcarlberg commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What it does

The X-Plane Custom Scenery page lists every line of scenery_packs.ini. Mine has 1,623, so finding one package meant a lot of scrolling. This adds a search box under the "From …scenery_packs.ini" line:

  • It shows only the packages whose name or folder contains the text. Case doesn't matter, and / and \ count as the same, so D:/ortho4xp finds D:\Ortho4XP\…. It uses the same box, icon and 250 ms typing delay as the Airports page.
  • The count sits on the right: "1,623 packages", or "3 of 1,623 packages" while searching. It's always written with a comma, whatever the Windows language, as the program runs in the invariant culture.
  • Esc (or the box's ×) empties it. The search stays when the list is read again (Refresh, Start, Stop).
  • The switches work as usual while searching.
  • Dragging pauses while searching. Between two rows that match, hundreds of hidden rows may lie, so where a drop lands would be a guess. A one-line note says so, and the drag handles hide. The row and drop logic is unchanged and works on the full list.
  • Show in list on a filtered row clears the search, scrolls the full list to that package, and marks it with an accent border (the same look as a chosen card). From there it can be dragged.

The intro text of the page is unchanged.

Screenshots

Before (the page as it is in 1.6.0):

0-before

After: the search box and count:

1-page-with-search

After: searching kden. 3 of 1,623 match, dragging is paused, and each row has Show in list:

2-search-kden

After: Show in list on Z KDEN Mesh. The search is cleared, the list is scrolled to it, and it's marked:

3-show-in-list

How it's built

  • Gui/Scenery/SceneryPackSearch.cs (new): the matching and the count text. It's small and doesn't depend on WPF, so it's easy to test.
  • SceneryViewModel: a Search property and a filtered ICollectionView over Rows. Rows itself, and so the indices Drop uses, never changes. CanDrag = CanEdit and no search; Drop checks it too. ShowInList(row) clears the search and highlights the row.
  • SceneryPackRow: IsHighlighted.
  • SceneryView: the search box, the count and note, the Show in list button, and the scroll to the found row. The Esc handler lives in the code-behind, because a KeyBinding on the TextBox didn't clear it reliably.
  • No new dependencies.

Tests

dotnet build has 0 warnings, and dotnet test gives 689 passed, 0 failed, 0 skipped (26 new).

  • SceneryPackSearchTests (15): blank searches, case and spaces, / and \ in paths, X-Plane's own entries such as *GLOBAL_AIRPORTS*, no match, the count texts, and the count under a German culture.
  • SceneryViewModelTests (11), against a temporary scenery_packs.ini:
    • the filtered view and count
    • a drop while searching changes neither the file nor the list, and a drop once the search is cleared does move the package
    • a switch flipped while searching writes that package's line only
    • the no-match note
    • the search survives Refresh, and also picks up packages added to the file since
    • the highlight goes when the list is read again
    • no X-Plane folder set
    • Show in list

Checked by hand in the app with my 1,623-package list:

  • search by name and by folder
  • the count, the no-match note, and Esc
  • Show in list scrolls to and marks the package
  • pressing Show in list doesn't touch the row's switch

Docs

docs/custom-scenery.md has a new Finding a package section with a new screenshot (images/custom-scenery-search.png), and images/custom-scenery.png is retaken with the search box.

images/custom-scenery-running.png still shows the page without the search box. Retaking it means starting a mount, so I left it. Happy to update it if you'd like.

The list can be well over a thousand packages long. A search box under
the file line shows only the packages whose name or folder contains the
text (case and / or \ do not matter), with the count on the right
("3 of 1,623 packages"). Esc empties it; it stays while the list is read
again.

While searching, rows cannot be dragged: hundreds of hidden rows may lie
between two shown ones, so where a drop lands would be a guess. The
switches still work. "Show in list" on a row clears the search, scrolls
to the package and marks it with an accent border, ready to drag.

SceneryPackSearch holds the matching and the count text; the page shows
a filtered view of Rows, so the list itself and the drop indices are
unchanged.
A "Finding a package" section on the search, the count and Show in list,
a new screenshot of a search, and the page's screenshot retaken with the
search box.
@andrewcarlberg
andrewcarlberg marked this pull request as ready for review November 26, 2026 00:35
@flysimdev

Copy link
Copy Markdown
Owner

@andrewcarlberg
Hello.
Thanks a lot for your contribution to the project. This feature looks reasonable to add to the project.
I'll review your PR as soon as possible.

Blue skies ✈️

@flysimdev
flysimdev merged commit 16451b0 into flysimdev:develop Nov 28, 2026
2 checks passed
@flysimdev

Copy link
Copy Markdown
Owner

@andrewcarlberg
I've merged your feature into develop, and it will appear in the 2.1.0 release soon.
Thanks a lot for your contribution to OrthoStreamXP
Blue skies ✈️

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.

2 participants