Skip to content

Add weather display settings and ExcludedPeople filter #582

Closed
nopoz wants to merge 8 commits intoimmichFrame:mainfrom
nopoz:branch-merge-rebase
Closed

Add weather display settings and ExcludedPeople filter #582
nopoz wants to merge 8 commits intoimmichFrame:mainfrom
nopoz:branch-merge-rebase

Conversation

@nopoz
Copy link

@nopoz nopoz commented Feb 5, 2026

Summary

This PR combines three related feature branches that were previously submitted as separate PRs (#549, #553, #561). Those PRs all modified the same core settings files (IServerSettings.cs, ServerSettings.cs, ServerSettingsV1.cs, ClientSettingsDto.cs, test resources, and example
configs), causing persistent merge conflicts between them and with main. Rebasing them individually would have required resolving the same conflicts repeatedly in a chain, so this PR consolidates all changes into a single cleanly-rebased branch.

Included Features

  1. ShowTemperatureUnit setting (previously Add ShowTemperatureUnit setting to hide F/C from weather display #553)
  • Adds ShowTemperatureUnit boolean property (default: true) across backend and frontend
  • When false, displays only the degree symbol (e.g., 72°) without the F/C indicator
  • Handles undefined weather.unit with fallback to °
  1. TemperatureDecimalDigits setting (previously Add setting to adjust temperature number display style #549)
  • Adds TemperatureDecimalDigits integer property (default: 1, range: 0-2) for flexible temperature precision
  • Replaces the earlier UseWholeNumberTemperatures boolean with a more flexible approach
  • Server-side validation enforces the 0-2 range
  • Frontend uses toFixed(temperatureDecimalDigits) for display
  1. ExcludedPeople setting (previously Add "ExcludedPeople" setting to filter out specific people from "People" results #561)
  • Adds ExcludedPeople list (List) to account settings, mirroring the existing ExcludedAlbums pattern
  • Allows users to exclude photos containing specific people when using the People filter
  • Extracts a shared LoadAssetsForPerson helper to avoid code duplication
  • Fixes pagination bug identified in code review: loop condition now checks returned item count instead of Total == batchSize
  • Note: exclusion only applies to People results due to Immich API limitations

Previous PRs

This PR supersedes the following, which can be closed once this is merged:

Test Plan

  • Existing unit tests pass
  • Docker build succeeds
  • ShowTemperatureUnit: false displays ° without F/C
  • TemperatureDecimalDigits: 0 shows whole numbers, 1 shows one decimal, 2 shows two decimals
  • TemperatureDecimalDigits outside 0-2 range is rejected by server validation
  • ExcludedPeople correctly filters out photos containing excluded people
  • V1 settings format still loads correctly

Summary by CodeRabbit

  • New Features

    • Exclude specific people from asset display.
    • Temperature display options: toggle unit visibility and set decimal precision.
  • Tests

    • Updated test configurations and expectations to cover person exclusions and temperature display settings.
  • Documentation

    • Example configuration and environment samples updated to show new settings.

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Adds per-account person exclusions to asset loading and introduces configurable temperature display settings (unit visibility and decimal precision) across configs, models, adapters, core pool logic, tests, and frontend.

Changes

Cohort / File(s) Summary
Interfaces & Contracts
ImmichFrame.Core.Interfaces/IServerSettings.cs
Added ExcludedPeople to account settings and ShowTemperatureUnit / TemperatureDecimalDigits to general settings.
Core Pool Logic
ImmichFrame.Core/Logic/Pool/PeopleAssetsPool.cs
Refactored per-person asset paging into LoadAssetsForPerson; load excluded people assets and filter main results using that exclusion set.
Configuration Models & Adapters
ImmichFrame.WebApi/Models/ServerSettings.cs, ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs
Added ExcludedPeople to account settings; added ShowTemperatureUnit and TemperatureDecimalDigits with validation (range 0–2) and V1 adapter defaults.
API DTOs & Frontend Types
ImmichFrame.WebApi/Models/ClientSettingsDto.cs, immichFrame.Web/src/lib/immichFrameApi.ts
Exposed ShowTemperatureUnit and TemperatureDecimalDigits in client settings DTO and frontend type.
Frontend UI
immichFrame.Web/src/lib/components/elements/clock.svelte
Use configurable decimal precision for temperature and conditional unit display based on config flags.
Config Examples & Env
docker/Settings.example.json, docker/Settings.example.yml, docker/example.env, ImmichFrame.WebApi.Tests/Resources/TestV2.json, ImmichFrame.WebApi.Tests/Resources/TestV2.yml
Added ExcludedPeople entries to account examples and added general temperature settings to example configs.
Tests
ImmichFrame.Core.Tests/Logic/Pool/PersonAssetsPoolTests.cs, ImmichFrame.WebApi.Tests/Helpers/Config/ConfigLoaderTest.cs
Stubbed ExcludedPeople in pool tests; adjusted config loader tests to assert conditional TemperatureDecimalDigits expectations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • JW-CH

Poem

🐰 I munched through configs, tidy and neat,

Excluded folks skip the asset street.
Temperatures shown with digits so fine,
Units on or off — the choice is thine.
Hoppy deploys and carrot confetti! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main features: weather display settings (ShowTemperatureUnit and TemperatureDecimalDigits) and ExcludedPeople filter for account-level person exclusion.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@ImmichFrame.WebApi.Tests/Helpers/Config/ConfigLoaderTest.cs`:
- Around line 123-131: The assertion for "TemperatureDecimalDigits" in
ConfigLoaderTest currently expects 7 which is outside the allowed 0–2 range;
update the expectation in the if/else block that checks prop.Name ==
"TemperatureDecimalDigits" (in the ConfigLoaderTest test) to a valid value
(e.g., expect 1 for V1 default and 2 for the V2 fixture) and ensure the test
fixture that supplies value aligns with that allowed value; adjust the branch
using expectNullApiKeyFile and the Assert.That(value, Is.EqualTo(...),
prop.Name) accordingly so the asserted value is within 0–2.

In `@ImmichFrame.WebApi.Tests/Resources/TestV2.json`:
- Around line 33-34: The fixture TestV2.json contains "TemperatureDecimalDigits"
set to 7 which is outside the validated 0–2 range; update
"TemperatureDecimalDigits" to a valid value (e.g., 0, 1, or 2 — commonly 2) in
the TestV2.json fixture and then adjust any tests that assert on
formatting/precision to expect the new valid digit count; ensure the keys
"ShowTemperatureUnit" and "TemperatureDecimalDigits" are left intact and only
the numeric value is changed so tests reflect valid production configuration.
🧹 Nitpick comments (3)
docker/Settings.example.yml (1)

30-31: Missing new temperature display settings in example configuration.

The PR introduces ShowTemperatureUnit and TemperatureDecimalDigits settings, but they are not included in this example file. For completeness and user discoverability, consider adding them to the General section:

  ShowWeatherDescription: true
  ShowTemperatureUnit: true
  TemperatureDecimalDigits: 1
ImmichFrame.Core.Tests/Logic/Pool/PersonAssetsPoolTests.cs (1)

33-43: Add tests for ExcludedPeople filtering behavior.

The implementation actively uses the ExcludedPeople setting to filter assets (loads excluded person assets and removes them from results), but the current tests never exercise this logic. Consider adding test cases that verify:

  1. Assets from excluded people are filtered out
  2. Exclusion works correctly with multiple excluded people
  3. Behavior when a person appears in both People and ExcludedPeople
ImmichFrame.Core/Logic/Pool/PeopleAssetsPool.cs (1)

11-24: Skip excluded-people fetch when no People filter is configured.

When People is null/empty, the method returns an empty result anyway, so excluded-person fetches become unnecessary API calls.

♻️ Suggested refactor
-        var excludedPersonAssets = new List<AssetResponseDto>();
-
-        foreach (var personId in accountSettings.ExcludedPeople)
-        {
-            excludedPersonAssets.AddRange(await LoadAssetsForPerson(personId, ct));
-        }
-
         var personAssets = new List<AssetResponseDto>();

         var people = accountSettings.People;
-        if (people == null)
+        if (people == null || people.Count == 0)
         {
             return personAssets;
         }
+
+        var excludedPersonAssets = new List<AssetResponseDto>();
+        foreach (var personId in accountSettings.ExcludedPeople)
+        {
+            excludedPersonAssets.AddRange(await LoadAssetsForPerson(personId, ct));
+        }

- Move People null check before ExcludedPeople loading in PeopleAssetsPool
- to avoid unnecessary API calls, and fix TemperatureDecimalDigits test
- fixture value from 7 to 2 to match the validated 0-2 range.
@3rob3
Copy link
Collaborator

3rob3 commented Feb 6, 2026

I'm still good with the weather changes, but did have a thought. Why are we showing weather units at all/ever? Isn't it understood that the units are going to be in whatever locale you are in? I'm just thinking cars don't show this, signs on the roadway don't show this, my MacOS widget I'm looking at right now doesn't have units. In other words maybe we just remove this and then this extra setting is unneeded?

I still have concerns with the ExcludedPeople, since this will not work when people use in conjunction with Albums. This seems like it will cause confusion, even though it's not our fault.

Copy link
Collaborator

@JW-CH JW-CH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, could you split this into separate PRs? It would make reviewing a lot easier when each PR focuses on one thing.

@nopoz
Copy link
Author

nopoz commented Feb 6, 2026

Hey, could you split this into separate PRs? It would make reviewing a lot easier when each PR focuses on one thing.

They are in separate PRs. Please read the description. 😕

@nopoz
Copy link
Author

nopoz commented Feb 6, 2026

I'm still good with the weather changes, but did have a thought. Why are we showing weather units at all/ever? Isn't it understood that the units are going to be in whatever locale you are in? I'm just thinking cars don't show this, signs on the roadway don't show this, my MacOS widget I'm looking at right now doesn't have units. In other words maybe we just remove this and then this extra setting is unneeded?

I still have concerns with the ExcludedPeople, since this will not work when people use in conjunction with Albums. This seems like it will cause confusion, even though it's not our fault.

I agree, but @JW-CH was making an argument in the original PR to keep it, although never clarified why exactly.

@JW-CH
Copy link
Collaborator

JW-CH commented Feb 6, 2026

@nopoz I understand the merge conflict situation, but combining three features into one PR makes review much harder.
The problems:

  • Mixed discussions - Temperature display and people filtering are unrelated features that need separate evaluation
  • Different concerns - @3rob3's UX question about temperature units shouldn't block ExcludedPeople (and vice versa)
  • API limitations differ - ExcludedPeople only works with People filter, not Albums, which needs more discussion

My request:
Please split this back into separate PRs. I know rebasing is extra work, but reviewing three features as a package deal creates more problems than it solves. Each feature deserves to be discussed and merged on its own merits.
Thanks for understanding!

@JW-CH JW-CH closed this Feb 6, 2026
@nopoz
Copy link
Author

nopoz commented Feb 6, 2026

@nopoz I understand the merge conflict situation, but combining three features into one PR makes review much harder. The problems:

* Mixed discussions - Temperature display and people filtering are unrelated features that need separate evaluation

* Different concerns - @3rob3's UX question about temperature units shouldn't block ExcludedPeople (and vice versa)

* API limitations differ - ExcludedPeople only works with People filter, not Albums, which needs more discussion

My request: Please split this back into separate PRs. I know rebasing is extra work, but reviewing three features as a package deal creates more problems than it solves. Each feature deserves to be discussed and merged on its own merits. Thanks for understanding!

@JW-CH The separate PRs already exist (#549, #553, #561) — they just have rebase conflicts. This combined PR is those PRs, rebased onto current main with the conflicts resolved.

Splitting them back out would mean re-doing that rebase work three times, and they'd immediately conflict with each other again since they touch the same files (IServerSettings.cs, ServerSettings.cs, ClientSettingsDto.cs). Merging them sequentially would require someone to resolve the same conflicts repeatedly.

I understand the preference for single-feature PRs, but in this case the features share interface and model changes that make them genuinely interdependent from a merge perspective. The discussion can still happen per-feature — you and @3rob3 are already doing that effectively here. Any code changes that come out of those discussions can be made directly in this PR.

Would it help if I added clearer commit separation or section headers in the PR description to make review easier?

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