-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Enforce name uniqueness #3679
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
TheodoreSpeaks
merged 12 commits into
improvement/copilot-6
from
fix/enforce-duplicate-name
Mar 20, 2026
Merged
Enforce name uniqueness #3679
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
135c12b
Enforce name uniqueness
0c8158c
Use established pattern for error handling
18267fc
Fix lint
f05aa93
Fix lint
7025efc
Add kb name uniqueness to db
62d5e04
Fix lint
cdae802
Handle name getting taken before restore
5ca1d5b
Merge branch 'staging' into fix/enforce-duplicate-name
e3ab7d2
Enforce duplicate file name
ff3e089
Merge branch 'staging' into fix/enforce-duplicate-name
b564d0c
Fix lint
5226a3f
Merge branch 'improvement/copilot-6' into fix/enforce-duplicate-name
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
37 changes: 37 additions & 0 deletions
37
apps/sim/components/emcn/components/toast/countdown-ring.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| const RING_RADIUS = 5.5 | ||
| const RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS | ||
|
|
||
| interface CountdownRingProps { | ||
| duration: number | ||
| paused?: boolean | ||
| className?: string | ||
| } | ||
|
|
||
| export function CountdownRing({ duration, paused = false, className }: CountdownRingProps) { | ||
| return ( | ||
| <svg | ||
| width='14' | ||
| height='14' | ||
| viewBox='0 0 16 16' | ||
| fill='none' | ||
| xmlns='http://www.w3.org/2000/svg' | ||
| className={className} | ||
| style={{ transform: 'rotate(-90deg) scaleX(-1)' }} | ||
| > | ||
| <circle cx='8' cy='8' r={RING_RADIUS} stroke='currentColor' strokeWidth='1.5' opacity={0.2} /> | ||
| <circle | ||
| cx='8' | ||
| cy='8' | ||
| r={RING_RADIUS} | ||
| stroke='currentColor' | ||
| strokeWidth='1.5' | ||
| strokeLinecap='round' | ||
| strokeDasharray={RING_CIRCUMFERENCE} | ||
| style={{ | ||
| animation: `notification-countdown ${duration}ms linear forwards`, | ||
| animationPlayState: paused ? 'paused' : 'running', | ||
| }} | ||
| /> | ||
| </svg> | ||
| ) | ||
| } | ||
|
TheodoreSpeaks marked this conversation as resolved.
|
||
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /** | ||
| * @vitest-environment node | ||
| */ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { getPostgresErrorCode } from '@/lib/core/utils/pg-error' | ||
|
|
||
| describe('getPostgresErrorCode', () => { | ||
| it('reads code from Error.code', () => { | ||
| const err = new Error('fail') as Error & { code: string } | ||
| err.code = '23505' | ||
| expect(getPostgresErrorCode(err)).toBe('23505') | ||
| }) | ||
|
|
||
| it('reads code from Error.cause', () => { | ||
| const err = new Error('fail', { cause: { code: '23505' } }) | ||
| expect(getPostgresErrorCode(err)).toBe('23505') | ||
| }) | ||
|
|
||
| it('returns undefined for non-errors', () => { | ||
| expect(getPostgresErrorCode(undefined)).toBeUndefined() | ||
| expect(getPostgresErrorCode('23505')).toBeUndefined() | ||
| }) | ||
| }) |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Shared CountdownRing depends on external CSS keyframe
Low Severity
The
CountdownRingcomponent is now exported from the sharedemcncomponent library, but it references the CSS animation namenotification-countdownwhich is only defined inapps/sim/app/_styles/globals.css. This creates a hidden coupling — any consumer ofCountdownRingoutside the app context (or if the keyframe is renamed) would get a static, non-animating ring with no indication of failure. A self-contained component would define its own keyframe or accept it as a prop.Additional Locations (1)
apps/sim/components/emcn/components/index.ts#L146-L147