mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-02 07:06:48 -06:00
formulas.recentlyUsed scanned the session journal for cell.set inputs. It missed formulas entered by range.* commands, lost them when the journal dropped its oldest entries (a large file open or a long script is enough), and started empty in every session. The Function Library's Recently Used menu and the Insert Function dialog list what it returns. - Prefs::recent_functions (a new engine module, recent.rs) holds the ten functions most recently entered in a formula, newest first. Session::execute updates it for every cell.* and range.* command it journals, from any source (the interface, the control channel, MCP or a script). It reads at most 2,000 of the formulas a command enters, starting from the last one; formulas longer than Excel's limit are skipped. formulas.recentlyUsed returns it. It never reads the journal back, so the journal's caps do not affect it. - The list is kept with the other engine preferences (prefs.json, the browser's storage on the web), so it survives a restart as Excel's does. It is read leniently: a malformed value loses only this list. A fresh install starts from common functions. The Insert Function dialog is titled "Insert Function", as in Excel (it said "Formula Builder"), and gains a working category list: Most Recently Used, All, then each category in Excel's order. A category may be given by label or by engine id, so a Function Library menu or the control channel (ui.dialog.set) opens it on one, and a new search switches to All. The dialog keeps its translated labels and its search in the interface language. Each row shows the function's name and its category in two columns; the category column starts after the widest name shown, so a long name in any font or formula language stays clear of it. A function counts as recently used once its formula is entered, not when OK is pressed. The unused "Formula Builder" translations are removed. Tests: engine unit tests for reading functions from formulas (strings, unknown names, over-long and malformed formulas), the formulas a command enters (newest first, within the budget), the ten-name list and the lenient read of prefs.json; tests/it/recently_used.rs for cell.set and range.setValues from the session, a failed command, a cleared journal and a save and reload of the preferences. UI tests for the menu's order and the dialog's title, categories, engine-id category, search and OK, and for the category column with a wide font.
35 lines
854 B
Rust
35 lines
854 B
Rust
//! The crate's integration tests, one module per file, built as one test binary.
|
|
|
|
mod autofit_filter_buttons;
|
|
mod cf_formula_validate;
|
|
mod chart_area_stacked100;
|
|
mod chart_workbook_names;
|
|
mod command_sequence_fuzz;
|
|
mod cross_sheet_cut;
|
|
mod csv_export_budget;
|
|
mod custom_filter_blanks;
|
|
mod custom_view_freeze;
|
|
mod dynamicmetadata;
|
|
mod extreme_selection_moves;
|
|
mod font_scheme_minor;
|
|
mod format_as_table_restyle;
|
|
mod hidden_sheet_navigation;
|
|
mod ink_roundtrip;
|
|
mod line_count_overflow;
|
|
mod long_operator_chains;
|
|
mod offset_overflow;
|
|
mod percent_entry;
|
|
mod pivot_unknown_func;
|
|
mod pivotchart_link;
|
|
mod range_fill_formats;
|
|
mod recently_used;
|
|
mod row_autofit;
|
|
mod sheet_copy_spill;
|
|
mod sheet_name_quoting;
|
|
mod sparse_clear_invalidation;
|
|
mod stored_list_shape;
|
|
mod table_resize_overlap;
|
|
mod table_total_row_last_row;
|
|
mod workbook_author;
|
|
mod wrap_row_height;
|