Repository navigation
Add a Themes settings page listing every terminal theme; TextBox leaves beta #15112
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
Show all changes
26 commits
Select commit
Hold shift + click to select a range
df549e8
test: Themes settings page lists every terminal theme
lawrencecchen 063be16
Add a Themes settings page with every terminal theme; drop TextBox be…
lawrencecchen 0d57e74
test: sidebar matches the terminal background by default
lawrencecchen 34bf127
Match the terminal background in the sidebar by default
lawrencecchen 95f2198
test: secondary chrome color holds a contrast floor
lawrencecchen bc86a58
Hold sidebar secondary text at 3.5:1 over terminal-matched backdrops
lawrencecchen 477b711
Pick titlebar and tab bar text by WCAG contrast
lawrencecchen 88abb8a
Keep titlebar symbols at full color when the window is inactive
lawrencecchen 4fdf8d5
test: a theme pick applies to the appearance in use
lawrencecchen 60fdbd0
Theme gallery: one theme by default, cheaper cards, App Icon under Th…
lawrencecchen 01b3096
test: the gallery highlights and writes one theme
lawrencecchen a6db28c
Theme gallery owns one theme: drop the light/dark checkbox and tabs
lawrencecchen 7f1e586
Fix the light-theme sidebar top wash and unify Cmd-hold hint colors
lawrencecchen 2da993b
Fix titlebarControlAppearance: explicit return, single @MainActor
lawrencecchen dbce5e5
test: Cmd-hold hints fade in unless Reduce Motion
lawrencecchen b3dd75c
Fade Cmd-hold hints in as well as out
lawrencecchen 47f347c
Stop the Themes page shifting sideways as it opens
lawrencecchen 0e9571d
test: gallery follows appearance changes and picks up added themes
lawrencecchen aba9b52
Address review: live appearance, refreshed theme cache, card tooltip
lawrencecchen c57f785
Merge commit '95c158b60fc5fc3cfa936ea6638769d85a26f297' into feat-set…
lawrencecchen e9f5840
Merge main (89841a8278f8) into feat-settings-themes-category
lawrencecchen 6ec9bb5
Keep TextBox docs descriptions within the 110-160 SEO bounds
lawrencecchen a81f74f
ci: rerun checks with the no-full-ci label
lawrencecchen 88590a4
Merge commit '31014dcd486779cda1ef0924fea9c5583cab1b2c' into feat-set…
lawrencecchen 7c9fa70
test: expect pane exit to hide the drop preview at once
lawrencecchen e93327a
test(hermes): let the hang guard outlast the installer budget
lawrencecchen 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
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
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
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
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
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
19 changes: 19 additions & 0 deletions
19
...ages/macOS/CmuxAppKitSupportUI/Tests/CmuxAppKitSupportUITests/BitmapViewLayoutTests.swift
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,19 @@ | ||
| import AppKit | ||
| import Testing | ||
|
|
||
| @testable import CmuxAppKitSupportUI | ||
|
|
||
| /// `BitmapView` replaces `NSImageView` for hosted icons, so it must keep the | ||
| /// `.scaleProportionallyDown` + `.alignCenter` layout icons were tuned for. | ||
| @Suite struct BitmapViewLayoutTests { | ||
| @Test func smallerImageKeepsItsSizeAndIsCentered() { | ||
| let rect = BitmapView.drawRect(imageSize: NSSize(width: 14, height: 14), in: NSRect(x: 0, y: 0, width: 22, height: 22)) | ||
| #expect(rect == NSRect(x: 4, y: 4, width: 14, height: 14)) | ||
| } | ||
|
|
||
| @Test func largerImageShrinksProportionally() { | ||
| let rect = BitmapView.drawRect(imageSize: NSSize(width: 40, height: 20), in: NSRect(x: 0, y: 0, width: 20, height: 20)) | ||
| #expect(rect.size == NSSize(width: 20, height: 10)) | ||
| #expect(rect.midY == 10) | ||
| } | ||
| } |
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
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
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
47 changes: 47 additions & 0 deletions
47
.../CmuxAppKitSupportUITests/WindowChrome/Color/WindowChromeColorResolverContrastTests.swift
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,47 @@ | ||
| import AppKit | ||
| import Testing | ||
|
|
||
| @testable import CmuxAppKitSupportUI | ||
|
|
||
| @Suite struct WindowChromeColorResolverContrastTests { | ||
| private let resolver = WindowChromeColorResolver() | ||
|
|
||
| /// Hot Dog Stand's red backdrop took half-opacity black secondary text to | ||
| /// about 2.6:1; the floor raises only the opacity until it reads. | ||
| @Test func saturatedBackdropRaisesSecondaryOpacityToTheFloor() throws { | ||
| let red = try #require(NSColor(hex: "#E44330")) | ||
| let secondary = NSColor(srgbRed: 0, green: 0, blue: 0, alpha: 0.5) | ||
| #expect(contrast(secondary, over: red) < 3.5) | ||
|
|
||
| let floored = resolver.contrastFloored(secondary, over: red, minimumContrast: 3.5) | ||
|
|
||
| #expect(contrast(floored, over: red) >= 3.5) | ||
| #expect(floored.alphaComponent > secondary.alphaComponent) | ||
| #expect(floored.alphaComponent < 1) | ||
| } | ||
|
|
||
| /// Neutral themes keep the system secondary color untouched. | ||
| @Test func readableSecondaryIsReturnedUnchanged() throws { | ||
| let white = try #require(NSColor(hex: "#FFFFFF")) | ||
| let secondary = NSColor(srgbRed: 0, green: 0, blue: 0, alpha: 0.5) | ||
|
|
||
| let floored = resolver.contrastFloored(secondary, over: white, minimumContrast: 3.5) | ||
|
|
||
| #expect(floored.alphaComponent == secondary.alphaComponent) | ||
| } | ||
|
|
||
| /// When even the opaque color cannot reach the floor, the most readable | ||
| /// version, fully opaque, is returned. | ||
| @Test func unreachableFloorReturnsOpaqueColor() throws { | ||
| let gray = try #require(NSColor(hex: "#777777")) | ||
| let secondary = NSColor(srgbRed: 1, green: 1, blue: 1, alpha: 0.5) | ||
|
|
||
| let floored = resolver.contrastFloored(secondary, over: gray, minimumContrast: 7) | ||
|
|
||
| #expect(floored.alphaComponent == 1) | ||
| } | ||
|
|
||
| private func contrast(_ foreground: NSColor, over background: NSColor) -> CGFloat { | ||
| resolver.contrastRatio(resolver.compositedColor(foreground, over: background), background) | ||
| } | ||
| } |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Align the icon origin in backing pixels, not whole points.
When a 15-point image occupies a 22-point slot, its centered origin is 3.5 points. Rounding that origin to 4 points shifts the icon one device pixel on a 2× display. Align using the view’s backing coordinates, and add an odd-sized layout case to
BitmapViewLayoutTests. AppKit provides backing-coordinate conversion for pixel alignment. (developer.apple.com)🤖 Prompt for AI Agents