Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0d9d1d4
Ribbon: missing and misplaced groups and controls (#1797)
alosslessdev Oct 17, 2026
0513040
Ribbon: Excel's eight Insert > Charts categories
alosslessdev Oct 18, 2026
ecfd484
Ribbon: show what the data-only controls return, and fit the View tab…
Oct 23, 2026
b4d83b0
Ribbon: one Checkbox button on Insert and the WM badge on Macros (#1798)
Oct 23, 2026
2d68e4d
Ribbon: show the Checkbox keytip badge on Insert (#1798)
alosslessdev Oct 23, 2026
833d8ba
Ribbon: the View tab compacts itself instead of scrolling out of view…
alosslessdev Oct 23, 2026
ceef7bc
Ribbon: choose the View tab's compact layout from the width alone (#1…
alosslessdev Oct 23, 2026
d909514
Icons: use the theme accent colour names in the new chart icons
alosslessdev Oct 25, 2026
f6f26ff
Ribbon: keep the View tab's interface settings inside the card
alosslessdev Oct 25, 2026
fbb63f5
Ribbon: fit the compact View tab inside 1200 px on wider CI fonts (#1…
alosslessdev Oct 25, 2026
46185f6
Docs: sync counts to the parity checklist after the rebase (#1798)
alosslessdev Oct 25, 2026
d349185
Ribbon: leave Recently Used to the Function Library menu (#1798)
alosslessdev Oct 25, 2026
99afa27
Ribbon: adapt to egui 0.37 after the rebase (#1798)
alosslessdev Oct 25, 2026
4934357
Ribbon: open the Selection Pane through a view command and treat blan…
alosslessdev Oct 25, 2026
c090256
Ribbon: keep one control for the macros dialog on Automate (#1798)
alosslessdev Oct 25, 2026
988d8f9
Ribbon: point the Selection Pane keytip at its UI command (#1798)
alosslessdev Oct 25, 2026
1b487de
UI: select new PivotCharts and keep Custom Views refresh errors (#1798)
alosslessdev Oct 25, 2026
1cde261
PivotChart: submit the report id so names are not read as cells (#1798)
alosslessdev Oct 25, 2026
80cdd49
Merge main into ribbon/missing-controls: port the ribbon work to the …
alosslessdev Nov 4, 2026
c67155c
Ribbon: fit the Insert tab's groups in a 1400 px card (#1797)
alosslessdev Nov 4, 2026
50cb98e
Ribbon: address review findings on the new controls (#1797)
alosslessdev Nov 4, 2026
e0334a3
Ribbon: enable Rotate for shapes and keep the View tab inside 1200 px…
alosslessdev Nov 4, 2026
91fada5
xtask parity: keep figure edits on one line and report only checked s…
alosslessdev Nov 4, 2026
1faefef
xtask parity: gate the replace_between tests behind the engine featur…
alosslessdev Nov 4, 2026
5a81572
Custom Views keeps its selection across refresh; drop the duplicate D…
alosslessdev Nov 4, 2026
943dc78
Recommended PivotTables lists its suggestions; Background inserts a m…
alosslessdev Nov 4, 2026
4a5356c
Consolidate defaults to the active cell; Scale to Fit shows the store…
alosslessdev Nov 4, 2026
f01748a
Sync UI state with the targeted window; Clear Background menu action …
alosslessdev Nov 4, 2026
35776d9
Merge upstream/main into ribbon/missing-controls (#1798)
alosslessdev Nov 8, 2026
ba7af68
Docs: regenerate parity figures; format the merged ribbon imports (#1…
alosslessdev Nov 8, 2026
acc561f
Ribbon: cover the two findings CodeRabbit could not verify (#1798)
Nov 12, 2026
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ egui frontend is a separate crate, so the UI can be swapped without touching the
## Roadmap

GridCraft is in **alpha**: the core workflow works end to end, but depth, fidelity and file
compatibility are still rough. It covers 89% of standard ribbon commands in our catalog
compatibility are still rough. It covers 94.9% of standard ribbon commands in our catalog
([`docs/parity-checklist.md`](docs/parity-checklist.md)) and 513 standard worksheet functions
([`docs/function-parity.md`](docs/function-parity.md)); this is a parity inventory, not a count of working implementations. Weighted by what spreadsheet users rely on, we
estimate it is about 50% ready for real work. Next up: XLSX fidelity on real-world files, very large
Expand Down
3 changes: 3 additions & 0 deletions contributors/people.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ real_name = "Helen Kwok"
real_name = "Robert Lee"
sync_github_name = true

[people.alosslessdev]
real_name = "Francisco Herrera"

[people.dylanmtaylor]
sync_github_name = true

Expand Down
3 changes: 3 additions & 0 deletions crates/engine/src/cmd/extra/cells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ pub(super) fn background(s: &mut Session, p: &Json) -> Result<Json> {
let mut params = object_params(p);
params["alt"] = json!("Sheet background");
params["at"] = json!("A1");
// The picture dialog this request opens has to confirm through this command again, or the
// picture lands unmarked and `clear` cannot remove it.
params["background"] = json!(true);
s.execute("insert.picture", params)
}

Expand Down
11 changes: 10 additions & 1 deletion crates/engine/src/cmd/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,16 @@ fn insert_picture(s: &mut Session, p: &Json) -> Result<Json> {
} else if let Some(path) = str_param(p, "path") {
crate::io::read_file(path)?
} else {
s.ui_requests.push(crate::UiRequest::Dialog("insertPicture".into(), json!({"placement": placement})));
// Page Layout › Background picks its file through this dialog; the marker keeps the
// confirmation on `pageLayout.background`, so the picture is stored as a sheet background
// (Excel's "Sheet background" marker at A1) instead of a floating picture.
let mut request = json!({"placement": placement});
if bool_param(p, "background").unwrap_or(false)
&& let Some(m) = request.as_object_mut()
{
m.insert("background".into(), json!(true));
}
s.ui_requests.push(crate::UiRequest::Dialog("insertPicture".into(), request));
return ok();
};
if placement == "cell" {
Expand Down
30 changes: 30 additions & 0 deletions crates/engine/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3640,6 +3640,36 @@ fn image_cell(s: &Session, id: u32) -> Option<CellRef> {
s.doc().unwrap().wb.active().unwrap().images.iter().find(|i| i.id == id).map(|i| i.anchor.cell)
}

/// Page Layout › Background asks for its picture through the picture dialog, and the request
/// carries the background marker: the dialog must confirm through `pageLayout.background` again,
/// or the picture lands unmarked and `clear` cannot remove it.
#[test]
fn background_marks_the_picture_dialog_request() {
let mut s = s();
s.execute("pageLayout.background", json!({})).unwrap();
let dialog = s
.take_ui_requests()
.into_iter()
.find_map(|r| match r {
crate::UiRequest::Dialog(name, params) if name == "insertPicture" => Some(params),
_ => None,
})
.expect("Background asks for a picture");
assert_eq!(dialog.get("background"), Some(&json!(true)), "{dialog}");
}

#[test]
fn background_stores_a_marked_picture_at_a1_and_clear_removes_it() {
let mut s = s();
s.execute("pageLayout.background", json!({"base64": crate::io::base64_encode(&tiny_png())})).unwrap();
let sh = s.doc().unwrap().wb.active().unwrap();
assert_eq!(sh.images.len(), 1);
assert_eq!(sh.images[0].alt, "Sheet background");
assert_eq!(sh.images[0].anchor.cell, CellRef::parse("A1").unwrap());
s.execute("pageLayout.background", json!({"clear": true})).unwrap();
assert!(s.doc().unwrap().wb.active().unwrap().images.is_empty(), "clear removes the sheet background");
}

/// Every undo step holds a copy of the workbook. A picture's bytes and the VBA project are shared
/// between those copies instead of copied into each: a 20 MB picture used to cost another 20 MB
/// for every cell typed on its sheet, up to 100 steps (2 GB).
Expand Down
69 changes: 67 additions & 2 deletions crates/ui-egui/src/app/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ use super::{
formula_locale, i18n, json, now_ms, printing,
};

/// Whether a command parameter is absent or blank (`null`, `""` or `[]`), as a dialog or a keytip
/// sends a field it left empty. A blank name means the same as no name at all.
fn blank_param(v: Option<&Json>) -> bool {
match v {
None | Some(Json::Null) => true,
Some(Json::String(s)) => s.trim().is_empty(),
Some(Json::Array(a)) => a.is_empty(),
_ => false,
}
}

impl SheetApp {
/// Runs an engine command (or a UI command) and handles UI requests it makes.
pub fn run(&mut self, id: &str, params: Json) -> Result<Json, String> {
Expand Down Expand Up @@ -85,7 +96,7 @@ impl SheetApp {
self.arrange_windows = Some((arrange, windows));
}
// The new chart is selected, as after inserting any object, so Delete removes it, not its data.
if id == "insert.chart"
if (id == "insert.chart" || id == "insert.pivotChart")
&& let Ok(r) = &r
&& let Some(chart) = r.get("chart").and_then(Json::as_u64).and_then(|id| u32::try_from(id).ok())
{
Expand All @@ -99,7 +110,21 @@ impl SheetApp {
r
}

pub fn run_or_alert(&mut self, id: &str, params: Json) {
pub fn run_or_alert(&mut self, id: &str, mut params: Json) {
// An unfilled field reaches here as `""` or `[]`; for these two commands blank is the same
// as absent, so drop it and the branch below opens the dialog (or uses the active cell)
// instead of the command failing on an empty name.
let blank_key = match id {
"insert.pivotChart" => Some("pivot"),
"data.consolidate" => Some("sources"),
_ => None,
};
if let Some(key) = blank_key
&& let Some(map) = params.as_object_mut()
&& blank_param(map.get(key))
{
map.remove(key);
}
// A menu/shortcut opens the settings first; the Print page's button submits explicitly.
if id == "file.print" {
if self.services.print_native.is_some() {
Expand All @@ -118,6 +143,33 @@ impl SheetApp {
if id == "insert.recommendedCharts" && params.get("type").is_none() {
return self.open_dialog("recommendedCharts", json!({}));
}
// Recommended PivotTables with no suggestion applied (ribbon menu, keytip, command search)
// lists its suggestions to choose from; programmatic callers of `run` still get the list.
if id == "insert.recommendedPivotTables" && params.get("apply").is_none() {
return self.open_dialog("recommendedPivotTables", json!({}));
}
// The Insert tab's PivotChart: with no PivotTable at the active cell the report has to be
// chosen first (Excel's Create PivotChart); the command alone needs one to be named.
if id == "insert.pivotChart" && params.get("pivot").is_none() && crate::pivot_pane::active_pivot(self).is_none() {
return self.open_dialog("pivotChart", json!({}));
}
// Data › Consolidate opens its dialog: the command needs source ranges, so it refuses a
// programmatic call without them.
if id == "data.consolidate" && params.get("sources").is_none() {
return self.open_dialog("consolidate", json!({}));
}
// Commands that only report data (Add-ins, Queries & Connections, Thesaurus, Custom Views)
// show what they returned in a dialog rather than throwing it away.
let result_dialog = match id {
"home.addIns" => Some("addIns"),
"data.queriesConnections" => Some("queriesConnections"),
"review.thesaurus" => Some("thesaurus"),
"view.customViews" => Some("customViews"),
_ => None,
};
if let Some(name) = result_dialog.filter(|_| params.as_object().is_none_or(|m| m.is_empty())) {
return self.open_dialog(name, json!({}));
}
// Switch Windows with no window named (key tip, command search) opens the View tab's
// list to choose from; programmatic callers of `run` get the list back.
if id == "view.switchWindows" && ["window", "doc"].iter().all(|k| params.get(*k).is_none_or(Json::is_null)) {
Expand Down Expand Up @@ -198,6 +250,19 @@ impl SheetApp {
self.ui.animations = p.get("on").and_then(Json::as_bool).unwrap_or(!self.ui.animations);
Ok(json!({"on": self.ui.animations}))
}
"view.selectionPane" => {
// Page Layout › Arrange › Selection Pane. Which pane is open is view state, so it
// is a UI command; `arrange.selectionPane` only lists the sheet's objects.
let shown = self.grid.pane.as_deref() == Some("selection");
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
let on = p.get("on").and_then(Json::as_bool).unwrap_or(!shown);
if on {
self.grid.pane = Some("selection".to_string());
} else if shown {
// Only the Selection Pane closes: another pane (Watch, Format Chart) stays open.
self.grid.pane = None;
}
Ok(json!({"on": on}))
}
Comment thread
alosslessdev marked this conversation as resolved.
Resolved
"options.autoComplete" => {
self.ui.autocomplete = p.get("on").and_then(Json::as_bool).unwrap_or(!self.ui.autocomplete);
Ok(json!({"on": self.ui.autocomplete}))
Expand Down
5 changes: 5 additions & 0 deletions crates/ui-egui/src/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ fn run(app: &mut SheetApp, id: &str, params: Json) -> Result<Json, String> {
/// window afterwards unless the command itself switched windows.
fn run_in(app: &mut SheetApp, target: gridcraft_engine::Target, id: &str, params: Json) -> Result<Json, String> {
let guard = app.session.enter_target(target).map_err(|e| e.to_string())?;
// The engine window is the target now, so the per-window UI state has to follow it: UI
// commands such as `view.selectionPane` act on the displayed pane, not the originating one.
app.follow_active_window();
let r = run(app, id, params);
app.session.leave_target(guard);
app.follow_active_window();
r
}

Expand Down Expand Up @@ -272,6 +276,7 @@ pub fn handle(app: &mut SheetApp, ctx: &egui::Context, method: &str, p: &Json) -
("view.darkMode", "Dark Mode", ""),
("view.theme", "Display Theme", ""),
("view.animations", "Animations", "{on?: bool} (toggles without it) → {on}"),
("view.selectionPane", "Selection Pane", "{on?: bool} (toggles without it) → {on}"),
("options.autoComplete", "Enable AutoComplete for cell values", "{on?: bool} (toggles without it) → {on}"),
("options.highlightActiveRow", "Highlight the active cell's row", "{on?: bool} (toggles without it) → {on}"),
("view.interfaceScale", "Interface Size", "{percent: 75–200 | \"auto\"} (100 = auto; clamped)"),
Expand Down
114 changes: 105 additions & 9 deletions crates/ui-egui/src/dialogs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod insert_function;
mod names;
mod paste;
mod ref_edit;
mod reports;
mod show;
mod spelling;
mod zoom;
Expand Down Expand Up @@ -1031,6 +1032,7 @@ impl Dialog {
select_chart(&mut d, 0);
d
}
"recommendedPivotTables" => return recommended_pivot_tables_dialog(app),
"selectData" => {
// Chart Design › Select Data: data range, series to keep, category axis labels.
let id = p("chart").as_u64();
Expand Down Expand Up @@ -1095,14 +1097,7 @@ impl Dialog {
json!({"chart": p("chart")}),
),
"insertPicture" => {
let placement = params.get("placement").and_then(Json::as_str).unwrap_or("overCells");
let mut dialog = Dialog::form(
"insertPicture",
if placement == "cell" { "Place Picture in Cell" } else { "Place Picture over Cells" },
"insert.picture",
vec![],
json!({"path": "", "placement": placement, "at": active}),
);
let mut dialog = picture_dialog(&params, &active);
dialog.picture_target = app.view_key();
dialog
}
Expand All @@ -1113,6 +1108,69 @@ impl Dialog {
"saveCopy" => Dialog::custom("saveCopy", "Save a Copy", json!({"format": p("format")})),
"saveChanges" => Dialog::custom("saveChanges", "Save Changes?", json!({"title": p("title"), "quit": p("quit")})),
"start" => Dialog::custom("start", "GridCraft", json!({})),
// The controls whose commands only report data: the dialog runs the command and shows
// what it returned, so the button never does something invisible.
"addIns" => {
let mut d = Dialog::custom("addIns", "Add-ins", json!({}));
d.result = Some(app.session.run("home.addIns", json!({})).unwrap_or_else(|e| json!({"error": e})));
d
}
"queriesConnections" => {
let mut d = Dialog::custom("queriesConnections", "Queries & Connections", json!({}));
d.result = Some(app.session.run("data.queriesConnections", json!({})).unwrap_or_else(|e| json!({"error": e})));
d
}
"thesaurus" => {
let word = reports::selected_word(app);
let mut d = Dialog::custom("thesaurus", "Thesaurus", json!({"word": word}));
d.result = Some(reports::thesaurus_result(app, &word));
d
}
"customViews" => {
let mut d = Dialog::custom("customViews", "Custom Views", json!({"name": ""}));
d.result = Some(app.session.run("view.customViews", json!({})).unwrap_or_else(|e| json!({"error": e})));
d
}
"pivotChart" => {
// Insert › PivotChart without a PivotTable at the active cell: Excel asks which
// report to chart ("Create PivotChart") instead of failing.
let mut d = Dialog::custom(
"pivotChart",
"Create PivotChart",
json!({"pivot": crate::pivot_pane::active_pivot(app).unwrap_or_default(), "type": "column"}),
);
d.command = Some("insert.pivotChart");
d.result = Some(app.session.run("pivot.list", json!({})).unwrap_or_else(|e| json!({"error": e})));
d
}
"consolidate" => {
let cell = app.session.active().map(|d| d.selection.active.a1()).unwrap_or_else(|| "A1".into());
Dialog::form(
"consolidate",
"Consolidate",
"data.consolidate",
vec![
Choice {
key: "function",
label: "Function:",
options: vec![
("sum", "Sum"),
("count", "Count"),
("countNums", "Count Numbers"),
("average", "Average"),
("max", "Max"),
("min", "Min"),
("product", "Product"),
],
},
Text { key: "sources", label: "Reference (separate ranges with ;):" },
Text { key: "destination", label: "Destination:" },
Check { key: "topRow", label: "Top row" },
Check { key: "leftColumn", label: "Left column" },
],
json!({"function": "sum", "sources": "", "destination": cell, "topRow": false, "leftColumn": false}),
)
}
"comments" => {
app.grid.pane = None;
app.run_or_alert("review.showComments", json!({"on": true}));
Expand All @@ -1136,10 +1194,48 @@ impl Dialog {
}
}

/// Insert › Recommended PivotTables: the engine's suggestions for the selected data, listed by the
/// dialog, which OK applies by index. Errors (no range, nothing to suggest) show as a message
/// instead of a dialog.
fn recommended_pivot_tables_dialog(app: &mut SheetApp) -> Option<Dialog> {
let recs = match app.session.run("insert.recommendedPivotTables", json!({})) {
Ok(r) => r,
Err(e) => {
app.message = Some(("Recommended PivotTables".into(), crate::clean_error(&e)));
return None;
}
};
let mut d = Dialog::custom("recommendedPivotTables", "Recommended PivotTables", json!({"apply": 0}));
d.command = Some("insert.recommendedPivotTables");
d.result = Some(recs);
Some(d)
}

/// The picture dialog the Insert tab's Pictures and Page Layout's Background pick a file through.
/// A background request carries `background`, so its OK runs `pageLayout.background` (which marks
/// the picture and puts it at A1) instead of inserting an unmarked floating picture.
fn picture_dialog(params: &Json, active: &str) -> Dialog {
let placement = params.get("placement").and_then(Json::as_str).unwrap_or("overCells");
let background = params.get("background").and_then(Json::as_bool).unwrap_or(false);
let title = if background {
"Sheet Background"
} else if placement == "cell" {
"Place Picture in Cell"
} else {
"Place Picture over Cells"
};
Dialog::form(
"insertPicture",
title,
if background { "pageLayout.background" } else { "insert.picture" },
vec![],
json!({"path": "", "placement": placement, "at": active}),
)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn remove_duplicates_prefills_the_selection_and_submits_the_edited_range() {
let mut session = gridcraft_engine::Session::default();
Expand Down
Loading
Loading