- Extract announcement logic to dedicated lib/announceRepository.ts utility
- Prepopulate dialog fields from projectId and ngitServers config
- Add real-time validation for repository ID (kebab-case format)
- Move Git operations (state event, remote config) from dialog to GitDialog
- Replace modal success screen with toast notifications for better UX
- Add collapsible advanced settings section for optional fields
- Prevent nostr:// URLs in clone URL field (HTTPS only)
- Close dialog immediately after publishing announcement
- Improve error handling with detailed validation messages
- Fix relay routing: announcements publish to global relay + announcement relays, state events only to announcement relays
- Fix prepopulation preserving user-added URLs and relays with isPrepopulated flag
- Make prepopulated clone URLs and relays editable with onChange handlers
- Add edit mode to modify existing repository announcements via editNaddr prop
- Load existing repository data from Nostr when editing
- Add 'Edit Nostr Git Repo Settings' button in GitDialog for user-owned nostr:// remotes
- Check repository ownership by parsing nostr:// URL and comparing with user pubkey
- 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
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
Restructured the PR card layout to prevent the Merge button from going off-screen:
- Changed from inline flex layout to stacked layout with separate actions row
- Moved action buttons to their own row below PR info
- Added proper spacing with pl-7 to align with content
- Changed button variants for better visibility (outline instead of ghost)
- Added "View" text to external link button for clarity
- Better wrapping for title and badges with flex-wrap
- Buttons now have consistent sizing and spacing
The actions row only shows when there are actions to display (review/merge or
external link), keeping the layout clean for merged PRs with no actions.
Implemented comprehensive PR management for repo owners across GitHub, GitLab, and Nostr:
**For Repository Owners (viewing their own repos):**
- See ALL incoming PRs/patches from contributors, not just their own
- "Review" button to checkout PR branch and preview changes live
- Merge button to merge PRs directly from UI
- Works for GitHub, GitLab, and Nostr repositories
**For Contributors (viewing others' repos):**
- See only their own PRs/patches
- "Merged" badge displayed when PR has been merged
- State tracking via NIP-34 status events (kind 1630-1633) for Nostr
**PR List Enhancements:**
- Show author (display "you" for own PRs, username for others)
- Color coding: green for open, purple for merged
- Conditional actions based on ownership and state
- Different section titles: "Incoming PRs/Patches" vs "Your PRs/Patches"
**Technical Implementation:**
- Extended usePullRequests to detect repo ownership via pubkey/username
- Query all PRs when user is owner, filter to user's PRs otherwise
- For Nostr: query status events to determine merged/closed state
- Updated MergeDialog to accept pre-filled source/target branches
- Added isOwner and authorPubkey fields to PullRequest interface
This enables full PR workflow in Shakespeare: review, preview, and merge contributions.
Removed the "Announce Repository" button since repository announcement now
happens automatically when creating patches. The button is no longer needed
in the user interface.
Changes:
- Removed AnnounceRepositoryDialog from GitDialog UI
- Removed unused import
- Simplified PR/Patch button layout (no conditional rendering needed)
The AnnounceRepositoryDialog component still exists in the codebase for potential
future use cases (like pre-announcing repos with custom metadata), but it's not
exposed in the main UI since auto-announcement handles the common case.
Extended usePullRequests hook to fetch and display Nostr patches (kind 1617):
- Parse nostr:// URLs with npub/hex pubkey support
- Query patches created by current user using #a tag filter
- Convert patch events to PullRequest format for unified display
- Extract source/target branches from patch content
Updated GitDialog to show Nostr patches:
- Display "Your Patches" section for Nostr repos (like GitHub/GitLab PRs)
- Show patch title, number (first 8 chars of event ID), and branches
- Remove external link button for Nostr (event references aren't clickable URLs)
Enhanced debugging for troubleshooting patch discovery issues:
- Log repository announcement query filter and results
- Log event coordinates and relay information
- Provide verification instructions after publishing announcements
- Warn when repository announcement not found with helpful context
This helps diagnose why patches aren't showing in NostrHub - likely due to:
1. Repository announcement not published to same relay
2. Different relays between Shakespeare and NostrHub
3. Relay propagation delays
Created AnnounceRepositoryDialog component to publish repository announcements
(kind 30617) which are required before patches can be discovered on Nostr git
clients like NostrHub.
Key features:
- Auto-detects earliest unique commit (euc) from git history
- Pre-fills repository ID from remote URL
- Allows adding multiple web URLs, clone URLs, and relays
- Publishes to designated relays with proper NIP-34 tags
- Returns naddr for easy sharing
The dialog is displayed in GitDialog for Nostr remotes, positioned next to the
Create Patch button. This completes the Nostr git workflow:
1. Announce repository (creates kind 30617 with euc tag)
2. Submit patches (creates kind 1617 with 'a' tag referencing announcement)
Without step 1, patches are published but not discoverable since clients query
repositories first, then filter patches by the repository's 'a' tag coordinate.
Section 1: Repository Info
- Git URL with save button
- Current Branch selector with New button
- Sync Status with Pull/Push buttons
- Merge Branch action
Section 2: Pull Requests
- Your Open PRs list (for non-Nostr repos)
- Create PR button
Section 3: Working Directory
- List of changed files with status badges
- Clean state message when no changes
All sections are now in a single card-based layout for better organization and clarity.
- Change URL format from `nostr://<npub>/<domain>/<repo>` to `nostr://<hex-pubkey>/<repo-id>`
- Auto-convert npub to hex pubkey in URL parsing
- Fix hanging issue caused by invalid pubkey format in repository queries
- Update parseRepoUrl in types.ts to handle npub decoding
- Update PullRequestDialog to decode npub before querying
- Update NOSTR_GIT.md with correct URL format examples
The correct format is:
- `nostr://<hex-pubkey>/<repo-id>` (preferred)
- `nostr://<npub>/<repo-id>` (auto-converted to hex)
Fixes the issue where patch publishing would hang indefinitely when trying to query repositories with npub-formatted URLs.
- Implement NostrGitProvider following GitHostProvider interface
- Support nostr:// URL format (nostr://<pubkey>/<repo-id>)
- Create patches (kind 1617) as Nostr events per NIP-34
- Unified PR dialog works for GitHub, GitLab, and Nostr git
- Auto-detect platform and adapt UI (PR vs Patch terminology)
- No forking/credentials needed for Nostr - uses logged-in signer
- Publish patches to repository's designated relays
- Update detection logic to recognize Nostr git URLs
- Show "Patches" card for Nostr repos in main Git dialog
- Remove duplicate "Create Nostr Patch" button
- Add comprehensive NOSTR_GIT.md documentation
The UI flow is now consistent across all git platforms:
1. Click "Create Pull Request" (or "Create Patch" for Nostr)
2. Fill in title and description in the same form
3. System handles platform-specific logic behind the scenes
Fixed ReferenceError caused by missing usePullRequests hook file
and missing imports in GitDialog component.
Errors fixed:
- ReferenceError: isLoadingPRs is not defined
- ReferenceError: pullRequests is not defined
Changes:
- Recreated src/hooks/usePullRequests.ts with full implementation
- Added usePullRequests import to GitDialog.tsx
- Added hook call to fetch pull requests data
- Fetches PRs from GitHub/GitLab APIs
- Filters to show only current user's PRs
The Pull Requests section now loads and displays correctly!
Restored the Pull Requests card that displays open pull requests
from GitHub/GitLab. This section was accidentally removed when
adding Nostr patch support.
Changes:
- Restored Pull Requests card with PR list display
- Shows loading state while fetching PRs
- Lists all open PRs with title, number, author, and branches
- Includes "View PR" button with ExternalLink icon
- Shows "Create Pull Request" button at bottom
- Only displays for non-Nostr remotes (GitHub/GitLab)
- Added ExternalLink icon import
Now users can see their open PRs again! 🎉
Fixed white page error caused by missing GitPullRequest icon import
in GitDialog component.
Error: ReferenceError: GitPullRequest is not defined
Solution: Added GitPullRequest to lucide-react imports
Fixed the issue where no PR/patch creation button was shown when
using a Nostr remote URL.
Changes:
- Added "Create Nostr Patch" button in Branch Operations when Nostr remote is detected
- Button opens Git Management Dialog directly to the Nostr tab
- Added defaultTab state management to control which tab opens
- GitHub/GitLab remotes show "Create Pull Request" button
- Nostr remotes show "Create Nostr Patch" button
- Both buttons are mutually exclusive based on remote URL type
User Experience:
- Clear call-to-action for Nostr repositories
- One-click access to patch creation
- No more confusion about where to create patches
The modal wasn't scrolling because ScrollArea needed explicit height constraints.
Changes:
- Set DialogContent to h-[90vh] (fixed height) instead of max-h
- Removed default padding (p-0) from DialogContent
- Added padding explicitly to header (px-6 pt-6) and scroll wrapper (px-6 pb-6)
- Wrapped ScrollArea in a container div with flex-1 min-h-0 overflow-hidden
- Set ScrollArea to h-full so it takes the full height of its container
- Added pr-4 to inner content div to account for scrollbar
The key insight: ScrollArea needs a definite height to work. Using flex-1 alone doesn't provide that - it needs a parent with min-h-0 and a child with h-full.
The modal content was overflowing outside the dialog box due to improper layout constraints.
Changes:
- Changed DialogContent to use flex layout with overflow-hidden
- Moved URL Configuration card inside ScrollArea for consistent scrolling
- Removed arbitrary max-height values and used flex-1 for proper sizing
- Added proper padding compensation (-mx-6 px-6 with pr-4) to ensure ScrollArea works correctly
- Made DialogHeader flex-shrink-0 to prevent it from being compressed
- Increased max-h from 80vh to 90vh for better space utilization
The fix ensures all content stays within the modal boundaries and scrolls properly within the designated ScrollArea component.
Enable users to quickly switch branches and create new branches directly from the main Repository dialog without opening Advanced Git Management.
NEW FEATURES:
- Branch selector dropdown showing all local branches
- Current branch indicator with checkmark
- Switch branches with single click
- "New" button to create branches quickly
- Create branch dialog with validation
- Automatic rebuild after branch switch
UI COMPONENTS:
- Current Branch card at top of Repository dialog
- Branch dropdown with all local branches
- Quick "New" button for branch creation
- Dedicated create branch dialog
- Loading states during operations
- Success/error toast notifications
WORKFLOW:
1. Open Repository dialog
2. See current branch at the top
3. Click dropdown to switch branches
4. Click "New" to create a branch
5. Automatic rebuild after switching
BENEFITS:
- Faster branch switching (no need for Advanced dialog)
- Quick branch creation for common workflows
- Better visibility of current branch
- Seamless integration with existing features
Branch management is now accessible at two levels:
- Quick operations: Repository dialog (switch, create)
- Full management: Advanced Git Management (switch, create, delete, view remotes)
Relocate merge and pull request buttons from Advanced Git Management dialog to the main Repository dialog for better accessibility and workflow.
CHANGES:
- Add "Branch Operations" card to GitDialog
- Display Merge Branch and Pull Request buttons directly in Repository dialog
- Remove duplicate buttons from GitManagementDialog branches tab
- Simplify GitManagementDialog component (removed merge/PR dialog state)
BENEFITS:
- More intuitive workflow: common operations are in the main dialog
- Cleaner separation: Repository dialog = operations, Advanced = exploration
- Faster access to merge/PR features without opening advanced dialog
The Merge and PR dialogs now open from the Repository dialog's "Branch Operations" section, making them easier to discover and use.