-
Notifications
You must be signed in to change notification settings - Fork 1.7k
improvement(frontend): enhance secret diff view and commit handling #5364
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
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
45a8083
feat(frontend): add diff components for secret version comparison
490d8c7
feat(frontend): enhance secret diff components and commit handling
6df67f3
fix(frontend): update key generation in InlineTextDiff for unique ide…
e5b6a7d
fix(frontend): ensure default color for secret tags in SecretApproval…
40a98a3
fix(frontend): streamline secret metadata handling in SecretVersionDi…
2a48ee1
fix(frontend): refine secret value assignment in CommitForm component
7f3553e
fix(frontend): refactor key rendering in SecretDiffView for improved …
485a08e
Merge branch 'main' into enhancement/update-commit-diff-view
cbada82
feat: enhance diff rendering for secrets and folders
bf73902
refactor: simplify diff container and enhance secret value rendering
b464f28
fix: handle null values for skipMultilineEncoding in SecretApprovalRe…
5437c76
feat: enhance secret value handling in SecretDetailSidebar and Secret…
b987ea3
refactor: improve scrolling behavior and metadata handling in SecretD…
95be906
feat: enhance secret value handling and loading states in SecretDiffV…
b19a5dd
feat: enhance secret handling in SecretDashboardPage for updates and …
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { twMerge } from "tailwind-merge"; | ||
|
|
||
| export interface DiffContainerProps { | ||
| variant?: "added" | "removed"; | ||
| children: React.ReactNode; | ||
| containerRef?: React.RefObject<HTMLDivElement>; | ||
| className?: string; | ||
| isSingleLine?: boolean; | ||
| } | ||
|
|
||
| /** | ||
| * Styled container with consistent backgrounds for diff views | ||
| */ | ||
| export const DiffContainer = ({ | ||
| variant, | ||
| children, | ||
| containerRef, | ||
| className, | ||
| isSingleLine = false | ||
| }: DiffContainerProps) => { | ||
| const getBackgroundColor = () => { | ||
| if (!variant) return undefined; | ||
| return variant === "removed" ? "#120808" : "#081208"; | ||
| }; | ||
|
|
||
| const backgroundColor = getBackgroundColor(); | ||
|
|
||
| if (isSingleLine) { | ||
| return ( | ||
| <div | ||
| className={twMerge( | ||
| "relative rounded-lg border border-mineshaft-600 p-2", | ||
| !variant && "bg-bunker-800", | ||
| className | ||
| )} | ||
| style={backgroundColor ? { backgroundColor } : undefined} | ||
| > | ||
| {children} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <div | ||
| ref={containerRef} | ||
| className={twMerge( | ||
| "relative max-h-96 thin-scrollbar overflow-x-auto overflow-y-auto rounded-lg border border-mineshaft-600 p-2", | ||
| !variant && "bg-bunker-800", | ||
| className | ||
| )} | ||
| style={backgroundColor ? { backgroundColor } : undefined} | ||
| > | ||
| <div className="w-max min-w-full">{children}</div> | ||
| </div> | ||
| ); | ||
| }; |
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.
Uh oh!
There was an error while loading. Please reload this page.