Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions crates/edit_prediction_ui/src/edit_prediction_context_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,14 @@ impl EditPredictionContextView {
.gap_2()
.child(v_flex().h_full().flex_1().child({
let t0 = run.started_at;
let mut table = ui::Table::<2>::new().width(ui::px(300.)).no_ui_font();
let mut table = ui::Table::new(2).width(ui::px(300.)).no_ui_font();
for (key, value) in &run.metadata {
table = table.row([key.into_any_element(), value.clone().into_any_element()])
table = table.row(vec![
key.into_any_element(),
value.clone().into_any_element(),
])
}
table = table.row([
table = table.row(vec![
"Total Time".into_any_element(),
format!("{} ms", (run.finished_at.unwrap_or(t0) - t0).as_millis())
.into_any_element(),
Expand Down
15 changes: 8 additions & 7 deletions crates/keymap_editor/src/keymap_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ use crate::{
};

const NO_ACTION_ARGUMENTS_TEXT: SharedString = SharedString::new_static("<no arguments>");
const COLS: usize = 6;

actions!(
keymap_editor,
Expand Down Expand Up @@ -428,7 +429,7 @@ struct KeymapEditor {
context_menu: Option<(Entity<ContextMenu>, Point<Pixels>, Subscription)>,
previous_edit: Option<PreviousEdit>,
humanized_action_names: HumanizedActionNameCache,
current_widths: Entity<TableColumnWidths<6>>,
current_widths: Entity<TableColumnWidths>,
show_hover_menus: bool,
actions_with_schemas: HashSet<&'static str>,
/// In order for the JSON LSP to run in the actions arguments editor, we
Expand Down Expand Up @@ -560,7 +561,7 @@ impl KeymapEditor {
actions_with_schemas: HashSet::default(),
action_args_temp_dir: None,
action_args_temp_dir_worktree: None,
current_widths: cx.new(|cx| TableColumnWidths::new(cx)),
current_widths: cx.new(|cx| TableColumnWidths::new(COLS, cx)),
};

this.on_keymap_changed(window, cx);
Expand Down Expand Up @@ -1914,14 +1915,14 @@ impl Render for KeymapEditor {
),
)
.child(
Table::new()
Table::new(COLS)
.interactable(&self.table_interaction_state)
.striped()
.empty_table_callback({
let this = cx.entity();
move |window, cx| this.read(cx).render_no_matches_hint(window, cx)
})
.column_widths([
.column_widths(vec![
DefiniteLength::Absolute(AbsoluteLength::Pixels(px(36.))),
DefiniteLength::Fraction(0.25),
DefiniteLength::Fraction(0.20),
Expand All @@ -1930,7 +1931,7 @@ impl Render for KeymapEditor {
DefiniteLength::Fraction(0.08),
])
.resizable_columns(
[
vec![
TableResizeBehavior::None,
TableResizeBehavior::Resizable,
TableResizeBehavior::Resizable,
Expand All @@ -1941,7 +1942,7 @@ impl Render for KeymapEditor {
&self.current_widths,
cx,
)
.header(["", "Action", "Arguments", "Keystrokes", "Context", "Source"])
.header(vec!["", "Action", "Arguments", "Keystrokes", "Context", "Source"])
.uniform_list(
"keymap-editor-table",
row_count,
Expand Down Expand Up @@ -2051,7 +2052,7 @@ impl Render for KeymapEditor {
.unwrap_or_default()
.into_any_element();

Some([
Some(vec![
icon.into_any_element(),
action,
action_arguments,
Expand Down
Loading
Loading