-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
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.
There was a problem hiding this 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 thePATH_CLEANING_AI_REGEX
feature flag - Modified
AiRegexHelper
component to be more reusable by removing direct dependency onreplayTriggersLogic
and adding anonApply
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
inconstants.tsx
for controlled rollout
9 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile
frontend/src/lib/components/PathCleanFilters/PathCleanFilterAddItemButton.tsx
Outdated
Show resolved
Hide resolved
frontend/src/lib/components/PathCleanFilters/PathRegexModal.stories.tsx
Outdated
Show resolved
Hide resolved
frontend/src/lib/components/PathCleanFilters/PathRegexModal.tsx
Outdated
Show resolved
Hide resolved
frontend/src/scenes/session-recordings/components/AiRegexHelper/AiRegexHelper.tsx
Outdated
Show resolved
Hide resolved
frontend/src/scenes/session-recordings/components/AiRegexHelper/aiRegexHelperLogic.ts
Show resolved
Hide resolved
frontend/src/scenes/session-recordings/components/AiRegexHelper/aiRegexHelperLogic.ts
Show resolved
Hide resolved
Size Change: +48 B (0%) Total Size: 1.18 MB ℹ️ View Unchanged
|
frontend/__snapshots__/filters-pathregexmodal--edit-existing-rule--dark.png
Outdated
Show resolved
Hide resolved
If we don't do that, then it doesn't render the whole modal because it's floating
bb1ee6a
to
dba08f4
Compare
Once you agree it does not make sense to have the arrow down anymore.. |
There was a problem hiding this 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.
There was a problem hiding this 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
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!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