feat(frontend): search results show deleted, edited and earlier version marks with highlighted words, filter chips live in the url, results load on scroll

This commit is contained in:
hh committed 2026-10-19 03:41:44 +00:00
1 parent d45c96c259
commit 9a6bd8a714
15 files changed
+1430 -228

No files matched your search

+4 -9
View File
@@ -41,7 +41,8 @@ import type {
ReadInfo,
ResponseStats,
ScopeTarget,
SearchHit,
SearchPage,
SearchQuery,
StorageChat,
StorageFile,
StorageGroupName,
@@ -555,14 +556,8 @@ export function getMessageMedia(
});
}
export function searchMessages(
query: string,
options: Page & { chat_id?: number } = {}
): Promise<SearchHit[]> {
return request<SearchHit[]>("/search", {
account: true,
query: { query, ...options },
});
export function searchMessages(query: SearchQuery): Promise<SearchPage> {
return request<SearchPage>("/search", { account: true, query: { ...query } });
}
export function fetchMedia(
+29 -1
View File
@@ -7,7 +7,9 @@ export type PolicyScopeType =
| "default_channel"
| "folder"
| "chat";
export type SearchSource = "text" | "stt";
export type SearchSource = "text" | "stt" | "version";
export type SearchChatKind = "private" | "group" | "channel";
export type JobStatus =
| "pending"
| "running"
@@ -281,11 +283,37 @@ export interface MediaVersion {
export interface SearchHit {
chat_id: number;
date: string;
deleted_at: string | null;
edited_at: string | null;
extracted_text: string | null;
has_media: boolean;
media_kind: string | null;
message_id: number;
sender_id: number | null;
source: SearchSource;
text: string | null;
version_at: string | null;
version_text: string | null;
}
export interface SearchPage {
hits: SearchHit[];
next_cursor: string | null;
terms: string[];
}
export interface SearchQuery {
chat_id?: number;
cursor?: string;
date_from?: string;
date_to?: string;
deleted?: boolean;
edited?: boolean;
has_media?: boolean;
kind?: SearchChatKind;
limit?: number;
query?: string;
sender_id?: number;
}
export interface MediaView {