The aggregate paste decline no longer sends the user into a drill (improvise-48jd)
Inside a drill p declines too, so 'drill in to paste' led to a second refusal. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
This commit is contained in:
@@ -5074,3 +5074,16 @@ Pins that "aggregate" is asked of the key, not of the view. It passes at
|
||||
reads only whether the view has a regular category on None, which fails it —
|
||||
that rival would silently turn every scripted `paste` with full coordinates
|
||||
into a no-op on an aggregating view.
|
||||
|
||||
### the_aggregate_decline_does_not_send_the_user_where_paste_also_declines
|
||||
|
||||
improvise-48jd, from the #184 review. The aggregate decline said "drill in to
|
||||
paste into a record", and inside the drill `p` answers `PASTE_INSIDE_DRILL`, so
|
||||
the advice led to a second refusal. The test follows the advice literally: `p`
|
||||
on the West aggregate, `>` into its drill, cursor onto the `Revenue` column, `p`
|
||||
again. It asserts that the drilled paste really is the decline, so the setup
|
||||
cannot pass by landing on "no cell at cursor". A first version of the test did
|
||||
exactly that, because West had no record to drill into. It then asserts that
|
||||
the first message does not mention drilling. At `0ed2e41` it failed with the
|
||||
old text. The rival is restoring that text. Real drill paste, which means
|
||||
staging a typed `CellValue`, is still open as improvise-48jd.
|
||||
|
||||
@@ -317,6 +317,31 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_aggregate_decline_does_not_send_the_user_where_paste_also_declines() {
|
||||
let mut app = aggregated_app(crate::view::Axis::None);
|
||||
app.model_state.workbook.model.set_cell(
|
||||
record("West", "Revenue").with("Product", "Gadget"),
|
||||
CellValue::Number(3.0),
|
||||
);
|
||||
app.rebuild_layout();
|
||||
press(&mut app, 'p');
|
||||
let advice = app.view_state.status_msg.clone();
|
||||
press(&mut app, '>');
|
||||
assert!(app.drill_state.is_some(), "setup: the aggregate drills");
|
||||
app.cursor_mut().selected = (0, col_of(&app, "Revenue"));
|
||||
press(&mut app, 'p');
|
||||
let in_drill = app.view_state.status_msg.clone();
|
||||
assert_eq!(
|
||||
in_drill, PASTE_INSIDE_DRILL,
|
||||
"setup: the drilled paste declines"
|
||||
);
|
||||
assert!(
|
||||
!advice.to_lowercase().contains("drill"),
|
||||
"{advice:?} sends the user into a drill, where p answers {in_drill:?}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn paste_with_an_explicit_full_key_writes_even_where_the_view_aggregates() {
|
||||
let app = aggregated_app(crate::view::Axis::None);
|
||||
@@ -454,8 +479,7 @@ fn aggregates(ctx: &CmdContext, key: &CellKey) -> bool {
|
||||
})
|
||||
}
|
||||
|
||||
const PASTE_ONTO_AGGREGATE: &str =
|
||||
"Cannot paste onto an aggregate — drill in to paste into a record";
|
||||
const PASTE_ONTO_AGGREGATE: &str = "Cannot paste onto an aggregate — it combines several records, so there is no one cell to write";
|
||||
const PASTE_ONTO_NO_VALUE: &str = "Paste lands only on a measure column";
|
||||
const PASTE_INSIDE_DRILL: &str = "Paste is not staged inside a drill — edit the cell instead";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user