feat: add group by, theme-specific placement and matching section titles

- Add a per-collection Group by option to the collection page, saved with
  the collection. Games with several values appear in each group, and games
  with no value go in a "Not set" group at the end.
- Turn off manual reordering while a grouping is active.
- Add an optional theme-specific placement for Stardust, Nova X, Helium and
  Harmony, off by default.
- Copy the Collections title and separator from the neighbouring section in
  the game details view so they match the theme.
- Add top margin to the Collections page so Create Collection no longer
  overlaps the window controls.
- Bump the version to 1.2.0 and update the docs, changelog and manifest.
This commit is contained in:
X4Lo committed 2026-11-04 00:26:52 +00:00
1 parent 690a79b014
commit b9a6bf891d
20 files changed
+680 -59

No files matched your search

+21 -2
View File
@@ -125,14 +125,22 @@ The order is simply the order of `GameCollection.GameIds`, which is also what th
`CollectionManager.MoveGames(collectionId, gameIds, anchorId, after)` is the single move operation. Selected games keep
their relative order.
On the page, `CollectionDetailsViewModel.CanReorder` requires the *Collection order, ascending* sort, because a moved
game wouldn't stay put in any other. Moves relate to *visible* games, so with a filter active, "move earlier" passes the
On the page, `CollectionDetailsViewModel.CanReorder` requires the *Collection order, ascending* sort with no grouping,
because a moved game wouldn't stay put otherwise. Moves relate to *visible* games, so with a filter active, "move earlier" passes the
previous visible game.
Dragging is in `CollectionDetailsView.xaml.cs`. A click on an already selected game in a multi-selection delays
collapsing the selection until the mouse button is released, otherwise several games couldn't be dragged.
`FindDropTarget` picks the closest tile on the pointer's row and which side of it to use.
## Grouping
`GameCollection.GroupBy` holds the choice, set through `CollectionManager.SetGroupBy`. It has a safe default, so old
files need no migration. `GameGroupDescription` returns a list of names for a multi-value field, which makes WPF put
the same tile in several groups. That's why `RequestVisibleCovers` reads tiles from the visual tree: with groups,
`ContainerFromItem` doesn't reach them. To add a grouping, add it to the end of `GameGroupField`, then to
`GroupNameFromItem` and `GroupOptions`.
## Dynamic collections
A collection is dynamic when `Rules` is not null. `GameIds` stores the latest matches, so no page has to search the
@@ -215,6 +223,17 @@ The integration's safeguards:
`ListBoxItem`s, which hold most of the tree. A 1 second timer only compares `ActiveDesktopView`.
- Every error is caught and logged, and stops further searching until the next trigger.
Behind the `UseThemeSpecificPlacement` setting (off by default), and only when `ApplicationSettings.DesktopTheme` is in
`ThemesUsingGameRelationsSection`, it instead goes next to the element whose `Visibility` binding names
`GameRelationsVisibilityProxy`, in that element's form: a new `TabItem` beside a tab, a new row in a `Grid`, a copy of a
`Border`'s style, or a plain sibling in a panel. It only needs that element's parent to be visible, so it works without
Game Relations installed. This is a temporary workaround that depends on these themes' XAML. The injected control stays
subscribed to events because a control in an unselected tab never loads.
The section title is copied from the theme, not defined here: `FindTitle` and `FindSeparator` look in the neighbouring
section (the anchor or Game Relations section), and `CloneTitle` copies its current style values. A section that's an
`Expander` gets an `Expander` of its own with the title in its header.
**This relies on Playnite's internal part names.** Check it after Playnite updates. The default layouts are
`Themes/Desktop/Default/Views/DetailsViewGameOverview.xaml` and `GridViewGameOverview.xaml` in Playnite's repository.
+8
View File
@@ -18,6 +18,13 @@ When your theme has this element, the extension doesn't insert a second list, an
user turns off **Show collections in details view**. The list shown there includes dynamic collections unless the user
turns off **Display dynamic collections in details view**.
## Temporary placement for specific themes
Stardust, Nova X, Helium and Harmony don't keep the description in a plain panel, so the default insertion can't work
well there. When the user turns on **Use special placement** and one of these is the active theme, the list goes next
to the element whose `Visibility` is bound to `GameRelationsVisibilityProxy`. Adding the `ContentControl` above to one
of these themes replaces this, because the theme's own element always takes priority.
## Settings available to themes
Bind to these with `PluginSettings`:
@@ -27,6 +34,7 @@ Bind to these with `PluginSettings`:
| `IsDetailsControlVisible` | `bool` | The list currently has collections to show. Use it to hide a surrounding header or panel. |
| `ShowDynamicCollectionsInDetails` | `bool` | The user's choice for listing dynamic collections. |
| `AddDetailsListToAnyTheme` | `bool` | The user's choice for inserting the list automatically. |
| `UseThemeSpecificPlacement` | `bool` | The user's choice for the temporary placement above. |
```xml
<Border Visibility="{PluginSettings Plugin=GameCollections, Path=IsDetailsControlVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
+7 -1
View File
@@ -89,6 +89,9 @@ Click one to open it in a window, where **Open in Collections** takes you to its
In the extension's settings:
- **Show collections in details view** turns the automatic list on or off.
- **Use special placement for Stardust, Nova X, Helium and Harmony** (off by default) is a temporary fix for these
themes, whose layouts don't have a normal spot for the list. It goes next to their Game Relations section: as a
**Collections** tab in Harmony's Details view, a section in the others, and at the end of the panel in Grid view.
- **Display dynamic collections in details view** lists dynamic collections as well as manual ones.
The list is added to the theme's layout automatically, because Playnite has no official way to do this. It needs the
@@ -103,13 +106,16 @@ not show it. List view has no details panel, so it doesn't appear there. Theme a
- **Search** the collection's games by name.
- **Sort** by collection order (the order you arranged, or the order games were added), name, release date,
last played, time played or date added, ascending or descending.
- **Group by** shows the games in labelled groups, such as by platform, series, genre or release year. Each collection
remembers its own choice. A game with several values, such as two genres, appears in each group. Games with no
value go in a **Not set** group at the end.
- **Installed only** hides games that aren't installed (uninstalled games are dimmed otherwise).
- For each game (right-click, or keyboard):
- **Play** / **Install** – double-click or **Enter**.
- **Show in library** – selects the game in Playnite's library view.
- **Remove from collection** – **Delete**. Works on several selected games at once (Ctrl/Shift-click).
Not available in dynamic collections.
- **Reorder** while sorted by collection order, ascending: drag games (several at once if selected), use
- **Reorder** while sorted by collection order, ascending, with no grouping: drag games (several at once if selected), use
**Move to top / earlier / later / to end** in the right-click menu, or press **Alt+arrow keys**.
## Where data is stored