refactor: add native ui theme tokens
This commit is contained in:
1 parent
5e6e929779
commit
308be17264
14 files changed
+248
-108
No files matched your search
@@ -24,8 +24,8 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.overflow_scroll()
|
||||
.child(div().text_lg().child("Approval queue"))
|
||||
.children(self.snapshot.approvals.iter().map(|item| {
|
||||
@@ -38,8 +38,12 @@ impl AppRoot {
|
||||
.py_2()
|
||||
.rounded_md()
|
||||
.cursor_pointer()
|
||||
.bg(if active { rgb(0xefe2d4) } else { rgb(0xfffbf5) })
|
||||
.hover(|style| style.bg(rgb(0xf4ede4)))
|
||||
.bg(if active {
|
||||
theme::selection_fill()
|
||||
} else {
|
||||
theme::panel()
|
||||
})
|
||||
.hover(|style| style.bg(theme::panel_hover()))
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.state.selected_approval_id = Some(approval_id.clone());
|
||||
cx.notify();
|
||||
@@ -54,13 +58,13 @@ impl AppRoot {
|
||||
.gap_3()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child("Decision"))
|
||||
.child(
|
||||
div()
|
||||
.text_sm()
|
||||
.text_color(rgb(0x6f665d))
|
||||
.text_color(theme::text_muted())
|
||||
.child(approval_type),
|
||||
)
|
||||
.child(
|
||||
@@ -68,9 +72,9 @@ impl AppRoot {
|
||||
.min_h(px(160.0))
|
||||
.p_3()
|
||||
.border_1()
|
||||
.border_color(rgb(0xeee3d7))
|
||||
.border_color(theme::panel_inset_border())
|
||||
.rounded_md()
|
||||
.bg(rgb(0xf7f0e7))
|
||||
.bg(theme::panel_inset())
|
||||
.child(approval_summary),
|
||||
)
|
||||
.child(
|
||||
|
||||
@@ -24,8 +24,8 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.overflow_scroll()
|
||||
.child(div().text_lg().child("Document center"))
|
||||
.children(self.snapshot.documents.iter().map(|item| {
|
||||
@@ -38,8 +38,12 @@ impl AppRoot {
|
||||
.py_2()
|
||||
.rounded_md()
|
||||
.cursor_pointer()
|
||||
.bg(if active { rgb(0xefe2d4) } else { rgb(0xfffbf5) })
|
||||
.hover(|style| style.bg(rgb(0xf4ede4)))
|
||||
.bg(if active {
|
||||
theme::selection_fill()
|
||||
} else {
|
||||
theme::panel()
|
||||
})
|
||||
.hover(|style| style.bg(theme::panel_hover()))
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.state.selected_document_id = Some(document_id.clone());
|
||||
cx.notify();
|
||||
@@ -54,19 +58,19 @@ impl AppRoot {
|
||||
.gap_3()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child("Quick draft"))
|
||||
.child(self.document_title_input.clone())
|
||||
.child(self.document_body_input.clone())
|
||||
.child(primary_button("Save draft", cx, |this, cx| {
|
||||
this.create_document(cx)
|
||||
}))
|
||||
.child(div().h(px(1.0)).bg(rgb(0xeee3d7)))
|
||||
.child(div().h(px(1.0)).bg(theme::panel_inset_border()))
|
||||
.child(
|
||||
div()
|
||||
.text_sm()
|
||||
.text_color(rgb(0x6f665d))
|
||||
.text_color(theme::text_muted())
|
||||
.child(document_title),
|
||||
)
|
||||
.child(
|
||||
@@ -74,9 +78,9 @@ impl AppRoot {
|
||||
.min_h(px(200.0))
|
||||
.p_3()
|
||||
.border_1()
|
||||
.border_color(rgb(0xeee3d7))
|
||||
.border_color(theme::panel_inset_border())
|
||||
.rounded_md()
|
||||
.bg(rgb(0xf7f0e7))
|
||||
.bg(theme::panel_inset())
|
||||
.child(document_content),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -12,8 +12,8 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child("Unread messages"))
|
||||
.children(
|
||||
self.snapshot
|
||||
@@ -25,7 +25,7 @@ impl AppRoot {
|
||||
div()
|
||||
.py_2()
|
||||
.border_b_1()
|
||||
.border_color(rgb(0xeee3d7))
|
||||
.border_color(theme::panel_inset_border())
|
||||
.child(format!("{} · {}", item.subject, item.body))
|
||||
}),
|
||||
),
|
||||
@@ -37,8 +37,8 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child("Pending approvals"))
|
||||
.children(
|
||||
self.snapshot
|
||||
@@ -47,9 +47,14 @@ impl AppRoot {
|
||||
.filter(|item| item.state == "pending")
|
||||
.take(8)
|
||||
.map(|item| {
|
||||
div().py_2().border_b_1().border_color(rgb(0xeee3d7)).child(
|
||||
format!("{} · {}", item.approval_type, item.payload_summary),
|
||||
)
|
||||
div()
|
||||
.py_2()
|
||||
.border_b_1()
|
||||
.border_color(theme::panel_inset_border())
|
||||
.child(format!(
|
||||
"{} · {}",
|
||||
item.approval_type, item.payload_summary
|
||||
))
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -25,8 +25,8 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.overflow_scroll()
|
||||
.child(div().text_lg().child("Channels"))
|
||||
.children(self.snapshot.agent_messages.iter().map(|item| {
|
||||
@@ -39,8 +39,12 @@ impl AppRoot {
|
||||
.py_2()
|
||||
.rounded_md()
|
||||
.cursor_pointer()
|
||||
.bg(if active { rgb(0xefe2d4) } else { rgb(0xfffbf5) })
|
||||
.hover(|style| style.bg(rgb(0xf4ede4)))
|
||||
.bg(if active {
|
||||
theme::selection_fill()
|
||||
} else {
|
||||
theme::panel()
|
||||
})
|
||||
.hover(|style| style.bg(theme::panel_hover()))
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.state.selected_message_id = Some(message_id.clone());
|
||||
cx.notify();
|
||||
@@ -55,13 +59,13 @@ impl AppRoot {
|
||||
.gap_3()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child("Conversation"))
|
||||
.child(
|
||||
div()
|
||||
.text_sm()
|
||||
.text_color(rgb(0x6f665d))
|
||||
.text_color(theme::text_muted())
|
||||
.child(selected_subject),
|
||||
)
|
||||
.child(
|
||||
@@ -69,9 +73,9 @@ impl AppRoot {
|
||||
.min_h(px(220.0))
|
||||
.p_3()
|
||||
.border_1()
|
||||
.border_color(rgb(0xeee3d7))
|
||||
.border_color(theme::panel_inset_border())
|
||||
.rounded_md()
|
||||
.bg(rgb(0xf7f0e7))
|
||||
.bg(theme::panel_inset())
|
||||
.child(selected_body),
|
||||
)
|
||||
.child(self.message_input.clone())
|
||||
|
||||
@@ -7,13 +7,13 @@ impl AppRoot {
|
||||
.p_8()
|
||||
.flex()
|
||||
.gap_8()
|
||||
.bg(rgb(0xf3efe8))
|
||||
.bg(theme::canvas())
|
||||
.child(
|
||||
div()
|
||||
.flex_1()
|
||||
.gap_4()
|
||||
.child(div().text_3xl().text_color(rgb(0x171411)).child("Start a native AgentCompany profile"))
|
||||
.child(div().text_sm().text_color(rgb(0x6f665d)).child("Create the first company, point it at a workspace, and keep the SQLite profile local."))
|
||||
.child(div().text_3xl().text_color(theme::text_primary()).child("Start a native AgentCompany profile"))
|
||||
.child(div().text_sm().text_color(theme::text_muted()).child("Create the first company, point it at a workspace, and keep the SQLite profile local."))
|
||||
.child(self.company_name_input.clone())
|
||||
.child(self.mission_input.clone())
|
||||
.child(self.workspace_input.clone())
|
||||
@@ -26,13 +26,13 @@ impl AppRoot {
|
||||
.gap_3()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child("What lands in SQLite"))
|
||||
.child(div().text_sm().text_color(rgb(0x6f665d)).child("Company"))
|
||||
.child(div().text_sm().text_color(rgb(0x6f665d)).child("Primary workspace"))
|
||||
.child(div().text_sm().text_color(rgb(0x6f665d)).child("Connector catalog"))
|
||||
.child(div().text_sm().text_color(rgb(0x6f665d)).child("Shared profile settings")),
|
||||
.child(div().text_sm().text_color(theme::text_muted()).child("Company"))
|
||||
.child(div().text_sm().text_color(theme::text_muted()).child("Primary workspace"))
|
||||
.child(div().text_sm().text_color(theme::text_muted()).child("Connector catalog"))
|
||||
.child(div().text_sm().text_color(theme::text_muted()).child("Shared profile settings")),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -46,14 +46,14 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child(company_name))
|
||||
.children(self.snapshot.tasks.iter().take(6).map(|task| {
|
||||
div()
|
||||
.py_2()
|
||||
.border_b_1()
|
||||
.border_color(rgb(0xeee3d7))
|
||||
.border_color(theme::panel_inset_border())
|
||||
.child(format!("{} · {}", task.status, task.title))
|
||||
})),
|
||||
)
|
||||
@@ -64,14 +64,14 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child("Recent activity"))
|
||||
.children(self.snapshot.activity.iter().take(6).map(|item| {
|
||||
div()
|
||||
.py_2()
|
||||
.border_b_1()
|
||||
.border_color(rgb(0xeee3d7))
|
||||
.border_color(theme::panel_inset_border())
|
||||
.child(format!("{} · {}", item.action, item.detail))
|
||||
})),
|
||||
),
|
||||
|
||||
@@ -52,8 +52,8 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.overflow_scroll()
|
||||
.child(div().text_lg().child("Run queue"))
|
||||
.children(self.snapshot.runs.iter().map(|item| {
|
||||
@@ -71,8 +71,12 @@ impl AppRoot {
|
||||
.py_2()
|
||||
.rounded_md()
|
||||
.cursor_pointer()
|
||||
.bg(if active { rgb(0xefe2d4) } else { rgb(0xfffbf5) })
|
||||
.hover(|style| style.bg(rgb(0xf4ede4)))
|
||||
.bg(if active {
|
||||
theme::selection_fill()
|
||||
} else {
|
||||
theme::panel()
|
||||
})
|
||||
.hover(|style| style.bg(theme::panel_hover()))
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.state.selected_run_id = Some(run_id.clone());
|
||||
cx.notify();
|
||||
@@ -87,13 +91,13 @@ impl AppRoot {
|
||||
.gap_3()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(rgb(0xfffbf5))
|
||||
.border_color(theme::panel_border())
|
||||
.bg(theme::panel())
|
||||
.child(div().text_lg().child("Run inspector"))
|
||||
.child(
|
||||
div()
|
||||
.text_sm()
|
||||
.text_color(rgb(0x6f665d))
|
||||
.text_color(theme::text_muted())
|
||||
.child(selected_status),
|
||||
)
|
||||
.child(
|
||||
@@ -131,9 +135,9 @@ impl AppRoot {
|
||||
.min_h(px(180.0))
|
||||
.p_3()
|
||||
.border_1()
|
||||
.border_color(rgb(0xeee3d7))
|
||||
.border_color(theme::panel_inset_border())
|
||||
.rounded_md()
|
||||
.bg(rgb(0xf7f0e7))
|
||||
.bg(theme::panel_inset())
|
||||
.child(selected_summary),
|
||||
)
|
||||
.when(!selected_error.is_empty(), |container| {
|
||||
@@ -141,9 +145,9 @@ impl AppRoot {
|
||||
div()
|
||||
.p_3()
|
||||
.border_1()
|
||||
.border_color(rgb(0x9e3d2d))
|
||||
.border_color(theme::primary_action())
|
||||
.rounded_md()
|
||||
.bg(rgb(0xffefe8))
|
||||
.bg(theme::danger_bg())
|
||||
.child(selected_error),
|
||||
)
|
||||
}),
|
||||
|
||||
@@ -19,8 +19,8 @@ impl AppRoot {
|
||||
.gap_4()
|
||||
.flex()
|
||||
.flex_col()
|
||||
.bg(rgb(0x161514))
|
||||
.text_color(rgb(0xf5eee4))
|
||||
.bg(theme::sidebar_bg())
|
||||
.text_color(theme::sidebar_text())
|
||||
.child(div().text_lg().child("AgentCompany"))
|
||||
.children(self.snapshot.companies.iter().map(|company| {
|
||||
let active =
|
||||
@@ -32,14 +32,18 @@ impl AppRoot {
|
||||
.py_2()
|
||||
.rounded_md()
|
||||
.cursor_pointer()
|
||||
.bg(if active { rgb(0x9e3d2d) } else { rgb(0x211d1a) })
|
||||
.hover(|style| style.bg(rgb(0x362c27)))
|
||||
.bg(if active {
|
||||
theme::primary_action()
|
||||
} else {
|
||||
theme::sidebar_surface()
|
||||
})
|
||||
.hover(|style| style.bg(theme::sidebar_surface_hover()))
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.switch_company(company_id.clone(), cx)
|
||||
}))
|
||||
.child(company.name.clone())
|
||||
}))
|
||||
.child(div().h(px(1.0)).bg(rgb(0x2f2924)))
|
||||
.child(div().h(px(1.0)).bg(theme::sidebar_divider()))
|
||||
.children(sections.into_iter().map(|section| {
|
||||
let active = self.state.section == section;
|
||||
div()
|
||||
@@ -51,9 +55,17 @@ impl AppRoot {
|
||||
.py_2()
|
||||
.rounded_md()
|
||||
.cursor_pointer()
|
||||
.bg(if active { rgb(0xefe2d4) } else { rgb(0x161514) })
|
||||
.text_color(if active { rgb(0x171411) } else { rgb(0xf5eee4) })
|
||||
.hover(|style| style.bg(rgb(0x2c2825)))
|
||||
.bg(if active {
|
||||
theme::selection_fill()
|
||||
} else {
|
||||
theme::sidebar_bg()
|
||||
})
|
||||
.text_color(if active {
|
||||
theme::text_primary()
|
||||
} else {
|
||||
theme::sidebar_text()
|
||||
})
|
||||
.hover(|style| style.bg(theme::sidebar_hover()))
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.state.section = section;
|
||||
cx.notify();
|
||||
|
||||
@@ -16,10 +16,14 @@ impl AppRoot {
|
||||
.gap_2()
|
||||
.border_1()
|
||||
.rounded_md()
|
||||
.border_color(rgb(0xd9cdbf))
|
||||
.bg(if active { rgb(0xf7f0e7) } else { rgb(0xfffbf5) })
|
||||
.border_color(theme::panel_border())
|
||||
.bg(if active {
|
||||
theme::panel_inset()
|
||||
} else {
|
||||
theme::panel()
|
||||
})
|
||||
.cursor_pointer()
|
||||
.hover(|style| style.bg(rgb(0xf4ede4)))
|
||||
.hover(|style| style.bg(theme::panel_hover()))
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.state.selected_workspace_id = Some(workspace_id.clone());
|
||||
cx.notify();
|
||||
@@ -28,18 +32,23 @@ impl AppRoot {
|
||||
.child(
|
||||
div()
|
||||
.text_sm()
|
||||
.text_color(rgb(0x6f665d))
|
||||
.text_color(theme::text_muted())
|
||||
.child(workspace.local_path.clone()),
|
||||
)
|
||||
.child(div().text_sm().text_color(rgb(0x6f665d)).child(format!(
|
||||
"{} · {}",
|
||||
workspace.state,
|
||||
if workspace.is_primary {
|
||||
"primary"
|
||||
} else {
|
||||
"linked"
|
||||
}
|
||||
)))
|
||||
.child(
|
||||
div()
|
||||
.text_sm()
|
||||
.text_color(theme::text_muted())
|
||||
.child(format!(
|
||||
"{} · {}",
|
||||
workspace.state,
|
||||
if workspace.is_primary {
|
||||
"primary"
|
||||
} else {
|
||||
"linked"
|
||||
}
|
||||
)),
|
||||
)
|
||||
}))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user