ui: fix missing redraw calls on logs panel
Fixes: https://github.com/google/perfetto/issues/922
Change-Id: I82c4952197ac05bc4b828396bec3af8331bed273
diff --git a/ui/src/plugins/dev.perfetto.AndroidLog/logs_panel.ts b/ui/src/plugins/dev.perfetto.AndroidLog/logs_panel.ts
index 1504b6b..48714ba 100644
--- a/ui/src/plugins/dev.perfetto.AndroidLog/logs_panel.ts
+++ b/ui/src/plugins/dev.perfetto.AndroidLog/logs_panel.ts
@@ -96,7 +96,7 @@
{
title: 'Android Logs',
description: `Total messages: ${totalEvents}`,
- buttons: m(LogsFilters, {store: attrs.filterStore}),
+ buttons: m(LogsFilters, {trace: attrs.trace, store: attrs.filterStore}),
},
m(VirtualTable, {
className: 'pf-android-logs-table',
@@ -199,9 +199,10 @@
const IGNORED_STATES = 2;
interface LogPriorityWidgetAttrs {
- options: string[];
- selectedIndex: number;
- onSelect: (id: number) => void;
+ readonly trace: Trace;
+ readonly options: string[];
+ readonly selectedIndex: number;
+ readonly onSelect: (id: number) => void;
}
class LogPriorityWidget implements m.ClassComponent<LogPriorityWidgetAttrs> {
@@ -220,6 +221,7 @@
onchange: (e: Event) => {
const selectionValue = (e.target as HTMLSelectElement).value;
attrs.onSelect(Number(selectionValue));
+ attrs.trace.scheduleFullRedraw();
},
},
optionComponents,
@@ -228,7 +230,8 @@
}
interface LogTextWidgetAttrs {
- onChange: (value: string) => void;
+ readonly trace: Trace;
+ readonly onChange: (value: string) => void;
}
class LogTextWidget implements m.ClassComponent<LogTextWidgetAttrs> {
@@ -240,15 +243,16 @@
// updated with the latest key (onkeyup).
const htmlElement = e.target as HTMLInputElement;
attrs.onChange(htmlElement.value);
+ attrs.trace.scheduleFullRedraw();
},
});
}
}
interface FilterByTextWidgetAttrs {
- hideNonMatching: boolean;
- disabled: boolean;
- onClick: () => void;
+ readonly hideNonMatching: boolean;
+ readonly disabled: boolean;
+ readonly onClick: () => void;
}
class FilterByTextWidget implements m.ClassComponent<FilterByTextWidgetAttrs> {
@@ -267,7 +271,8 @@
}
interface LogsFiltersAttrs {
- store: Store<LogFilteringCriteria>;
+ readonly trace: Trace;
+ readonly store: Store<LogFilteringCriteria>;
}
export class LogsFilters implements m.ClassComponent<LogsFiltersAttrs> {
@@ -275,6 +280,7 @@
return [
m('.log-label', 'Log Level'),
m(LogPriorityWidget, {
+ trace: attrs.trace,
options: LOG_PRIORITIES,
selectedIndex: attrs.store.state.minimumLevel,
onSelect: (minimumLevel) => {
@@ -298,6 +304,7 @@
},
}),
m(LogTextWidget, {
+ trace: attrs.trace,
onChange: (text) => {
attrs.store.edit((draft) => {
draft.textEntry = text;