Skip to content

Conversation

@ahrefabhi
Copy link
Contributor

@ahrefabhi ahrefabhi commented Nov 13, 2025

Refactor: Convert QuerySearch CodeMirror Component to Uncontrolled

📄 Summary

This PR refactors the QuerySearch component to use an uncontrolled CodeMirror editor pattern, eliminating local query state management and fixing cursor jumping issues that occurred when the component was controlled.

✅ Changes

Refactoring

  • Removed local query state: Eliminated redundant local state tracking of the query value
  • Uncontrolled CodeMirror: CodeMirror now manages its own internal state via the editor ref instead of being controlled by React state

@github-actions github-actions bot added the chore label Nov 13, 2025
@ahrefabhi ahrefabhi marked this pull request as draft November 13, 2025 07:32
@ahrefabhi ahrefabhi marked this pull request as ready for review November 16, 2025 10:05
@ahrefabhi ahrefabhi changed the title chore: converted querysearch codemirror component to uncontrolled com… chore: converted querysearch codemirror component to uncontrolled component Nov 16, 2025
Copy link
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

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

Examples where it breaks with other behaviour changes

  • add a filter in list view page of traces service.name = 'frontend' and then switch to time series view
  • use the "Share" button we show on the top right of the page and use "Copy page link" to get the sharable URL and open that URL.

They should be caught is dev testing and we should write tests to ensure such problems are caught if we don't have tests already for them.

@ahrefabhi
Copy link
Contributor Author

Examples where it breaks with other behaviour changes

  • add a filter in list view page of traces service.name = 'frontend' and then switch to time series view
  • use the "Share" button we show on the top right of the page and use "Copy page link" to get the sharable URL and open that URL.

They should be caught is dev testing and we should write tests to ensure such problems are caught if we don't have tests already for them.

The above issues are fixed, added tests as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants