You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apps/code/src/shared/types/analytics.ts, line 3-6 (link)
Shared file imports from a feature module
Every other analytics property interface in this file is defined inline (e.g. TaskCreateProperties, PromptSentProperties). Importing from @features/message-editor/analytics is the only case where @shared/types/analytics.ts reaches into a feature module, inverting the typical dependency direction. This violates the OnceAndOnlyOnce principle for where analytics types live and makes the shared file harder to understand at a glance. Consider moving PromptHistoryOpenedProperties and PromptHistorySelectedProperties directly into this file and deleting apps/code/src/renderer/features/message-editor/analytics.ts.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/shared/types/analytics.ts
Line: 3-6
Comment:
**Shared file imports from a feature module**
Every other analytics property interface in this file is defined inline (e.g. `TaskCreateProperties`, `PromptSentProperties`). Importing from `@features/message-editor/analytics` is the only case where `@shared/types/analytics.ts` reaches into a feature module, inverting the typical dependency direction. This violates the OnceAndOnlyOnce principle for where analytics types live and makes the shared file harder to understand at a glance. Consider moving `PromptHistoryOpenedProperties` and `PromptHistorySelectedProperties` directly into this file and deleting `apps/code/src/renderer/features/message-editor/analytics.ts`.
How can I resolve this? If you propose a fix, please make it concise.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
apps/code/src/renderer/features/message-editor/components/PromptHistoryDialog.tsx, line 112-116 (link)
Redundant reversed dependency in filtered memo
fuse is already recomputed whenever reversed changes (it's fuse's only dep), so adding reversed to filtered's dependency array is superfluous. When any dep changes React re-runs the callback and closes over the latest reversed in scope, so the no-query branch (if (!q) return reversed) is always safe with just [fuse, query]. The current code is not broken, but the extra dep creates a slightly misleading hint that reversed and fuse could diverge.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/components/PromptHistoryDialog.tsx
Line: 112-116
Comment:
**Redundant `reversed` dependency in `filtered` memo**`fuse` is already recomputed whenever `reversed` changes (it's `fuse`'s only dep), so adding `reversed` to `filtered`'s dependency array is superfluous. When any dep changes React re-runs the callback and closes over the latest `reversed` in scope, so the no-query branch (`if (!q) return reversed`) is always safe with just `[fuse, query]`. The current code is not broken, but the extra dep creates a slightly misleading hint that `reversed` and `fuse` could diverge.
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---### Issue 1 of 2
apps/code/src/shared/types/analytics.ts:3-6
**Shared file imports from a feature module**
Every other analytics property interface in this file is defined inline (e.g. `TaskCreateProperties`, `PromptSentProperties`). Importing from `@features/message-editor/analytics` is the only case where `@shared/types/analytics.ts` reaches into a feature module, inverting the typical dependency direction. This violates the OnceAndOnlyOnce principle for where analytics types live and makes the shared file harder to understand at a glance. Consider moving `PromptHistoryOpenedProperties` and `PromptHistorySelectedProperties` directly into this file and deleting `apps/code/src/renderer/features/message-editor/analytics.ts`.
### Issue 2 of 2
apps/code/src/renderer/features/message-editor/components/PromptHistoryDialog.tsx:112-116
**Redundant `reversed` dependency in `filtered` memo**`fuse` is already recomputed whenever `reversed` changes (it's `fuse`'s only dep), so adding `reversed` to `filtered`'s dependency array is superfluous. When any dep changes React re-runs the callback and closes over the latest `reversed` in scope, so the no-query branch (`if (!q) return reversed`) is always safe with just `[fuse, query]`. The current code is not broken, but the extra dep creates a slightly misleading hint that `reversed` and `fuse` could diverge.
```suggestion }, [fuse, query]);```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a new prompt history viewer
Created with PostHog Code