8000 feat(project-tree): new page breadcrumbs by mariusandra · Pull Request #31600 · PostHog/posthog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(project-tree): new page breadcrumbs #31600

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

Merged
merged 3 commits into from
Apr 25, 2025
Merged

Conversation

mariusandra
Copy link
Collaborator

Changes

Adds breadcrumbs with the selected folder for all "new" pages.

How did you test this code?

👀

Copy link
Contributor
8000

Size Change: +334 B (0%)

Total Size: 13.6 MB

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

compressed-size-action

@mariusandra mariusandra marked this pull request as ready for review April 25, 2025 08:55
@mariusandra mariusandra requested a review from adamleithp April 25, 2025 08:56
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 implements consistent breadcrumb navigation for 'new' pages across the application by modifying the projectTreeRef selector behavior in various logic files.

  • Modified ProjectTreeRef interface in types.ts to allow null values for ref property
  • Updated projectTreeRef selectors across 10 logic files to return null instead of string conversion when handling 'new' items
  • Added new projectTreeRef selector to campaignsLogic.ts and pipelineNodeNewLogic.tsx for breadcrumb support
  • Standardized breadcrumb handling for 'new' pages to improve folder organization in project tree navigation
  • Maintained consistent URL handling and state management patterns across all modified files

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

Comment on lines +1486 to +1488
(experimentId): ProjectTreeRef => {
return { type: 'experiment', ref: experimentId === 'new' ? null : String(experimentId) }
},
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider adding a type guard to ensure experimentId is either 'new' or a valid experiment ID

Comment on lines +77 to +83
projectTreeRef: [
(s) => [s.loading],
(): ProjectTreeRef => ({
type: 'hog_function/',
ref: 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: The projectTreeRef selector returns a hardcoded type 'hog_function/' with null ref, but doesn't use the loading state it depends on. Either remove the unused loading dependency or implement proper loading state handling.

Suggested change
projectTreeRef: [
(s) => [s.loading],
(): ProjectTreeRef => ({
type: 'hog_function/',
ref: null,
}),
],
projectTreeRef: [
() => [],
(): ProjectTreeRef => ({
type: 'hog_function/',
ref: null,
}),
],

Comment on lines +80 to +81
type: 'hog_function/',
ref: null,
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The hardcoded 'hog_function/' type may not be appropriate for all pipeline nodes. Consider deriving the type from the stage or kind props.

projectTreeRef: [
(s) => [s.campaignId],
(id): ProjectTreeRef => ({
type: 'hog_function/campaign',
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The hardcoded type string 'hog_function/campaign' should be defined as a constant to avoid typos and ensure consistency across the codebase

Comment on lines +54 to +58
(s) => [s.campaignId],
(id): ProjectTreeRef => ({
type: 'hog_function/campaign',
ref: id === 'new' ? null : id,
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The projectTreeRef selector reuses the campaignId selector but renames the parameter to 'id' - consider keeping the parameter name consistent as 'campaignId' for clarity

@mariusandra mariusandra merged commit 3227959 into master Apr 25, 2025
96 checks passed
@mariusandra mariusandra deleted the save-as-improvements branch April 25, 2025 09:52
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
0