-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Display Commit Hash in ChatMessage UI #3191
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
Open
nourzakhama2003
wants to merge
11
commits into
dyad-sh:main
Choose a base branch
from
nourzakhama2003:feat/version-id-chat-indicator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8bdf83a
display commit hash in the message
nourzakhama2003 9b120ae
fix buttom title
nourzakhama2003 98bc1c9
fix reviewer feedback
nourzakhama2003 12e4815
fix unmount clean up
nourzakhama2003 8f3dac2
update snapshost
nourzakhama2003 91b0f9f
Restore e2e snapshot files to previous state
nourzakhama2003 2107e4b
Updated snapshots and apply changes
nourzakhama2003 5e3f6be
Moved Check/Copy icon before the text span to matcch chatmessage
nourzakhama2003 5e1851f
fix regression for request id
nourzakhama2003 2075606
Revert snapshots to main branch state
nourzakhama2003 962751b
Replace commit hash with version number in chat messagesr
nourzakhama2003 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| //Calculate the version number from a version object using reverse index. | ||
|
|
||
| export function calculateVersionNumber( | ||
| version: { oid: string }, | ||
| versions: { oid: string }[], | ||
| ): number { | ||
| return versions.length - versions.indexOf(version); | ||
|
nourzakhama2003 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import { Copy, Check } from "lucide-react"; | ||
| import { useCopyToClipboard } from "@/hooks/useCopyToClipboard"; | ||
| import { | ||
| Tooltip, | ||
| TooltipTrigger, | ||
| TooltipContent, | ||
| } from "@/components/ui/tooltip"; | ||
|
|
||
| interface CopyButtonProps { | ||
| value: string; | ||
| ariaLabel: string; | ||
| displayText: string; | ||
| tooltipText: string; | ||
| mono?: boolean; | ||
| raw?: boolean; | ||
| } | ||
|
|
||
| export function CopyButton({ | ||
| value, | ||
| ariaLabel, | ||
| displayText, | ||
| tooltipText, | ||
| mono = false, | ||
| raw = false, | ||
| }: CopyButtonProps) { | ||
| const { copyMessageContent, copyRawText, copied } = useCopyToClipboard(); | ||
|
|
||
| const handleCopy = () => { | ||
| if (!value) return; | ||
| if (raw) { | ||
| copyRawText(value); | ||
| } else { | ||
| copyMessageContent(value); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <Tooltip> | ||
| <TooltipTrigger | ||
| render={ | ||
| <button | ||
| onClick={handleCopy} | ||
| aria-label={ariaLabel} | ||
|
nourzakhama2003 marked this conversation as resolved.
|
||
| className="flex items-center space-x-1 px-1 py-0.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 rounded transition-colors duration-200 cursor-pointer" | ||
| /> | ||
| } | ||
| > | ||
| {copied ? ( | ||
| <Check className="h-3 w-3 text-green-500" /> | ||
| ) : ( | ||
| <Copy className="h-3 w-3" /> | ||
| )} | ||
|
nourzakhama2003 marked this conversation as resolved.
|
||
| <span className={`${mono ? "font-mono" : ""} text-xs`}> | ||
| {copied ? "Copied" : displayText} | ||
| </span> | ||
| </TooltipTrigger> | ||
| <TooltipContent>{copied ? "Copied!" : tooltipText}</TooltipContent> | ||
|
nourzakhama2003 marked this conversation as resolved.
|
||
| </Tooltip> | ||
| ); | ||
| } | ||
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
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.