Repository navigation
fix(logos): ship every provider mark as colour/light/dark PNG triplets #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| import AppKit | ||
| import XCTest | ||
| @testable import CodeCaps | ||
|
|
||
| /// Every provider mark must ship three explicit variants — colour, light ink and | ||
| /// dark ink — and every one of them must resolve through the real loader. | ||
| /// | ||
| /// The owner reported that no provider logo appeared at all except the one | ||
| /// custom mark on disk. Measurement ruled out the obvious causes: the assets | ||
| /// were present, `Bundle.url(forResource:)` found every one, and | ||
| /// `PlatformLogoImage.load` returned a valid image for all eighteen provider | ||
| /// keys in a test process. What was left was the delivery itself — the marks | ||
| /// were SVGs, which come back as `_NSSVGImageRep`, a PRIVATE AppKit class, and | ||
| /// the Muse rasters had an opaque white background baked in. | ||
| /// | ||
| /// These assertions pin the delivered contract rather than a particular | ||
| /// implementation: whatever draws a mark must be an `NSBitmapImageRep`, so a | ||
| /// private rep cannot creep back in through any path. | ||
| final class ProviderMarkTripletTests: XCTestCase { | ||
| private static let providerKeys = [ | ||
| "anthropic", "claude", "openai", "codex", | ||
| "google-antigravity", "antigravity", | ||
| "google-antigravity:gemini", "google-antigravity:third-party", "gemini", | ||
| "xai", "grok", "grok-cli", "grok-bot", | ||
| "minimax", "muse", "muse-assist", "muse-code", "cursor", | ||
| ] | ||
|
|
||
| override func setUp() { | ||
| super.setUp() | ||
| PlatformLogoImage.invalidateCaches() | ||
| } | ||
|
|
||
| func testEveryProviderResolvesInEveryStyleAndAppearance() { | ||
| var unresolved: [String] = [] | ||
| for key in Self.providerKeys { | ||
| for style in [MarkStyle.standard, .template] { | ||
| for isDark in [false, true] { | ||
| if PlatformLogoImage.load(providerKey: key, style: style, isDarkMode: isDark) == nil { | ||
| unresolved.append("\(key) \(style.rawValue) \(isDark ? "dark" : "light")") | ||
| } | ||
| } | ||
| } | ||
| } | ||
| XCTAssertTrue(unresolved.isEmpty, | ||
| "these marks drew the placeholder glyph: \(unresolved.joined(separator: ", "))") | ||
| } | ||
|
|
||
| /// The failure that started this was an SVG resolving to `_NSSVGImageRep`. | ||
| /// Whatever the artwork, a delivered mark must be a bitmap. | ||
| func testEveryDeliveredMarkIsABitmapNotAPrivateRepresentation() { | ||
| for key in Self.providerKeys { | ||
| for style in [MarkStyle.standard, .template] { | ||
| for isDark in [false, true] { | ||
| guard let image = PlatformLogoImage.load(providerKey: key, style: style, isDarkMode: isDark) else { continue } | ||
| XCTAssertTrue(image.representations.first is NSBitmapImageRep, | ||
| "\(key) \(style.rawValue) came back as " | ||
| + "\(image.representations.first.map { String(describing: type(of: $0)) } ?? "no representation")" | ||
| + ", which is the private-rep path the owner reported as invisible.") | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// A mark must not carry an opaque background, which is what made the Muse | ||
| /// PNGs read as a white box on any non-white surface. | ||
| func testNoDeliveredMarkHasAnOpaqueBackground() { | ||
| for key in Self.providerKeys { | ||
| for style in [MarkStyle.standard, .template] { | ||
| guard let image = PlatformLogoImage.load(providerKey: key, style: style), | ||
| let rep = image.representations.first as? NSBitmapImageRep, | ||
| rep.pixelsWide > 0, rep.pixelsHigh > 0 else { continue } | ||
| let corner = rep.colorAt(x: 0, y: 0) | ||
| XCTAssertNotEqual(corner?.alphaComponent ?? 0, 1.0, | ||
| "\(key) \(style.rawValue) has an opaque background; it would draw as a white box.") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// Light and Dark are different ink, not the same file twice, so a Dark | ||
| /// surface never gets a black silhouette that vanishes into it. | ||
| func testLightAndDarkVariantsDiffer() { | ||
| for key in Self.providerKeys { | ||
| guard let light = PlatformLogoImage.load(providerKey: key, style: .template, isDarkMode: false), | ||
| let dark = PlatformLogoImage.load(providerKey: key, style: .template, isDarkMode: true) else { | ||
| continue | ||
| } | ||
| XCTAssertNotEqual(light.representations.first as? NSBitmapImageRep, | ||
| dark.representations.first as? NSBitmapImageRep, | ||
| "\(key) served one identical silhouette for both appearances.") | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.