Restore document center operational shell

This commit is contained in:
ZacharyZhang-NY committed 2026-04-19 17:42:23 -04:00
1 parent 5d0bd6f34b
commit caf2c7b337
3 files changed
+96 -49

No files matched your search

@@ -14,39 +14,25 @@ impl AppRoot {
.flex() .flex()
.flex_col() .flex_col()
.gap_6() .gap_6()
.child(render_document_header(total_count, cx))
.child( .child(
div() div()
.flex() .grid()
.justify_between() .grid_cols(2)
.items_center() .gap_4()
.child( .child(
div() div()
.child( .gap_4()
div() .child(document_section_label("DOCUMENTS PROSE"))
.text_2xl() .child(self.render_document_prose_list(cx, selected))
.text_color(theme::text_primary()) .when(!work_products.is_empty(), |container| {
.child("Document Center"), container
) .child(document_section_label("WORK PRODUCTS"))
.child( .child(render_work_products(work_products.as_slice()))
div() }),
.mt(px(6.0))
.text_sm()
.text_color(theme::text_muted())
.child(format!("{} items", total_count)),
),
) )
.child(primary_button("Save draft", cx, |this, cx| { .child(self.render_document_editor_surface(selected)),
this.create_document(cx)
})),
) )
.child(document_section_label("DOCUMENTS PROSE"))
.child(self.render_document_prose_list(cx, selected))
.when(!work_products.is_empty(), |container| {
container
.child(document_section_label("WORK PRODUCTS"))
.child(render_work_products(work_products.as_slice()))
})
.child(self.render_document_editor(selected))
} }
fn render_document_prose_list( fn render_document_prose_list(
@@ -97,19 +83,20 @@ impl AppRoot {
.flex() .flex()
.justify_between() .justify_between()
.items_center() .items_center()
.gap_3()
.child( .child(
div() div()
.flex_1() .flex_1()
.child( .child(
div() div()
.text_base() .text_sm()
.text_color(theme::text_primary()) .text_color(theme::text_primary())
.child(document.title.clone()), .child(document.title.clone()),
) )
.child( .child(
div() div()
.mt(px(4.0)) .mt(px(4.0))
.text_sm() .text_xs()
.text_color(theme::text_muted()) .text_color(theme::text_muted())
.child(format!( .child(format!(
"{} · v{} · {}", "{} · v{} · {}",
@@ -125,7 +112,10 @@ impl AppRoot {
}) })
} }
fn render_document_editor(&self, selected: Option<&domain::Document>) -> impl IntoElement + '_ { fn render_document_editor_surface(
&self,
selected: Option<&domain::Document>,
) -> impl IntoElement + '_ {
div() div()
.rounded_lg() .rounded_lg()
.border_1() .border_1()
@@ -139,26 +129,80 @@ impl AppRoot {
.unwrap_or_else(|| "New document".to_string()), .unwrap_or_else(|| "New document".to_string()),
), ),
) )
.child(self.document_title_input.clone())
.child(self.document_body_input.clone())
.when_some(selected, |container, document| { .when_some(selected, |container, document| {
container.child( container
div() .child(
.mt(px(12.0)) div()
.rounded_lg() .mt(px(8.0))
.border_1() .text_sm()
.border_color(theme::panel_inset_border()) .text_color(theme::text_muted())
.bg(theme::panel_inset()) .child(format!(
.p_4() "{} · v{} · {}",
.text_sm() document.document_type.replace('_', " "),
.line_height(px(22.0)) document.version,
.text_color(theme::text_secondary()) document.status
.child(document.content.clone()), )),
) )
.child(
div()
.mt(px(16.0))
.rounded_lg()
.border_1()
.border_color(theme::panel_inset_border())
.bg(theme::panel_inset())
.p_4()
.text_sm()
.line_height(px(22.0))
.text_color(theme::text_secondary())
.child(document.content.clone()),
)
}) })
.child(
div()
.mt(px(20.0))
.text_xs()
.text_color(theme::text_muted())
.child("DRAFT EDITOR"),
)
.child(div().mt(px(10.0)).child(self.document_title_input.clone()))
.child(div().mt(px(12.0)).child(self.document_body_input.clone()))
.child(
div().mt(px(14.0)).flex().justify_end().child(
div()
.text_xs()
.text_color(theme::text_muted())
.child("Use the draft editor to create the next document revision."),
),
)
} }
} }
fn render_document_header(total_count: usize, cx: &mut Context<AppRoot>) -> impl IntoElement {
div()
.flex()
.justify_between()
.items_center()
.child(
div()
.child(
div()
.text_2xl()
.text_color(theme::text_primary())
.child("Document Center"),
)
.child(
div()
.mt(px(6.0))
.text_sm()
.text_color(theme::text_muted())
.child(format!("{} items", total_count)),
),
)
.child(primary_button("Save draft", cx, |this, cx| {
this.create_document(cx)
}))
}
fn document_section_label(label: &'static str) -> impl IntoElement { fn document_section_label(label: &'static str) -> impl IntoElement {
div().text_xs().text_color(theme::text_muted()).child(label) div().text_xs().text_color(theme::text_muted()).child(label)
} }
@@ -180,19 +224,20 @@ fn render_work_products<'a>(products: &'a [&'a domain::ArtifactRecord]) -> impl
.flex() .flex()
.justify_between() .justify_between()
.items_center() .items_center()
.gap_3()
.child( .child(
div() div()
.flex_1() .flex_1()
.child( .child(
div() div()
.text_base() .text_sm()
.text_color(theme::text_primary()) .text_color(theme::text_primary())
.child(artifact.title.clone()), .child(artifact.title.clone()),
) )
.child( .child(
div() div()
.mt(px(4.0)) .mt(px(4.0))
.text_sm() .text_xs()
.text_color(theme::text_muted()) .text_color(theme::text_muted())
.child(format!( .child(format!(
"{} · {} · {}", "{} · {} · {}",
+2 -2
View File
@@ -262,8 +262,8 @@
"cargo test --workspace passes" "cargo test --workspace passes"
], ],
"priority": 19, "priority": 19,
"passes": false, "passes": true,
"notes": "Opened after strict current-directory-only source audit." "notes": "Passed: Document Center now restores a source-like shell with section header, prose list, work-product list, and a dedicated editor/inspector column while preserving the existing native save path."
}, },
{ {
"id": "US-020", "id": "US-020",
+2
View File
@@ -24,3 +24,5 @@ Started: 2026-04-19
- Completed US-017 runs shell remediation. Native runs now follow the original RunQueue + RunDetail grammar more closely: the queue is a dedicated left panel with filtering/search/list rows, the right side is a primary run detail column, and runtime events/artifacts/operator actions are preserved as secondary panels instead of dominating the main operational shell. - Completed US-017 runs shell remediation. Native runs now follow the original RunQueue + RunDetail grammar more closely: the queue is a dedicated left panel with filtering/search/list rows, the right side is a primary run detail column, and runtime events/artifacts/operator actions are preserved as secondary panels instead of dominating the main operational shell.
- Completed US-018 approvals remediation. Native approvals now use a grouped review-list grammar closer to the original PendingReviewList surface instead of parallel summary cards, while the lower pending-approval inspector still preserves the real approve/reject chain. - Completed US-018 approvals remediation. Native approvals now use a grouped review-list grammar closer to the original PendingReviewList surface instead of parallel summary cards, while the lower pending-approval inspector still preserves the real approve/reject chain.
- Completed US-019 document-center remediation. Native documents now follow a source-like operational shell with section header, prose list, work-product list, and a dedicated editor/inspector column while keeping the current native draft-save path intact.