Repository navigation
feat(cloud): show machine creator on sidebar rows #16001
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
15 commits
Select commit
Hold shift + click to select a range
97fbfa5
test(cloud): pin the machine creator label on the row
teamleaderleo 175b928
feat(cloud): show machine creator on sidebar rows
teamleaderleo 55a40ff
Merge main (5eda9315bba4) into cloud-sidebar-machine-creator-v2
teamleaderleo 22b46f1
Merge main (40a636edacb3) into cloud-sidebar-machine-creator-v2
teamleaderleo 7109b4d
Merge main (e709b69d8c8) into cloud-sidebar-machine-creator-v2
teamleaderleo 71feafa
Merge main (018394256b15) into cloud-sidebar-machine-creator-v2
teamleaderleo 11ddf34
Merge main (6e81710f1766) into cloud-sidebar-machine-creator-v2
teamleaderleo 19c191f
Merge main (57fd5ac4df76) into cloud-sidebar-machine-creator-v2
teamleaderleo 0236269
Merge remote-tracking branch 'origin/main' into cloud-sidebar-machine…
teamleaderleo 48cdaf5
Merge remote-tracking branch 'origin/main' into cloud-sidebar-machine…
teamleaderleo e82fa6b
Merge remote-tracking branch 'origin/main' into cloud-sidebar-machine…
teamleaderleo c18329e
Merge remote-tracking branch 'origin/main' into cloud-sidebar-machine…
teamleaderleo f2e0489
Merge main (3aebe4596dc5) into cloud-sidebar-machine-creator-v2
teamleaderleo 2b67afe
Merge main (b63122eb0a24) into cloud-sidebar-machine-creator-v2
teamleaderleo 9978670
Merge remote-tracking branch 'origin/main' into HEAD
teamleaderleo 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
Large diffs are not rendered by default.
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,22 @@ | ||
| import CmuxCloud | ||
| import Foundation | ||
|
|
||
| /// How a Cloud machine's author reads on its row. | ||
| /// | ||
| /// Its own file, away from the row content, for a dull reason worth writing | ||
| /// down: `scripts/localize-changes` cannot parse a `defaultValue` containing a | ||
| /// `\u{...}` escape, and `CloudTreeMachineRowContent` has several. A new string | ||
| /// added there is invisible to the tool, so it lives here where the tool can | ||
| /// see it. | ||
| struct CloudMachineCreatorLabel { | ||
| /// Nil when there is nothing worth showing: no author, or an author whose | ||
| /// name nobody has recorded. The account id is deliberately not a fallback. | ||
| /// A row reading "by 7f3a91c2" is the same unreadable list of generated | ||
| /// names this is meant to fix, with one more opaque token in it. | ||
| static func text(creator: VMCreator?) -> String? { | ||
| guard let name = creator?.displayName?.trimmingCharacters(in: .whitespacesAndNewlines), | ||
| !name.isEmpty | ||
| else { return nil } | ||
| return String(format: String(localized: "machines.row.createdBy", defaultValue: "by %@"), name) | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| { | ||
| "launch": { | ||
| "args": [ | ||
| "-fileExplorer.isVisible", | ||
| "YES" | ||
| ] | ||
| }, | ||
| "steps": [ | ||
| { | ||
| "wait": 1.5 | ||
| }, | ||
| { | ||
| "click": "RightSidebarModeButton.machines" | ||
| }, | ||
| { | ||
| "wait": 1.2 | ||
| }, | ||
| { | ||
| "shot": "10-right-sidebar-cloud" | ||
| }, | ||
| { | ||
| "menu": [ | ||
| "Help", | ||
| "Cloud Sidebar Spacing Lab…" | ||
| ] | ||
| }, | ||
| { | ||
| "wait": 1.5 | ||
| }, | ||
| { | ||
| "shot": "20-lab-compact", | ||
| "screen": true | ||
| }, | ||
| { | ||
| "tree": "20-lab-compact" | ||
| }, | ||
| { | ||
| "click": "CloudSidebarDebugLab.preset" | ||
| }, | ||
| { | ||
| "wait": 0.6 | ||
| }, | ||
| { | ||
| "tree": "21-preset-menu" | ||
| }, | ||
| { | ||
| "key": "a" | ||
| }, | ||
| { | ||
| "key": "return" | ||
| }, | ||
| { | ||
| "wait": 1.2 | ||
| }, | ||
| { | ||
| "shot": "30-lab-aero", | ||
| "screen": true | ||
| }, | ||
| { | ||
| "tree": "30-lab-aero" | ||
| } | ||
| ], | ||
| "paths": [ | ||
| "Sources/Cloud/*", | ||
| "Packages/macOS/CmuxCloud/*" | ||
| ] | ||
| } |
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep creator-label formatting on the row owner.
CloudMachineCreatorLabelis a stateless static-only namespace. The row calls it while computing subtitle and accessibility text, repeating Foundation formatting for creator-bearing rows. Move the label method to an instance helper onCloudTreeMachineRowContentand use localized interpolation instead ofString(format:).As per path instructions,
.github/review-bot-rules/no-ambient-global-state.mdsays to avoid “static-helper namespace types,” and.github/review-bot-rules/hot-path-allocating-formatting.mdflags per-rowString(format:).Also applies to: 16-20
🤖 Prompt for AI Agents
Source: Path instructions