Repository navigation
feat(core): add G502 HERO gaming layout #2293
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
base: master
Are you sure you want to change the base?
Changes from 9 commits
53cb306
a32f5a8
0ba0865
a5d5671
b421809
dac50ea
402ae8d
0a83bde
5999cbb
12e78ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,6 +167,7 @@ fn main_view(path: PathBuf, side: Option<&SideView>, front: Option<&PathBuf>) -> | |
|
|
||
| fn resolve_side_view( | ||
| dir: &Path, | ||
| depot: &str, | ||
| entry: &DeviceEntry, | ||
| manifest: Option<&DepotManifest>, | ||
| extended_model_id: u8, | ||
|
|
@@ -175,12 +176,12 @@ fn resolve_side_view( | |
| metadata | ||
| .image(SIDE_VIEW_KEY) | ||
| .filter(|image| !image.assignments.is_empty())?; | ||
| let variant = manifest.and_then(|m| { | ||
| entry.model_id_candidates().find_map(|base| { | ||
| m.resource_for_variant(base, extended_model_id, SIDE_VIEW_KEY) | ||
| .map(str::to_string) | ||
| }) | ||
| }); | ||
| // Resolve the side render through the same candidate bases the front | ||
| // render uses (which include the depot name), so depots that key their | ||
| // manifest variants on the depot name rather than a registry model id | ||
| // still resolve. | ||
| let variant = manifest | ||
| .and_then(|m| find_variant_in_manifest(m, entry, depot, extended_model_id, side_image_for)); | ||
|
Comment on lines
+185
to
+186
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I checked the existing tests: the depot-named base render uses Rule Used: Severity: medium. Every bug fix ships a regression test that fails without the fix, and the PR states the counter-proof (the reverted line or the killed mutant). A test that passes with the fix reverted is not a regression test: ask for inputs where ... (source) Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| let (image_path, (png_width, png_height)) = variant | ||
| .into_iter() | ||
| .chain(["side.png".to_string()]) | ||
|
|
@@ -429,7 +430,8 @@ impl AssetResolver { | |
| debug!(depot, root = %root.display(), "depot ships no hotspot metadata — rendering image without hotspots"); | ||
| Metadata::default() | ||
| }; | ||
| let side_view = resolve_side_view(&dir, entry, manifest.as_ref(), ext, &metadata); | ||
| let side_view = | ||
| resolve_side_view(&dir, depot, entry, manifest.as_ref(), ext, &metadata); | ||
| let image_path = main_view(image_path, side_view.as_ref(), hero_image_path.as_ref()); | ||
| let (png_width, png_height) = match read_image_dimensions(&image_path) { | ||
| Ok(dims) => dims, | ||
|
|
||
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.
Blocking. The repository requires each bug fix to have a regression test that fails without it. The new
safe_component_pathassertion only compares paths. Both existingwrite_replacetests use an existing parent directory, and everyis_optional_assettest uses a flat name. Those tests still pass if parent creation or nested side-render selection is removed.Add
write_replace_creates_nested_parentsandnested_side_render_is_optional, then record which reverted lines make them fail in the PR.Rule Used: Severity: medium. Every bug fix ships a regression test that fails without the fix, and the PR states the counter-proof (the reverted line or the killed mutant). A test that passes with the fix reverted is not a regression test: ask for inputs where ... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!