Implement adaptive inspector, mask clock repair, and selectable face mosaic; validation pending

这个提交包含在:
mac 于 2026-11-06 15:56:42 +08:00 提交
1 父节点 f05cf05451
当前提交 3b4c612edf
19 个文件已更改
+245 -103

没有与搜索条件相匹配的文件

@@ -1,21 +1,25 @@
// Presentation-only changes must never rewrite a host's grading parameters.
{
DYDiagnosticManager *host=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(host,nil);
NSDictionary *values=[[host->_values copy]autorelease],*custom=[[host->_custom copy]autorelease];int starts=host->_undoStarts,ends=host->_undoEnds;
NSDictionary *values=[[host->_values copy]autorelease],*custom=[[host->_custom copy]autorelease];(void)custom;int starts=host->_undoStarts,ends=host->_undoEnds;
DYInspector *view=[[[DYInspector alloc]initWithAPIManager:host]autorelease];
NSButton *settings=[view valueForKey:@"colorSettings"];NSView *panel=[view valueForKey:@"managedPanel"];NSArray *cards=[view valueForKey:@"cards"];
BOOL expanded=YES;NSUInteger visible=0;CGFloat bottom=0;
for(NSDictionary *card in cards)if(![card[@"removed"]boolValue]){expanded&=![card[@"collapsed"]boolValue];visible++;bottom=MAX(bottom,NSMaxY([card[@"view"]frame]));}
NSView *document=[view valueForKey:@"document"];NSView *brandLabel=[view valueForKey:@"brand"];
run.record(@"inspector-all-existing-modules-expanded-before-host-creation",expanded&&visible==DYToolTypes().count&&!panel.hidden,@{@"visibleModules":@(visible),@"height":@(view.frame.size.height)});
run.record(@"inspector-returned-frame-contains-complete-expanded-document",NSMaxY(document.frame)<=view.frame.size.height&&bottom<=document.bounds.size.height&&view.frame.size.height==view.intrinsicContentSize.height);
run.record(@"inspector-complete-content-has-no-inner-scroll-view",[view valueForKey:@"scroll"]==nil&&NSContainsRect(view.bounds,brandLabel.frame));
for(int i=0;i<10;i++){[settings performClick:nil];for(NSDictionary *card in cards)[card[@"header"]performClick:nil];[view layoutSubtreeIfNeeded];}
expanded=YES;for(NSDictionary *card in cards)expanded&=![card[@"collapsed"]boolValue];
run.record(@"inspector-headers-keep-modules-expanded-without-editing-grade",expanded&&!panel.hidden&&[values isEqual:host->_values]&&[custom isEqual:host->_custom]&&starts==host->_undoStarts&&ends==host->_undoEnds);
DYInspectorToken *folds=[[[DYInspectorToken alloc]init]autorelease];folds.folds=@{@"primary":@YES,@"hsl":@YES};[host setCustomParameterValue:folds toParameter:DYInspectorParameterID atTime:kCMTimeZero];
[view refresh];expanded=YES;for(NSDictionary *card in cards)expanded&=![card[@"collapsed"]boolValue];
run.record(@"inspector-old-fold-state-does-not-collapse-new-presentation",expanded&&[DYReadTools(host,kCMTimeZero).document isKindOfClass:NSDictionary.class]);
BOOL defaults=YES;NSUInteger visible=0,expanded=0;CGFloat bottom=0;
for(NSDictionary *card in cards)if(![card[@"removed"]boolValue]){BOOL open=[@[@"primary",@"base",@"spider"]containsObject:card[@"section"][@"key"]];defaults&=[card[@"collapsed"]boolValue]!=open;expanded+=![card[@"collapsed"]boolValue];visible++;bottom=MAX(bottom,NSMaxY([card[@"view"]frame]));}
NSView *document=[view valueForKey:@"document"],*brandLabel=[view valueForKey:@"brand"];NSScrollView *scroll=[view valueForKey:@"scroll"];
run.record(@"inspector-default-opens-three-tools-and-retains-other-headers",defaults&&expanded==3&&visible==DYToolTypes().count&&panel.hidden,@{@"visibleModules":@(visible),@"height":@(view.frame.size.height)});
run.record(@"inspector-default-complete-stack-fits-without-inner-scroll",scroll&&!scroll.hasVerticalScroller&&document.bounds.size.height<=scroll.contentSize.height+.5&&bottom<=document.bounds.size.height&&NSContainsRect(view.bounds,brandLabel.frame));
CGFloat originalHeight=view.frame.size.height;
for(NSDictionary *card in cards)if([card[@"collapsed"]boolValue])[card[@"header"]performClick:nil];[view layoutSubtreeIfNeeded];
run.record(@"inspector-expansion-enters-scroll-with-stable-host-allocation",scroll.hasVerticalScroller&&document.bounds.size.height>scroll.contentSize.height&&view.frame.size.height==originalHeight);
[document scrollPoint:NSMakePoint(0,document.bounds.size.height)];
for(NSDictionary *card in cards)if(![@[@"primary",@"base",@"spider"]containsObject:card[@"section"][@"key"]])[card[@"header"]performClick:nil];[view layoutSubtreeIfNeeded];
run.record(@"inspector-collapse-removes-scroll-and-clamps-former-bottom-offset",!scroll.hasVerticalScroller&&scroll.contentView.bounds.origin.y==0&&[values isEqual:host->_values]&&starts==host->_undoStarts&&ends==host->_undoEnds);
NSMutableDictionary *doc=DYMutablePlist(DYReadTools(host,kCMTimeZero).document);DYInsertTool(doc,@"spider",@"base:spider");DYWriteTools(host,doc,kCMTimeZero);[view refresh];[view layoutSubtreeIfNeeded];
run.record(@"inspector-added-module-is-reachable-in-scroll",scroll.hasVerticalScroller&&view.frame.size.height==originalHeight&&[[view valueForKey:@"stackViews"]count]==1);
DYInspectorToken *folds=[[[DYInspectorToken alloc]init]autorelease];folds.folds=@{@"primary":@YES,@"hsl":@NO};[host setCustomParameterValue:folds toParameter:DYInspectorParameterID atTime:kCMTimeZero];[view refresh];
BOOL restored=YES;for(NSDictionary *card in cards){NSString *key=card[@"section"][@"key"];if([key isEqual:@"primary"])restored&=[card[@"collapsed"]boolValue];if([key isEqual:@"hsl"])restored&=![card[@"collapsed"]boolValue];}
run.record(@"inspector-saved-disclosure-is-restored-without-grading-changes",restored&&[values isEqual:host->_values]);
for(NSDictionary *state in @[@{},DYManagedColorDefaults(),DYPrimaryColorDefaults(),DYUnifiedColorDefaults()]){
DYAssetState *assets=[[[DYAssetState alloc]init]autorelease];assets.colorManagement=state.count?state:nil;DYWriteAssets(host,assets,kCMTimeZero);[view refresh];NSDictionary *snapshot=[view presetSnapshot];[settings performClick:nil];
run.record([NSString stringWithFormat:@"expanded-settings-preserve-CMS-version-%@",state[@"version"]?:@1],[[view presetSnapshot]isEqual:snapshot]);