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: split issue loading and redesign issue page #28083

Merged
merged 42 commits into from
Feb 11, 2025

Conversation

daibhin
Copy link
Contributor

@daibhin daibhin commented Jan 30, 2025

Problem

In preparation for some wider changes we want to make about how events are displayed on issues. PR was getting too large so I decided to stop here

Changes

  • Splits issue loading up to first fetch relational PG model. This will allow us to clamp the query on the issue page to the earliest the event was ever seen (rather than all time).
    • Also fixes a bug where the lookup was clamped by the date range set on the previous page that wasn't even visible / adjustable from the issue page
  • Redesigned issue page
    Screenshot 2025-01-30 at 12 28 07

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 introduces significant changes to the error tracking system by splitting issue loading into two phases and redesigning the issue page UI. Here's a summary of the key changes:

  • Split issue loading to first fetch relational PostgreSQL model data before ClickHouse queries, allowing for better date range optimization based on when issues were first seen
  • Redesigned error tracking issue page by removing tabs in favor of a single-page layout with collapsible panels for stacktrace and recording information
  • Added new components Metadata.tsx and Events.tsx to better organize issue details and event information
  • Introduced EventsMode (Latest/Earliest/Recommended/All) for more flexible event viewing options
  • Updated schema to split ErrorTrackingIssue into separate relational and aggregation models for better data organization

The changes improve performance and fix a bug where queries were incorrectly clamped by the previous page's date range.

26 file(s) reviewed, 20 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +33 to 35
function PanelLayout({ className, ...props }: Omit<PanelContainerProps, 'primary'>): JSX.Element {
return <Container className={clsx(className, 'PanelLayout')} {...props} primary={false} />
}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: PanelLayout always sets primary to false, which seems to make the primary prop in PanelContainerProps redundant since it's never true

Comment on lines +63 to +64
border: 'bottom' | 'top'
}>): JSX.Element {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: border prop is required but title is optional - consider making border optional with a default value since it's a visual preference

Comment on lines 1960 to 1963
id: ErrorTrackingIssue['id'],
data: Partial<Pick<ErrorTrackingIssue, 'assignee' | 'status'>>
): Promise<ErrorTrackingIssue> {
): Promise<ErrorTrackingRelationalIssue> {
return await new ApiRequest().errorTrackingIssue(id).update({ data })
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Return type changed to ErrorTrackingRelationalIssue but data parameter still uses ErrorTrackingIssue - consider using the relational type for consistency

Comment on lines +11 to +13
& .LemonCollapsePanel > .LemonButton:hover:has(.LemonSegmentedButton:hover) {
background-color: inherit;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: using :has() selector may cause compatibility issues in older browsers

Comment on lines +20 to +21
onSelect={setOrderBy}
onChange={setOrderBy}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: redundant handlers - both onSelect and onChange are specified with the same function. Only one is needed since they serve the same purpose

Suggested change
onSelect={setOrderBy}
onChange={setOrderBy}
onChange={setOrderBy}
onChange={setOrderBy}

return (
<>
<PanelLayout.PanelSettings title="Events" border="bottom">
{eventsMode != EventsMode.All && (
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: != operator used instead of !== for strict equality comparison with enum

Suggested change
{eventsMode != EventsMode.All && (
{eventsMode !== EventsMode.All && (

)}
<SettingsButton
label={eventsMode === EventsMode.All ? 'Close' : 'View all events'}
active
Copy link
Contributor

Choose a reason for hiding this comment

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

style: active prop is always true, making the button highlight state static

Comment on lines 95 to 96
after: dateRange.date_from || issue.firstSeen,
before: dateRange.date_to || undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Using issue.firstSeen as a fallback for date_from could potentially miss events if the issue was merged from other issues with earlier timestamps.

}),
listeners(({ actions, values }) => ({
setErrorsToIgnoreRules: async ({ newRules }, breakpoint) => {
if (values.currentTeamErrorsToIgnoreRules === newRules.trim()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: comparing trimmed value against untrimmed value could cause unnecessary updates

Suggested change
if (values.currentTeamErrorsToIgnoreRules === newRules.trim()) {
if (values.currentTeamErrorsToIgnoreRules.trim() === newRules.trim()) {

Comment on lines 37 to 38
first_seen = serializers.DateTimeField(source="created_at")
# assignee: ErrorTrackingIssueAssignee | null
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: first_seen is mapped to created_at, but this might not be accurate if issues can be merged. Consider if first_seen should be tracked separately.

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Size Change: +69 B (+0.01%)

Total Size: 1.18 MB

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

compressed-size-action

@daibhin daibhin requested a review from a team January 31, 2025 09:47
Copy link
Contributor

@oliverb123 oliverb123 left a comment

Choose a reason for hiding this comment

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

1 question on using the oldest fingerprint rather than the issue creation time, otherwise :shipit:

class ErrorTrackingIssueSerializer(serializers.ModelSerializer):
# Might not be entirely accurate if an issue is merged but it's a good
# approximation to use in absence of doing a ClickHouse query
first_seen = serializers.DateTimeField(source="created_at")
Copy link
Contributor

@oliverb123 oliverb123 Feb 6, 2025

Choose a reason for hiding this comment

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

We can use the lowest ErrorTrackingIssueFingerprint.created_at from the set of associated fingerprints here, and know it's exactly correct, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good point. Might follow up with that if we want to add the first_seen field to that table anyways

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@daibhin daibhin merged commit 065c47d into master Feb 11, 2025
103 checks passed
@daibhin daibhin deleted the dn-feat/split-issue-loading branch February 11, 2025 09:35
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.

4 participants