Skip to content

Conversation

@omkarK06
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the ☢️ Bug Something isn't working label Dec 10, 2025
@github-actions
Copy link
Contributor

Failed to generate code suggestions for PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 10, 2025

Greptile Overview

Greptile Summary

Centralizes highlight query management by storing it in searchObj.data.highlightQuery, replacing duplicated inline query parsing logic in SearchResult.vue.

Key Changes:

  • Added highlightQuery field to SearchObjectData interface
  • Reset and update highlightQuery in useSearchQuery.getQueryReq() on each query execution
  • Replaced inline query parsing (searchObj.data.query.toLowerCase().split('where')[1]) with centralized searchObj.data.highlightQuery in both logs table and detail sidebar

Issues Found:

  • highlightQuery is missing from DEFAULT_LOGS_CONFIG constant in constants.ts, causing it to be undefined until the first query runs

Confidence Score: 3/5

  • This PR is safe to merge with one logical issue that needs to be addressed
  • The approach of centralizing highlight query management is sound and reduces code duplication. However, the highlightQuery field is not initialized in DEFAULT_LOGS_CONFIG, which will cause it to be undefined until the first query executes. This could lead to highlighting not working correctly on initial page load or after state reset.
  • web/src/composables/useLogs/searchState.ts requires the addition of highlightQuery to DEFAULT_LOGS_CONFIG in constants.ts

Important Files Changed

File Analysis

Filename Score Overview
web/src/composables/useLogs/searchState.ts 3/5 Added highlightQuery field to SearchObjectData interface but missing from DEFAULT_LOGS_CONFIG
web/src/composables/useLogs/useSearchQuery.ts 4/5 Resets and updates highlightQuery in getQueryReq() to maintain consistent highlight state across query executions
web/src/plugins/logs/SearchResult.vue 5/5 Replaced inline query parsing logic with centralized searchObj.data.highlightQuery for consistent highlighting

Sequence Diagram

sequenceDiagram
    participant User
    participant SearchResult
    participant useSearchQuery
    participant searchState
    participant LogsTable
    participant DetailTable

    User->>SearchResult: Run query
    SearchResult->>useSearchQuery: getQueryReq()
    useSearchQuery->>searchState: Reset highlightQuery to ""
    searchState-->>useSearchQuery: highlightQuery = ""
    useSearchQuery->>useSearchQuery: buildSearch()
    useSearchQuery->>useSearchQuery: Check sqlMode
    alt SQL Mode
        useSearchQuery->>searchState: Set highlightQuery = query.toLowerCase().split("where")[1]
    else Non-SQL Mode
        useSearchQuery->>searchState: Set highlightQuery = query.toLowerCase()
    end
    searchState-->>useSearchQuery: highlightQuery updated
    useSearchQuery-->>SearchResult: Query executed
    SearchResult->>LogsTable: Pass highlightQuery prop
    LogsTable-->>LogsTable: Highlight matching terms
    User->>SearchResult: Click log row
    SearchResult->>DetailTable: Show detail dialog
    SearchResult->>DetailTable: Pass same highlightQuery prop
    DetailTable-->>DetailTable: Highlight matching terms consistently
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@omkarK06 omkarK06 merged commit b92dd67 into branch-v0.30.0 Dec 10, 2025
38 checks passed
@omkarK06 omkarK06 deleted the fix/match-all-highlight-inconsistency-v0.30.0 branch December 10, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☢️ Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants