Skip to content

Commit b75904f

Browse files
danilsomsikovDevtools-frontend LUCI CQ
authored andcommitted
Limit value display in KeyValueStorageItemsView.
The UI was previously freezing when the user tries to render large values. We are now truncating the value to 4096 chars. Bug: 408976043 Change-Id: I75fec294ae474b6cc5871fc5c9c6e722561b122a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6455747 Commit-Queue: Benedikt Meurer <[email protected]> Auto-Submit: Danil Somsikov <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]>
1 parent bb65010 commit b75904f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

front_end/panels/application/KeyValueStorageItemsView.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ export interface ViewInput {
8686
onDelete: (event: CustomEvent<HTMLElement>) => void;
8787
}
8888

89+
const MAX_VALUE_LENGTH = 4096;
90+
8991
export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
9092
/**
9193
* A helper typically used in the Application panel. Renders a split view
@@ -136,7 +138,7 @@ export abstract class KeyValueStorageItemsView extends StorageItemsView {
136138
<tr data-key=${item.key} data-value=${item.value}
137139
selected=${(input.selectedKey === item.key) || nothing}>
138140
<td>${item.key}</td>
139-
<td>${item.value}</td>
141+
<td>${item.value.substr(0, MAX_VALUE_LENGTH)}</td>
140142
</tr>`)}
141143
<tr placeholder></tr>
142144
</table>

0 commit comments

Comments
 (0)