- Made handleCopyShakespeareURL async
- Added try-catch for modern clipboard API
- Implemented fallback using document.execCommand for older browsers or insecure contexts
- Fallback creates hidden textarea, selects text, and uses execCommand('copy')
- Improved error handling with better user feedback
- Ensures copy functionality works across different browser environments
- Added Copy icon import from lucide-react
- Created handleCopyShakespeareURL function that:
- Validates that a repository URL exists
- Encodes the URL and formats it as a Shakespeare clone URL
- Copies the formatted URL to clipboard
- Shows success/error toast notifications
- Added button below Git URL input that appears when URL is present
- Button copies the properly formatted Shakespeare clone URL (https://shakespeare.diy/clone?url=...)
- Works with GitHub, GitLab, NostrGit, and any other git repository URL
- Remove unused imports (Badge, PullRequestCheck)
- Fix React Hook dependency warnings by using useCallback
- Replace 'any' types with proper TypeScript interfaces
- Fix unused variable errors by prefixing with underscore
- Remove placeholder comments
- Consolidate duplicate type definitions at module level
- Add proper type definitions for API responses
- Fix const vs let issues
Use double type assertion (as unknown as) to properly convert the discriminated
union type from nip19.decode(). This resolves all TypeScript type compatibility
issues across different versions.
Add explicit type assertion to nip19.decode() result to avoid TypeScript
version differences in discriminated union handling. This ensures consistent
type checking across different TypeScript versions used in CI/CD vs local.
Use positive type guard (decoded.type === 'npub' && typeof decoded.data === 'string')
to properly narrow the union type. TypeScript requires both conditions to infer the
correct type for decoded.data when dealing with discriminated unions.
Use negative type guard (decoded.type !== 'npub') to properly narrow the
union type, allowing TypeScript to infer decoded.data as string when
type is 'npub'. This fixes the type overlap error.
- Fix duplicate useState import in GitManagementDialog
- Add missing hostTokens property to GitSettings in all test files
- Fix type narrowing issues in PullRequestDialog with proper type assertions
- Fix fetch headers to use Record<string, string> type
- Fix credentials type to GitCredential | undefined instead of null
- Fix auth callback to handle undefined credentials
- Fix patchLines array type annotation
- Fix git statusMatrix workdir type assertions
- All TypeScript compilation errors resolved
Removed the "Review" button for Nostr patches since they can't be checked out
as branches. The Nostr git workflow is different:
- Patches are standalone events, not git branches
- Contributors don't push branches to a shared remote
- Repository owners review patches via the Merge dialog which shows the patch
content and commits
For GitHub/GitLab:
- Review button still works (checks out the actual branch)
- Branch exists on remote and can be pulled/checked out
For Nostr:
- Only Merge button shown for repo owners
- Merge dialog displays the patch content for review
- This aligns with NIP-34 workflow where patches are self-contained