Skip to content

feat(apps): order apps alphabetically - #3223

Merged
ReenigneArcher merged 1 commit into
masterfrom
feat/webui/order-apps-alphabetically
Sep 29, 2024
Merged

ReenigneArcher merged 1 commit into
masterfrom
feat/webui/order-apps-alphabetically

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Sort apps alphabetically.

Original plan was to sort them via the webUI; however the it attempted to delete/edit the incorrect apps due to the change in index order. So opted to alphabetize the apps.json before saving the file.

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

@codecov

codecov Bot commented Sep 25, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Project coverage is 9.82%. Comparing base (434b7e0) to head (4c7d85d).
Report is 93 commits behind head on master.

Files with missing lines Patch % Lines
src/confighttp.cpp 0.00% 5 Missing and 13 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #3223      +/-   ##
=========================================
- Coverage    9.82%   9.82%   -0.01%     
=========================================
  Files         101     101              
  Lines       17969   17980      +11     
  Branches     8408    8418      +10     
=========================================
  Hits         1766    1766              
- Misses      13320   13328       +8     
- Partials     2883    2886       +3     
Flag Coverage Δ
Linux 7.27% <0.00%> (-0.01%) ⬇️
Windows 5.10% <0.00%> (-0.01%) ⬇️
macOS-13 10.70% <0.00%> (-0.02%) ⬇️
macOS-14 10.01% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/confighttp.cpp 1.14% <0.00%> (-0.03%) ⬇️

... and 24 files with indirect coverage changes

@moi952

This comment was marked as off-topic.

@ReenigneArcher

This comment was marked as resolved.

@reloxx13

This comment was marked as resolved.

@ReenigneArcher

This comment was marked as resolved.

@ReenigneArcher ReenigneArcher changed the title feat(webui): order apps alphabetically feat(apps): order apps alphabetically Sep 27, 2024
@ReenigneArcher ReenigneArcher added this to the stable release milestone Sep 28, 2024
@ReenigneArcher
ReenigneArcher force-pushed the feat/webui/order-apps-alphabetically branch 3 times, most recently from cfde73a to fd41138 Compare September 28, 2024 16:40
@ReenigneArcher

Copy link
Copy Markdown
Member Author

Fixed the code smells, and a few others in this file.

@ReenigneArcher

This comment was marked as resolved.

@ReenigneArcher
ReenigneArcher force-pushed the feat/webui/order-apps-alphabetically branch from fd41138 to 4c7d85d Compare September 29, 2024 21:38
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher merged commit 1839d59 into master Sep 29, 2024
@ReenigneArcher
ReenigneArcher deleted the feat/webui/order-apps-alphabetically branch September 29, 2024 22:25
KuleRucket pushed a commit to KuleRucket/Sunshine that referenced this pull request Oct 9, 2024
c2vi pushed a commit to c2vi/Sunshine that referenced this pull request Mar 27, 2025
4o66 added a commit to 4o66/Sunshine that referenced this pull request Sep 12, 2026
saveApp() sorted the apps array by name and wrote the sorted result back, so
every save through the web UI rewrote the on-disk order of apps.json. Nothing
needs it to do that any more.

The sort was a workaround. PR LizardByte#3223, which added it, says the original plan was
to sort in the web UI, but that broke edit and delete because those address apps
by array index and the displayed order no longer matched the file. Sorting the
file made the two match. At that time apps.html rendered `v-for="(app,i) in
apps"` in raw file order, so sorting the file was what made the web UI list
appear ordered, which is what LizardByte/Sunshine discussion #489 asked for.

Every consumer now orders the list itself:

- The web UI has since gained its own sorting in PR LizardByte#5158. displayedApps maps
  each app to { app, index }, carrying the real index through filtering and
  sorting, with a user-facing mode of default, asc or desc.
- moonlight-qt sorts on every refresh from the server: NvComputer::sortAppList()
  runs a case-insensitive stable_sort immediately after `appList = newAppList`.
- moonlight-android does the same in AppGridAdapter.sortList(), on every
  addApp().

So the file sort no longer affects what anyone sees, and it has two costs. It
contradicts the web UI it was protecting, because sort mode "default" means file
order and can never take effect. And it silently rewrites apps.json for anything
that generates the file outside the web UI.

Removing it changes no displayed order. It leaves apps.json ordered the way
whoever wrote it left it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

3 participants