(core) Include linking rowIds into remembered cursor position and anchor links.

Summary:
When linking using a Reference List column, there may be multiple source
records that show the same target record. With this change, we remember those
(rather than just pick one that shows the target record).

Test Plan: Added a browser test.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D4140
This commit is contained in:
Dmitry S
2023-12-29 00:17:50 -05:00
parent a311b8b3e5
commit 527e9670ef
8 changed files with 291 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ export const CursorPos = t.iface([], {
"rowIndex": t.opt("number"),
"fieldIndex": t.opt("number"),
"sectionId": t.opt("number"),
"linkingRowIds": t.opt(t.array("UIRowId")),
});
export const ComponentKind = t.union(t.lit("safeBrowser"), t.lit("safePython"), t.lit("unsafeNode"));

View File

@@ -65,6 +65,11 @@ export interface CursorPos {
* The id of a section that this cursor is in. Ignored when setting a cursor position for a particular view.
*/
sectionId?: number;
/**
* When in a linked section, CursorPos may include which rows in the controlling sections are
* selected: the rowId in the linking-source section, in _that_ section's linking source, etc.
*/
linkingRowIds?: UIRowId[];
}
export type ComponentKind = "safeBrowser" | "safePython" | "unsafeNode";