diff --git a/app/client/components/LinkingState.ts b/app/client/components/LinkingState.ts index 3f27f4ae..278f5dd1 100644 --- a/app/client/components/LinkingState.ts +++ b/app/client/components/LinkingState.ts @@ -96,7 +96,7 @@ export class LinkingState extends Disposable { } } else if (srcColId && isRefListType(srcCol.type())) { this.filterColValues = this._srcCellFilter('id', 'in'); - } else if (isSummaryOf(srcSection.table(), tgtSection.table())) { + } else if (!srcColId && isSummaryOf(srcSection.table(), tgtSection.table())) { // We filter summary tables when a summary section is linked to a more detailed one without // specifying src or target column. The filtering is on the shared group-by column (i.e. all // those in the srcSection). diff --git a/app/client/ui/selectBy.ts b/app/client/ui/selectBy.ts index 00be302b..c92160ba 100644 --- a/app/client/ui/selectBy.ts +++ b/app/client/ui/selectBy.ts @@ -69,8 +69,13 @@ function isValidLink(source: LinkNode, target: LinkNode) { return false; } - // summary table can only link to and from the main node (node with no column) - if ((source.isSummary || target.isSummary) && (source.column || target.column)) { + // cannot link to the somewhat special 'group' reflist column of summary tables + // because in most cases it's equivalent to the usual summary table linking but potentially slower, + // and in other cases it may cause confusion with overwhelming options. + if ( + (source.isSummary && source.column?.colId.peek() === "group") || + (target.isSummary && target.column?.colId.peek() === "group") + ) { return false; }