Add DeviceDetector.NET.Icons extension (icon path resolution)#103
Merged
Conversation
totpero
force-pushed
the
icon-integration
branch
from
July 13, 2026 08:44
0f51922 to
65307c5
Compare
totpero
marked this pull request as ready for review
July 13, 2026 08:45
totpero
force-pushed
the
icon-integration
branch
from
July 13, 2026 08:48
65307c5 to
414f1a2
Compare
totpero
pushed a commit
that referenced
this pull request
Jul 14, 2026
Resolved conflicts in DeviceDetector.NET.sln: kept both the new DeviceDetector.NET.Cli project entries (local) and the DeviceDetector.NET.Icons / DeviceDetector.NET.Icons.Tests entries (origin, PR #103). Dropped one duplicated ProjectConfigurationPlatforms block for the Web/Serilog-enricher GUIDs that was identical to content already present elsewhere in the file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #101 — adds a new
DeviceDetector.NET.Iconsextension project that resolves icon filepaths for detection results (bots, browsers, operating systems, clients, device brands/types),
porting the resolution/fallback/sanitization logic of
Simbiat/DeviceDetectorIcons (MIT licensed).
No icon image assets are vendored — consumers point
IconResolverat their own copy of an iconpack.
Design and implementation plan (not included in this branch — internal planning docs kept out of
the repo):
docs/superpowers/specs/2026-07-10-icon-integration-design.mdanddocs/superpowers/plans/2026-07-10-icon-integration.md.What's included
DeviceDetector.NET.Iconsproject (netstandard2.0;net462;net8.0;net9.0;net10.0)IconResolverOptionswith defaults matching upstreamDDCIcons.php(extension priority,name-sanitization table, fallback icon, URL base path)
IconResolver: full 1:1 port of the PHP resolution/fallback-chain logic (bot→category,browser→family→engine→generic, os→family→generic, client→type, brand→device-type), plus
convenience overloads accepting
DeviceDetector.NET's own result types(
GetBot(BotMatchResult),GetBrowser(BrowserMatchResult), etc.) and a one-shotGetIcons(DeviceDetectorResult)returning aDeviceIconPathsbundleAddDeviceDetectorIcons(...)DI registration helper (IServiceCollectionextension)FileExistsoverride (e.g. to back it with anIFileProvider/CDN instead of raw disk)NameReplacementstableordering, name sanitization, result-type overloads, a
FileExistsoverride test, aNameReplacementsextension test, DI registration, and 2 end-to-end tests against real parseduser agents (Chrome/Windows, Googlebot)
Test plan
dotnet test DeviceDetector.NET.Icons.Tests/DeviceDetector.NET.Icons.Tests.csproj— 42/42 passingdotnet build DeviceDetector.NET.sln— builds clean across all target frameworks, 0 warnings/errorsDeviceDetector.NET.Testsbaseline (206/206) confirmed clean before this branch's work started; no production code in the coreDeviceDetector.NETproject was touched by this PR