Commit dac8313
committed
fix(chat): scope selections to the columns actually picked, and stop under-counting rows
Three findings from one Bugbot round.
Hidden columns widened cell ranges (reported twice). buildTableSelectionContext
and contextMenuColumnIds collapsed a range to an open scope when it covered
'every column', comparing against displayColumns.length — which drops hidden
columns AND expands workflow groups, so it never meant 'the whole schema'.
Selecting every visible column therefore cleared columnIds and the server
re-fetched columns the user had hidden. The collapse is removed rather than
re-based on a schema count: no count available to a caller describes the schema,
and an explicit column list is what the user actually selected. totalColumnCount
is gone from the signature.
Add-to-chat label undercounted rows. The menu derived its count from
selectedRowCount (loaded rows only) while the chip was built from the full
rowSel.ids set, so the label could promise fewer rows than were sent. Both now
read one addToChatRowIds memo, with the count passed through explicitly since it
legitimately differs from the count the delete/run labels use.
Monaco line range was off by one. A full-line highlight ends at column 1 of the
FOLLOWING line, so endLineNumber named a line that contributed no text — the
chip label and the agent prompt both claimed an extra line.
The collapse test I added last round asserted the buggy behavior as correct; it
now pins the opposite, and fails if the collapse returns.1 parent 65ddf42 commit dac8313
5 files changed
Lines changed: 69 additions & 37 deletions
File tree
- apps/sim/app/workspace/[workspaceId]
- files/components/file-viewer
- tables/[tableId]/components
- table-grid
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
394 | 400 | | |
395 | 401 | | |
396 | 402 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| |||
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
| 100 | + | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
| |||
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | | - | |
117 | | - | |
| 125 | + | |
| 126 | + | |
118 | 127 | | |
119 | 128 | | |
120 | 129 | | |
| |||
Lines changed: 28 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2985 | 2985 | | |
2986 | 2986 | | |
2987 | 2987 | | |
2988 | | - | |
2989 | 2988 | | |
2990 | 2989 | | |
2991 | 2990 | | |
| |||
3034 | 3033 | | |
3035 | 3034 | | |
3036 | 3035 | | |
3037 | | - | |
3038 | 3036 | | |
3039 | 3037 | | |
3040 | 3038 | | |
| |||
3062 | 3060 | | |
3063 | 3061 | | |
3064 | 3062 | | |
3065 | | - | |
3066 | 3063 | | |
3067 | 3064 | | |
3068 | 3065 | | |
| |||
3786 | 3783 | | |
3787 | 3784 | | |
3788 | 3785 | | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
| 3793 | + | |
| 3794 | + | |
| 3795 | + | |
| 3796 | + | |
| 3797 | + | |
| 3798 | + | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
3789 | 3805 | | |
3790 | 3806 | | |
3791 | 3807 | | |
3792 | 3808 | | |
3793 | | - | |
3794 | | - | |
| 3809 | + | |
3795 | 3810 | | |
3796 | 3811 | | |
3797 | 3812 | | |
| |||
3807 | 3822 | | |
3808 | 3823 | | |
3809 | 3824 | | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
3810 | 3828 | | |
3811 | | - | |
| 3829 | + | |
3812 | 3830 | | |
3813 | 3831 | | |
3814 | 3832 | | |
| |||
3818 | 3836 | | |
3819 | 3837 | | |
3820 | 3838 | | |
3821 | | - | |
3822 | | - | |
3823 | | - | |
3824 | | - | |
3825 | | - | |
3826 | | - | |
3827 | | - | |
3828 | | - | |
| 3839 | + | |
3829 | 3840 | | |
3830 | 3841 | | |
3831 | 3842 | | |
| |||
3844 | 3855 | | |
3845 | 3856 | | |
3846 | 3857 | | |
3847 | | - | |
3848 | 3858 | | |
3849 | 3859 | | |
3850 | 3860 | | |
3851 | 3861 | | |
3852 | 3862 | | |
3853 | 3863 | | |
3854 | | - | |
| 3864 | + | |
3855 | 3865 | | |
3856 | 3866 | | |
3857 | | - | |
3858 | 3867 | | |
3859 | 3868 | | |
3860 | | - | |
3861 | 3869 | | |
3862 | 3870 | | |
3863 | 3871 | | |
| |||
4582 | 4590 | | |
4583 | 4591 | | |
4584 | 4592 | | |
4585 | | - | |
| 4593 | + | |
4586 | 4594 | | |
| 4595 | + | |
4587 | 4596 | | |
4588 | 4597 | | |
4589 | 4598 | | |
| |||
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
68 | | - | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
| |||
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
381 | 385 | | |
382 | 386 | | |
383 | 387 | | |
384 | 388 | | |
385 | | - | |
386 | 389 | | |
387 | 390 | | |
388 | 391 | | |
389 | | - | |
| 392 | + | |
390 | 393 | | |
391 | 394 | | |
392 | 395 | | |
393 | | - | |
394 | | - | |
395 | | - | |
| 396 | + | |
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
| |||
0 commit comments