mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
feat: search frontend (#551)
* feat: better highlight * feat(search): add long_summary to search vector for improved search results - Update search vector to include long_summary with weight B (between title A and webvtt C) - Modify SearchController to fetch long_summary and prioritize its snippets - Generate snippets from long_summary first (max 2), then from webvtt for remaining slots - Add comprehensive tests for long_summary search functionality - Create migration to update search_vector_en column in PostgreSQL This improves search quality by including summarized content which often contains key topics and themes that may not be explicitly mentioned in the transcript. * fix: address code review feedback for search enhancements - Fix test file inconsistencies by removing references to non-existent model fields - Comment out tests for unimplemented features (room_ids, status filters, date ranges) - Update tests to only use currently available fields (room_id singular, no room_name/processing_status) - Mark future functionality tests with @pytest.mark.skip - Make snippet counts configurable - Add LONG_SUMMARY_MAX_SNIPPETS constant (default: 2) - Replace hardcoded value with configurable constant - Improve error handling consistency in WebVTT parsing - Use different log levels for different error types (debug for malformed, warning for decode, error for unexpected) - Add catch-all exception handler for unexpected errors - Include stack trace for critical errors All existing tests pass with these changes. * fix: correct datetime test to include required duration field * feat: better highlight * feat: search room names * feat: acknowledge deleted room * feat: search filters fix and rank removal * chore: minor refactoring * feat: better matches frontend * chore: self-review (vibe) * chore: self-review WIP * chore: self-review WIP * chore: self-review WIP * chore: self-review WIP * chore: self-review WIP * chore: self-review WIP * chore: self-review WIP * remove swc (vibe) * search url query sync (vibe) * search url query sync (vibe) * better casts and cap while * PR review + simplify frontend hook * pr: remove search db timeouts * cleanup tests * tests cleanup * frontend cleanup * index declarations * refactor frontend (self-review) * fix search pagination * clear "x" for search input * pagination max pages fix * chore: cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * cleanup * lockfile * pr review
This commit is contained in:
@@ -1002,7 +1002,7 @@ export const $SearchResponse = {
|
||||
},
|
||||
query: {
|
||||
type: "string",
|
||||
minLength: 1,
|
||||
minLength: 0,
|
||||
title: "Query",
|
||||
description: "Search query text",
|
||||
},
|
||||
@@ -1065,6 +1065,20 @@ export const $SearchResult = {
|
||||
],
|
||||
title: "Room Id",
|
||||
},
|
||||
room_name: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
type: "null",
|
||||
},
|
||||
],
|
||||
title: "Room Name",
|
||||
},
|
||||
source_kind: {
|
||||
$ref: "#/components/schemas/SourceKind",
|
||||
},
|
||||
created_at: {
|
||||
type: "string",
|
||||
title: "Created At",
|
||||
@@ -1101,10 +1115,18 @@ export const $SearchResult = {
|
||||
title: "Search Snippets",
|
||||
description: "Text snippets around search matches",
|
||||
},
|
||||
total_match_count: {
|
||||
type: "integer",
|
||||
minimum: 0,
|
||||
title: "Total Match Count",
|
||||
description: "Total number of matches found in the transcript",
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
type: "object",
|
||||
required: [
|
||||
"id",
|
||||
"source_kind",
|
||||
"created_at",
|
||||
"status",
|
||||
"rank",
|
||||
|
||||
@@ -286,6 +286,7 @@ export class DefaultService {
|
||||
* @param data.limit Results per page
|
||||
* @param data.offset Number of results to skip
|
||||
* @param data.roomId
|
||||
* @param data.sourceKind
|
||||
* @returns SearchResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
@@ -300,6 +301,7 @@ export class DefaultService {
|
||||
limit: data.limit,
|
||||
offset: data.offset,
|
||||
room_id: data.roomId,
|
||||
source_kind: data.sourceKind,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
|
||||
@@ -209,6 +209,8 @@ export type SearchResult = {
|
||||
title?: string | null;
|
||||
user_id?: string | null;
|
||||
room_id?: string | null;
|
||||
room_name?: string | null;
|
||||
source_kind: SourceKind;
|
||||
created_at: string;
|
||||
status: string;
|
||||
rank: number;
|
||||
@@ -220,6 +222,10 @@ export type SearchResult = {
|
||||
* Text snippets around search matches
|
||||
*/
|
||||
search_snippets: Array<string>;
|
||||
/**
|
||||
* Total number of matches found in the transcript
|
||||
*/
|
||||
total_match_count?: number;
|
||||
};
|
||||
|
||||
export type SourceKind = "room" | "live" | "file";
|
||||
@@ -407,6 +413,7 @@ export type V1TranscriptsSearchData = {
|
||||
*/
|
||||
q: string;
|
||||
roomId?: string | null;
|
||||
sourceKind?: SourceKind | null;
|
||||
};
|
||||
|
||||
export type V1TranscriptsSearchResponse = SearchResponse;
|
||||
|
||||
2
www/app/api/urls.ts
Normal file
2
www/app/api/urls.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// TODO better connection with generated schema; it's duplication
|
||||
export const RECORD_A_MEETING_URL = "/transcripts/new" as const;
|
||||
Reference in New Issue
Block a user