Skip to content

Commit b7ff802

Browse files
authored
Fix sometimes wrong preview (#39)
1 parent 16976d9 commit b7ff802

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v0.6.4
4+
5+
- Fix the MatchImageUi component displaying the wrong image when filtering out
6+
the first match, then clicking on the first new match.
7+
38
## v0.6.3
49

510
- Fix the alignment in the first paragraph of the Advanced tab.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codec_compare",
3-
"version": "0.6.3",
3+
"version": "0.6.4",
44
"description": "Codec performance comparison tool",
55
"publisher": "Google LLC",
66
"author": "Yannis Guyon",

src/codec_compare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export class CodecCompare extends LitElement {
252252
</p>
253253
254254
<p id="credits">
255-
Codec Compare version 0.6.3<br>
255+
Codec Compare version 0.6.4<br>
256256
<a href="https://github.com/webmproject/codec-compare">
257257
Sources on GitHub
258258
</a>

src/matches_ui.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import './match_image_ui';
1919
import './matches_table_ui';
2020

2121
import {css, html, LitElement} from 'lit';
22-
import {customElement, property} from 'lit/decorators.js';
22+
import {customElement, property, query} from 'lit/decorators.js';
2323

2424
import {BatchSelection} from './batch_selection';
25-
import {Batch, FieldId} from './entry';
2625
import {EventType, listen} from './events';
26+
import {MatchImageUi} from './match_image_ui';
2727
import {State} from './state';
2828
import {getRdModeHash} from './state_hash';
2929

@@ -38,9 +38,15 @@ export class MatchesUi extends LitElement {
3838
@property({attribute: false}) batchSelection!: BatchSelection;
3939
@property({attribute: false}) matchIndex!: number|undefined;
4040

41+
@query('match-image-ui') private readonly matchImageUi!: MatchImageUi;
42+
4143
override connectedCallback() {
4244
super.connectedCallback();
4345
listen(EventType.MATCHED_DATA_POINTS_CHANGED, () => {
46+
// batchSelection and matchIndex may stay the same, while the underlying
47+
// data points changed, so this.matchImageUi could display the wrong
48+
// image. Explicitly update it in this case.
49+
this.matchImageUi.requestUpdate();
4450
this.requestUpdate();
4551
});
4652
}

0 commit comments

Comments
 (0)