Render output: Effects and Check sections, Size presets panel and the Check chip (#6281) (#7233)

* Render output: Effects and Check sections, Size presets panel and the Check tool chip

* Render output: Sampling, Effects and Check editors as child rows under Output

* fix: restrict legacy Output controls to test builds

* fix: cover status controls and reveal Effects test targets

* fix: include shared quality reviews in copied check reports

* fix: remove the obsolete Effects GPU guard after Wear integration
This commit is contained in:
Nathan Dane
2026-10-29 04:39:34 +00:00
committed by GitHub
parent c1925bb219
commit bd8cb4e6d6
23 changed files with 2149 additions and 418 deletions
+33
View File
@@ -1,5 +1,6 @@
//! Planned Render interactions, with explicit non-mutating refusals.
use super::CommandSpec;
use crate::schema::{TypedContract, output_schema_for, render_ui::CheckReport};
use crate::{Result, Session, params::bad};
use serde::Deserialize;
use serde_json::{Value, json};
@@ -17,7 +18,16 @@ macro_rules! waiting {
};
}
const CHECK_REPORT: TypedContract<CheckReport> = TypedContract::new();
pub static COMMANDS: &[CommandSpec] = &[
CommandSpec::new("render.preflight.copy", "Copy Render Check Report", crate::checked!("render.preflight.copy", copy_check))
.icon("copy")
.contract(&CHECK_REPORT)
.output(output_schema_for::<CheckReport>)
.noundo()
.doc_only()
.params("text: nonempty report, at most 65536 bytes. Validated clipboard request; headless echo only, never renders or edits a design."),
CommandSpec::new("render.output.size", "Set Render Output Size", output_size)
.icon("settings")
.noundo()
@@ -47,6 +57,14 @@ pub static COMMANDS: &[CommandSpec] = &[
waiting!("render.batch", "Render All Shots", "RENDER", "BATCH", "render_image", "the saved-shot render queue"),
];
fn copy_check(_: &mut Session, params: &Value) -> Result<Value> {
let report: CheckReport = serde_json::from_value(params.clone()).map_err(|e| bad("render.preflight.copy", e.to_string()))?;
if report.text.is_empty() || report.text.len() > 65536 {
return Err(bad("render.preflight.copy", "report must contain 1..65536 bytes"));
}
Ok(json!({"text":report.text}))
}
#[cfg(test)]
#[test]
fn render_workspace_planned_commands_refuse_without_mutation() {
@@ -142,3 +160,18 @@ fn output_viewer_requests_are_validated_headless_echoes() {
assert!(std::sync::Arc::ptr_eq(&document, &s.doc));
assert_eq!(before, (s.revision, s.undo.len(), s.evaluations));
}
#[cfg(test)]
#[test]
fn output_sections_copy_report_validates_without_design_history_or_job_changes() {
let mut s = Session::default();
let doc = s.doc.clone();
let before = (s.revision, s.undo.len(), s.redo.len(), s.evaluations, s.is_dirty());
let report = json!({"text":"Check\n✓ Size is within the renderer limit"});
assert_eq!(s.execute("render.preflight.copy", &report).unwrap(), report);
for request in [json!({}), json!({"text":""}), json!({"text":true}), json!({"text":"check","job":1}), json!({"text":"x".repeat(65537)})] {
assert!(s.execute("render.preflight.copy", &request).is_err());
}
assert!(std::sync::Arc::ptr_eq(&doc, &s.doc));
assert_eq!(before, (s.revision, s.undo.len(), s.redo.len(), s.evaluations, s.is_dirty()));
}
+12 -8
View File
@@ -4,7 +4,7 @@ use solidcraft_render::{Camera, StandardView};
use super::CommandSpec;
use crate::params::{bad, num, req_vec2, req_vec3, vec3};
use crate::schema::view_navigation::{RenderBrowser, RenderFocus, TabStep, TabStepParams};
use crate::schema::view_navigation::{RenderBrowser, RenderFocus, RenderSelect, TabStep, TabStepParams};
use crate::schema::{TypedContract, output_schema_for};
use crate::{Result, Sel, Session};
@@ -31,6 +31,8 @@ struct RenderBrowserControls {
query: Option<String>,
}
const RENDER_SELECT: TypedContract<RenderSelect> = TypedContract::new();
pub static COMMANDS: &[CommandSpec] = &[
CommandSpec::new("view.fit", "Fit", fit)
.icon("fit").key("F6").noundo().doc_only().params("no parameters → frame the active canvas or selection; display only"),
@@ -60,10 +62,9 @@ CommandSpec::new("view.render_inspector", "Render Inspector", render_inspector)
.icon("inspect").noundo().doc_only()
.params("visible: bool → {visible}; per-document Inspector visibility; never edits the design or opens a dialog"),
CommandSpec::new("view.render_select", "Render selection", crate::checked!("view.render_select", render_select))
.contract(&RENDER_SELECT_CONTRACT)
.output(crate::schema::output_schema_for::<crate::schema::view_navigation::RenderSelect>)
.contract(&RENDER_SELECT).output(output_schema_for::<RenderSelect>)
.icon("select").noundo().doc_only()
.params("kind: nothing|environment|light|shot|output|wear; id?: bounded nonempty string for light/shot → validated transient Browser focus; never edits the design or opens a dialog"),
.params("kind: nothing|environment|light|shot|output|wear|sampling|effects|check; id?: bounded nonempty string for light/shot → validated transient Browser focus; never edits the design or opens a dialog"),
CommandSpec::new("view.render_stage", "Render Stage", render_stage)
.icon("render_scene").noundo().doc_only()
.params("stage: look|light|frame|output → {stage}; per-document UI state, never edits or evaluates the design; headless validation only"),
@@ -269,11 +270,8 @@ fn render_focus(_s: &mut Session, p: &Value) -> Result<Value> {
Ok(json!(request))
}
const RENDER_SELECT_CONTRACT: crate::schema::TypedContract<crate::schema::view_navigation::RenderSelect> = crate::schema::TypedContract::new();
fn render_select(s: &mut Session, p: &Value) -> Result<Value> {
let request: crate::schema::view_navigation::RenderSelect =
serde_json::from_value(p.clone()).map_err(|e| bad("view.render_select", e.to_string()))?;
let request: RenderSelect = serde_json::from_value(p.clone()).map_err(|e| bad("view.render_select", e.to_string()))?;
let result = serde_json::to_value(request).map_err(|e| bad("view.render_select", e.to_string()))?;
if !s.selection.is_empty() {
s.selection.clear();
@@ -1143,6 +1141,9 @@ fn render_browser_focus_validates_without_document_changes_or_evaluation() {
json!({"kind":"light","id":"sun:0"}),
json!({"kind":"shot","id":"Hero"}),
json!({"kind":"output"}),
json!({"kind":"sampling"}),
json!({"kind":"effects"}),
json!({"kind":"check"}),
] {
assert_eq!(session.execute("view.render_select", &request).unwrap(), request);
}
@@ -1159,6 +1160,9 @@ fn render_browser_focus_validates_without_document_changes_or_evaluation() {
json!({"kind":"light","id":" "}),
json!({"kind":"shot","id":"x".repeat(1025)}),
json!({"kind":"output","id":"extra"}),
json!({"kind":"sampling","id":"extra"}),
json!({"kind":"effects","id":"extra"}),
json!({"kind":"check","id":"extra"}),
json!({"kind":"environment","extra":true}),
] {
assert!(session.execute("view.render_select", &request).is_err(), "{request}");