Skip to content

Fix preview image discrepancy in RD-mode#40

Merged
y-guyon merged 3 commits into
webmproject:mainfrom
y-guyon:singlebatch
Jun 27, 2025
Merged

Fix preview image discrepancy in RD-mode#40
y-guyon merged 3 commits into
webmproject:mainfrom
y-guyon:singlebatch

Conversation

@y-guyon
Copy link
Copy Markdown
Collaborator

@y-guyon y-guyon commented Jun 27, 2025

Instead of passing around the selected batch as the reference batch when in absolute or RD-mode, leave the reference batch undefined to avoid wrongly referencing into the selected batch with rightIndex.

When there is a reference:
leftIndex points to selected row (correct)
rightIndex points to reference row (correct)

Otherwise, before this change:
leftIndex pointed to selected row (correct)
rightIndex pointed to selected row (which is wrongly indexed)
Otherwise, after this change:
leftIndex points to selected row (correct)
rightIndex cannot point to undefined (caught by typescript)

The data shown in the table was correct. Only some cell coloring and the preview image were sometimes stale.

Instead of passing around the selected batch as the reference batch
when in absolute or RD-mode, leave the reference batch undefined to
avoid wrongly referencing into the selected batch with rightIndex.

When there is a reference:
  leftIndex points to selected row (correct)
  rightIndex points to reference row (correct)

Otherwise, before this change:
  leftIndex pointed to selected row (correct)
  rightIndex pointed to selected row (which is wrongly indexed)
Otherwise, after this change:
  leftIndex points to selected row (correct)
  rightIndex cannot point to undefined (caught by typescript)

The data shown in the table was correct. Only some cell coloring and
the preview image were sometimes stale.
@y-guyon y-guyon requested a review from maryla-uc June 27, 2025 14:40
@y-guyon y-guyon merged commit d9f23e4 into webmproject:main Jun 27, 2025
1 check passed
@y-guyon y-guyon deleted the singlebatch branch June 27, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants