Skip to content

Expand text search to cover offset and metadata #1356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/stream/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ export function includesSubstring(value: PartitionConsumeRecord, query: RegExp):
if (key != null && query.test(key)) return true;
let val = value.value as any;
if (val != null && query.test(val)) return true;
let offset = value.offset as any;
if (offset != null && query.test(offset)) return true;
let metadata = value.metadata as any;
if (metadata != null && query.test(JSON.stringify(metadata))) return true;
return false;
}

Expand Down
3 changes: 2 additions & 1 deletion src/webview/message-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ class MessageViewerViewModel extends ViewModel {
offset: {
index: 2,
title: () => "Offset",
children: (message: PartitionConsumeRecord) => message.offset,
children: (message: PartitionConsumeRecord) =>
this.formatMessageValue(message.offset, this.searchRegexp()),
description: (message: PartitionConsumeRecord) => message.offset,
},
key: {
Expand Down