-
Notifications
You must be signed in to change notification settings - Fork 3.5k
v0.6.30: slack trigger enhancements, secrets performance, polling refactors, drag resources in mothership #4038
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 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d0d3581
feat(posthog): Add tracking on mothership abort (#4023)
TheodoreSpeaks 0f602f7
fix(login): fix captcha headers for manual login (#4025)
TheodoreSpeaks e0f5cf8
feat(slack): add subtype field and signature verification to Slack tr…
waleedlatif1 98be968
improvement(secrets): parallelize save mutations and add admin visibi…
waleedlatif1 6c3caf6
feat(chat): drag workflows and folders from sidebar into chat input (…
waleedlatif1 2504bfb
feat(athena): add AWS Athena integration (#4034)
waleedlatif1 712e58a
fix(admin): delete workspaces on ban (#4029)
TheodoreSpeaks 6f9f336
feat(ui): Add copy button for code blocks in mothership (#4033)
TheodoreSpeaks 2760b4b
Revert "fix(sockets): joining currently deleted workflow (#4004)" (#4…
icecrasher321 086b7d9
refactor(polling): consolidate polling services into provider handler…
waleedlatif1 a591d7c
fix(manual): mock payloads nested recursion (#4037)
icecrasher321 7b81a76
fix(kb): show 'pending' instead of past date for overdue next sync (#…
waleedlatif1 9282d1b
feat(secrets): allow admins to view and edit workspace secret values …
waleedlatif1 d0d35dd
fix: address PR review comments (#4042)
waleedlatif1 3c7bfa7
improvement(kb): deferred content fetching and metadata-based hashes …
waleedlatif1 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
feat(ui): Add copy button for code blocks in mothership (#4033)
* Add copy button for code blocks in mothership * Move to shared copy code button * Handle react node case for copy * fix(copy-button): address PR review feedback - Await clipboard write and clear timeout on unmount in CopyCodeButton - Fix hover bg color matching container bg (surface-4 -> surface-5) - Extract extractTextContent to shared util at lib/core/utils/react-node-text.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix lint --------- Co-authored-by: Theodore Li <theo@sim.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Loading branch information
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,42 @@ | ||
| 'use client' | ||
|
|
||
| import { useCallback, useEffect, useRef, useState } from 'react' | ||
| import { Check, Copy } from '@/components/emcn' | ||
| import { cn } from '@/lib/core/utils/cn' | ||
|
|
||
| interface CopyCodeButtonProps { | ||
| code: string | ||
| className?: string | ||
| } | ||
|
|
||
| export function CopyCodeButton({ code, className }: CopyCodeButtonProps) { | ||
| const [copied, setCopied] = useState(false) | ||
| const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null) | ||
|
|
||
| const handleCopy = useCallback(async () => { | ||
| await navigator.clipboard.writeText(code) | ||
| setCopied(true) | ||
| if (timerRef.current) clearTimeout(timerRef.current) | ||
| timerRef.current = setTimeout(() => setCopied(false), 2000) | ||
| }, [code]) | ||
|
|
||
| useEffect( | ||
| () => () => { | ||
| if (timerRef.current) clearTimeout(timerRef.current) | ||
| }, | ||
| [] | ||
| ) | ||
|
|
||
| return ( | ||
| <button | ||
| type='button' | ||
| onClick={handleCopy} | ||
| className={cn( | ||
| 'flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors', | ||
| className | ||
| )} | ||
| > | ||
| {copied ? <Check className='size-3.5' /> : <Copy className='size-3.5' />} | ||
| </button> | ||
| ) | ||
| } | ||
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,14 @@ | ||
| import { isValidElement, type ReactNode } from 'react' | ||
|
|
||
| /** | ||
| * Recursively extracts plain text content from a React node tree. | ||
| */ | ||
| export function extractTextContent(node: ReactNode): string { | ||
| if (typeof node === 'string') return node | ||
| if (typeof node === 'number') return String(node) | ||
| if (!node) return '' | ||
| if (Array.isArray(node)) return node.map(extractTextContent).join('') | ||
| if (isValidElement(node)) | ||
| return extractTextContent((node.props as { children?: ReactNode }).children) | ||
| return '' | ||
| } |
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.