Skip to content

Commit 53a5984

Browse files
committed
fix: reverted topics fix out of scope
1 parent 9c4160c commit 53a5984

File tree

1 file changed

+3
-37
lines changed
  • frontend/src/components/pages/topics/Tab.Messages

1 file changed

+3
-37
lines changed

frontend/src/components/pages/topics/Tab.Messages/index.tsx

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ export const TopicMessageView: FC<TopicMessageViewProps> = (props) => {
556556
return () => clearTimeout(timer);
557557
}, [loadMorePhase]);
558558
const currentSearchRunRef = useRef<string | null>(null);
559-
const searchGenRef = useRef(0);
560559
const abortControllerRef = useRef<AbortController | null>(null);
561560
const prevStartOffsetRef = useRef<number>(startOffset);
562561
const prevMaxResultsRef = useRef<number>(maxResults);
@@ -599,21 +598,6 @@ export const TopicMessageView: FC<TopicMessageViewProps> = (props) => {
599598
currentMessageSearchRef.current = messageSearch;
600599
}, [messageSearch]);
601600

602-
// Poll search object for live progress during streaming
603-
useEffect(() => {
604-
if (searchPhase === null) {
605-
return;
606-
}
607-
const interval = setInterval(() => {
608-
const search = currentMessageSearchRef.current;
609-
if (search) {
610-
setBytesConsumed(search.bytesConsumed);
611-
setTotalMessagesConsumed(search.totalMessagesConsumed);
612-
}
613-
}, 200);
614-
return () => clearInterval(interval);
615-
}, [searchPhase]);
616-
617601
// Keep virtualStartIndexRef in sync
618602
useEffect(() => {
619603
virtualStartIndexRef.current = virtualStartIndex;
@@ -732,7 +716,6 @@ export const TopicMessageView: FC<TopicMessageViewProps> = (props) => {
732716
try {
733717
setFetchError(null);
734718
setSearchPhase('Searching...');
735-
const searchGen = searchGenRef.current;
736719

737720
const search = createMessageSearch();
738721
setSearchState((prev) => ({ ...prev, messageSearch: search }));
@@ -748,12 +731,6 @@ export const TopicMessageView: FC<TopicMessageViewProps> = (props) => {
748731
});
749732

750733
const endTime = Date.now();
751-
752-
// Discard results from a superseded search
753-
if (searchGen !== searchGenRef.current) {
754-
return [];
755-
}
756-
757734
setSearchState((prev) => ({ ...prev, messages: result, windowStartPage: 0 }));
758735
windowStartPageRef.current = 0;
759736
if (maxResults < pageSize) {
@@ -806,7 +783,6 @@ export const TopicMessageView: FC<TopicMessageViewProps> = (props) => {
806783

807784
// Start new search
808785
currentSearchRunRef.current = searchParams;
809-
searchGenRef.current += 1;
810786
abortControllerRef.current = new AbortController();
811787

812788
// Clear messages immediately when starting new search
@@ -848,10 +824,10 @@ export const TopicMessageView: FC<TopicMessageViewProps> = (props) => {
848824
// Auto search when parameters change
849825
// biome-ignore lint/correctness/useExhaustiveDependencies: forceRefresh is intentionally watched to trigger forced re-search
850826
useEffect(() => {
851-
// Set up auto-search with 300ms delay to let rapid multi-param URL changes settle
827+
// Set up auto-search with 100ms delay
852828
const timer = setTimeout(() => {
853829
searchFunc('auto');
854-
}, 300);
830+
}, 100);
855831

856832
appGlobal.searchMessagesFunc = searchFunc;
857833

@@ -1738,20 +1714,10 @@ export const TopicMessageView: FC<TopicMessageViewProps> = (props) => {
17381714
<TableBody>
17391715
{(() => {
17401716
if (searchPhase !== null && filteredMessages.length === 0) {
1741-
const hasProgress = bytesConsumed > 0 || totalMessagesConsumed > 0;
17421717
return (
17431718
<TableRow>
17441719
<TableCell className="py-10 text-center" colSpan={table.getVisibleFlatColumns().length}>
1745-
<div className="mx-auto flex max-w-xs flex-col items-center gap-3">
1746-
{hasProgress ? (
1747-
<span className="text-muted-foreground text-sm">
1748-
{prettyBytes(bytesConsumed)} scanned, {totalMessagesConsumed.toLocaleString()} messages
1749-
checked
1750-
</span>
1751-
) : (
1752-
<Spinner size="md" />
1753-
)}
1754-
</div>
1720+
<Spinner size="md" />
17551721
</TableCell>
17561722
</TableRow>
17571723
);

0 commit comments

Comments
 (0)