Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add AI Regex Helper to path cleaning #28512

Merged
merged 16 commits into from
Feb 11, 2025
Merged

Conversation

rafaeelaudibert
Copy link
Member

Problem

Regex is tricky to get it right. Path cleaning is pretty powerful. You can't use something powerful if it's tricky.

Changes

Let's reuse Session Replay's amazing AIRegexHelper component in our PathCleaningRegex UI!

image

I've improved Session Replay's UI along the way as well as a means to thank them for this cool feature :)

Does this work well for both Cloud and self-hosted?

Yep

How did you test this code?

Visually + snapshots will update

The component was tied to the Session Replay usage, it can now be used anywhere
Stealing this component from SessionReplay because it's way too cool to not be used in some other places as well. Regex sucks and this is great for users.
@rafaeelaudibert rafaeelaudibert changed the title Add AI Regex Helper to path cleaning feat: Add AI Regex Helper to path cleaning Feb 10, 2025
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.

PR Summary

This PR integrates AI-assisted regex generation into the path cleaning feature by replacing the PathRegexPopover with a new PathRegexModal component and reusing the existing AiRegexHelper from session recordings.

  • Added new PathRegexModal.tsx with AI regex generation support behind the PATH_CLEANING_AI_REGEX feature flag
  • Modified AiRegexHelper component to be more reusable by removing direct dependency on replayTriggersLogic and adding an onApply callback prop
  • Added Storybook stories in PathRegexModal.stories.tsx to test new rule creation, editing, and AI helper functionality
  • Improved error handling and user feedback in aiRegexHelperLogic.ts for better error cases and API response handling
  • Added new feature flag PATH_CLEANING_AI_REGEX in constants.tsx for controlled rollout

9 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Feb 10, 2025

Size Change: +48 B (0%)

Total Size: 1.18 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.18 MB +48 B (0%)

compressed-size-action

If we don't do that, then it doesn't render the whole modal because it's floating
@veryayskiy
Copy link
Contributor

Once you agree it does not make sense to have the arrow down anymore..

Copy link
Contributor

@veryayskiy veryayskiy left a comment

Choose a reason for hiding this comment

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

Rather than the buttons - all good. I'd even maybe remove the flag already and made it public.

Copy link
Contributor

@veryayskiy veryayskiy left a comment

Choose a reason for hiding this comment

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

a couple of comments

@rafaeelaudibert rafaeelaudibert enabled auto-merge (squash) February 11, 2025 21:48
@rafaeelaudibert rafaeelaudibert merged commit 039d09b into master Feb 11, 2025
102 checks passed
@rafaeelaudibert rafaeelaudibert deleted the ai-for-path-cleaning branch February 11, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants