Commit Graph

197 Commits

Author SHA1 Message Date
Alejandro
de063c8bfe Merge pull request #11 from purrgrammer/claude/add-since-until-spells-xluIg
fix: include since/until in spell filter JSON display
2025-12-22 12:37:24 +01:00
Alejandro
81566ab136 Merge pull request #10 from purrgrammer/claude/fix-placeholder-styling-7Yo4G
fix: remove custom font size from placeholders and hide embeds in previews
2025-12-22 12:36:54 +01:00
Claude
412ebccc4f fix: include since/until in spell filter JSON display
The filter JSON in SpellDetailRenderer was missing since/until
fields when they were in relative format (e.g., "7d", "now").
This happened because decodeSpell only adds these fields to
the filter object when they're unix timestamps.

Now we extract the raw since/until values from event tags and
include them in a displayFilter object for the JSON viewer,
ensuring users see the complete filter regardless of format.

The command preview already worked correctly since it uses
the reconstructed command string which includes these values.
2025-12-22 10:01:42 +00:00
Claude
470c802364 fix: ensure compact previews properly truncate RichText to single line
- Add line-clamp-1 to all compact preview components for consistent truncation
- Fix DefaultCompactPreview, GenericRepostCompactPreview, ZapCompactPreview
- Fix Kind1111Renderer parent event preview truncation
- Apply auto-formatting fixes from linter
2025-12-22 09:38:27 +00:00
Claude
41b012ae3e fix: remove custom font size from placeholders and hide embeds in previews
- Remove text-sm from MediaPlaceholder and EventPlaceholder to inherit parent font size
- Add options to hide media and event embeds in HighlightRenderer preview
- Ensures placeholders like [image], [note] match surrounding text size
2025-12-22 09:33:09 +00:00
Alejandro Gómez
125052f4c9 fix: spellbook preview or direct behavior 2025-12-21 22:47:24 +01:00
Alejandro Gómez
7f92277986 config: add vercel url rewrite 2025-12-21 22:39:07 +01:00
Alejandro Gómez
3c62a0e236 ui: share spellbook dialog improvements 2025-12-21 22:18:37 +01:00
Alejandro Gómez
fc63b3c685 fix: event publication 2025-12-21 21:50:09 +01:00
Alejandro Gómez
64212121bd ui: compact view tweaks 2025-12-21 21:19:31 +01:00
Alejandro Gómez
6481f1e04f feat: add voice message support (NIP-A0) and legacy video kinds
- Add VoiceMessageRenderer for kinds 1222 (voice message) and 1244 (voice reply)
- Add compact preview components with mic icon for voice messages
- Support legacy NIP-71 video kinds 34235/34236 via existing video renderers
- Add fallback URL tag parsing for video events
- Replace music note icon with mic icon for audio embeds
- Remove border/padding from audio player for cleaner display
- Add kind metadata (names, icons) for voice and legacy video kinds

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:36:53 +01:00
Alejandro Gómez
3346a2077d feat(req): add --view flag for list/compact display mode
- Add -v, --view <list|compact> flag to req command
- Remove UI toggle controls from ReqViewer header
- View mode is now set via command flag instead of runtime toggle
- Update man page with new flag documentation and example

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:29:32 +01:00
Alejandro Gómez
78a8c8e5b2 chore: apply prettier formatting fixes
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:12:40 +01:00
Alejandro Gómez
f4d0e86f09 feat: complete spellbook UX overhaul with enhanced state tracking
- Redesign SpellbookDropdown with clear status indicators (ownership, storage)
- Add SpellbookStatus component showing you/other and local/published/network
- Enhance activeSpellbook type with source, localId, isPublished fields
- Fix PublishSpellbook action to properly yield events (caller handles side-effects)
- Add k tags extraction from REQ windows for kind-based filtering/discovery
- Update terminology from "Layout" to "Spellbook" consistently
- Add comprehensive tests for k tags and source tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 19:19:24 +01:00
Alejandro Gómez
be01c7d882 refactor: repo link 2025-12-21 18:19:36 +01:00
Alejandro Gómez
fffb80cd5c ui: remove icon 2025-12-21 18:13:46 +01:00
Alejandro Gómez
21335a5849 WIP 2025-12-21 18:08:10 +01:00
Alejandro Gómez
6ebc501309 fix: restore async generator pattern for PublishSpellbook
Problem:
- Function signature was accidentally changed to curried pattern
- Tests were failing because they expected async generator pattern

Solution:
- Restore async function* signature that takes hub and options
- Matches test expectations and existing usage patterns
- Linter also fixed property destructuring in spellbook-storage

Tests:
-  All publish-spellbook tests passing (14/14)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:08:10 +01:00
Alejandro Gómez
f1ba39a65e fix: prevent spellbook duplication when saving
Problem:
- Saving active spellbooks was creating duplicates each time
- No deduplication logic for spellbooks with same slug + pubkey

Solution:
- Add findExistingSpellbook() to match by slug and pubkey
- Update saveSpellbook() to detect and update existing spellbooks:
  * For local-only: match by slug (no pubkey)
  * For published: match by slug AND pubkey
  * For updates: use provided ID
- SaveSpellbookDialog now passes existing ID in update mode

Testing:
- Added comprehensive spellbook-storage.test.ts
- Tests verify deduplication logic (requires jsdom environment)
- Existing tests still pass (14/14 for publish-spellbook)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:08:10 +01:00
Alejandro Gómez
0f7f154b80 feat: complete Phase 2 network features for spellbooks
Sharing Enhancements:
- Install qrcode library for QR code generation
- Create ShareSpellbookDialog with tabbed interface
- Support multiple share formats: Web URL, naddr, nevent
- QR code generation and download for each format
- Quick copy buttons with visual feedback
- Integrated into SpellbookDetailRenderer

Network Discovery:
- Add "Discover" filter to browse spellbooks from other users
- Query AGGREGATOR_RELAYS for network spellbook discovery
- Show author names using UserName component
- Conditional UI: hide owner actions for discovered spellbooks
- Support viewing and applying layouts from the community

Preview Route Polish:
- Loading states with spinner during NIP-05 resolution
- 10-second timeout for NIP-05 resolution
- Error banners for resolution failures
- Author name and creation date in preview banner
- Copy link button in preview mode

Conflict Resolution:
- compareSpellbookVersions() function in spellbook-manager
- ConflictResolutionDialog component for version conflicts
- Side-by-side comparison of local vs network versions
- Show workspace/window counts and timestamps

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:08:10 +01:00
Alejandro Gómez
6d89a9d342 fix: description 2025-12-21 18:08:10 +01:00
Alejandro Gómez
f272f935a3 feat: text inline when embeds are off 2025-12-21 18:08:10 +01:00
Alejandro Gómez
005605b385 feat: enhance preview route and add conflict resolution for spellbooks
Improve the preview route UX with better loading states, error handling, and metadata display. Add version comparison logic and conflict resolution dialog for handling local vs network spellbook conflicts.

Changes:
- Enhanced preview route in Home.tsx:
  - Add loading state with spinner while resolving actor
  - Add NIP-05 resolution timeout (10 seconds)
  - Display error banner for resolution failures
  - Show author name and creation date in preview banner
  - Add copy link button to share spellbook easily
  - Improve banner layout with metadata

- Add compareSpellbookVersions() in spellbook-manager.ts:
  - Detects conflicts between local and network versions
  - Compares timestamps, workspace counts, window counts
  - Identifies newer version and content differences
  - Returns structured comparison data

- Create ConflictResolutionDialog component:
  - Side-by-side comparison of local vs network versions
  - Shows metadata: timestamps, counts, author, publish status
  - Clear explanation of resolution choices
  - Accessible UI with proper button hierarchy

TypeScript compilation successful 

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:08:10 +01:00
Alejandro Gómez
784add4f52 refactor: migrate spellbook publishing to applesauce action patterns
Refactor PublishSpellbookAction from class-based to async generator pattern
following official applesauce-actions patterns. This provides better integration
with ActionHub and enables proper reactive event publishing.

Changes:
- Add publishEvent function to ActionHub with relay selection fallback strategy
  (outbox relays → seen relays → error)
- Convert PublishSpellbookAction to PublishSpellbook async generator
- Update SaveSpellbookDialog and SpellbooksViewer to use hub.run()
- Add comprehensive test suite (14 tests covering validation, event creation,
  slug generation, factory integration, and workspace selection)
- Improve error handling with specific error messages
- Add JSDoc documentation with usage examples

All tests passing  (14/14)
TypeScript compilation successful 

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:08:10 +01:00
Alejandro Gómez
e47fde9158 feat: better layout rendering 2025-12-21 18:08:10 +01:00
Alejandro Gómez
f255cded75 feat: refine spellbook preview and session management logic
- Implement smart banner visibility (only from client-side transitions)
- Add 'Apply to Dashboard' and 'Add to Library' to SpellbookDropdown
- Support updating layouts via standardized dialog
- Fix build errors and type mismatches
2025-12-21 18:08:10 +01:00
Alejandro Gómez
588980a827 feat: enhance spell/spellbook renderers with clickable titles and inferred kinds
- Use ClickableEventTitle for spell and spellbook titles in all views
- Infer event kinds from spellbook windows and display KindBadges in feed/detail views
- Ensure consistent styling and navigation across spell/spellbook components
2025-12-21 18:08:10 +01:00
Alejandro Gómez
9b7c17b733 fix: resolve infinite update loop by stabilizing useGrimoire hook
- Introduce activeGrimoireStateAtom to handle switching between persistent and temporary state
- Ensure setState and all logic callbacks are stable across re-renders
- Correctly type Jotai updaters to avoid implicit any errors
2025-12-21 18:08:10 +01:00
Alejandro Gómez
cef6da87f4 feat: implement dual-state system for temporary layout sessions
- Add temporaryStateAtom to track in-memory sessions
- Update useGrimoire to handle conditional state management
- Previews and Direct links now use temporary state, preserving dashboard
- Add Apply and Discard logic to persist or revert temporary sessions
2025-12-21 18:08:10 +01:00
Alejandro Gómez
3fcfd42b9a feat: simplify SpellbookDropdown to only manage layouts 2025-12-21 18:08:10 +01:00
Alejandro Gómez
33d53efba8 style: consolidate layout tracking UI into SpellbookDropdown 2025-12-21 18:08:10 +01:00
Alejandro Gómez
d59a7aee8b feat: improve spellbook UX with active tracking and update capability
- Add activeSpellbook to GrimoireState
- Display active spellbook title in header with clear button
- Add 'Update Layout' and 'Save as new' to SpellbookDropdown
- Highlight active spellbook in dropdown list
- Add 'Manage Spells' link to dropdown
- Refine dropdown styles (muted hover, no accent color)
2025-12-21 18:08:10 +01:00
Alejandro Gómez
67a0caf714 style: remove loading spinner from SpellbookDropdown 2025-12-21 18:08:10 +01:00
Alejandro Gómez
7e6175755e style: refine SpellbookDropdown UI and deduplicate spells 2025-12-21 18:08:10 +01:00
Alejandro Gómez
60c67764f7 feat: show spells in SpellbookDropdown and remove icon animation 2025-12-21 18:08:10 +01:00
Alejandro Gómez
cbba5bed00 feat: separate preview/direct views and add spellbook dropdown
- Separate preview mode to /preview/:actor/:identifier
- Direct links (/:actor/:identifier) now load layout immediately
- Add SpellbookDropdown to header center for quick layout switching
- Restore accidentally deleted wallet-related files
- Remove obsolete SpellbookLoader.tsx
2025-12-21 18:08:10 +01:00
Alejandro Gómez
7d72aec83e feat: improve spellbook UX with BookHeart icon and Preview mode
- Update spellbook icon to BookHeart across the app
- Implement Preview mode with routing /:actor/:identifier
- Add Preview banner in Home component with Apply/Discard actions
- Add Preview and Share buttons to Spellbook renderers
- Clean up unused imports
2025-12-21 18:08:10 +01:00
Alejandro Gómez
e0fdfdf09d fix: resolve 'Save & Publish' failures for spells and spellbooks
- Ensure SaveSpellbookDialog passes content to PublishSpellbookAction
- Refactor SpellDialog to use PublishSpellAction instead of manual logic
- Ensure published events are added to local EventStore for immediate UI update
- Clean up unused imports and variables in SpellDialog
2025-12-21 18:08:10 +01:00
Alejandro Gómez
6a2c1a60fb feat: add nice preview renderers for spellbooks (kind 30777)
- Create SpellbookRenderer for feed view
- Create SpellbookDetailRenderer with Apply Layout action
- Register kind 30777 renderers in index
2025-12-21 18:08:09 +01:00
Alejandro Gómez
1836deee6c feat: add wallet status indicator and replace layout on apply
- Add WalletStatus component to TabBar
- Change loadSpellbook to replace current workspaces instead of merging
- Update SpellbooksViewer toast message
2025-12-21 18:07:55 +01:00
Alejandro Gómez
5d9ff3cf56 feat: implement Nostr Wallet Connect (NWC)
- Add applesauce-wallet-connect dependency
- Create WalletService for managing NWC connection
- Create WalletViewer component for UI
- Register 'wallet' command
- Fix build errors in spell/spellbook components due to applesauce-actions upgrade
2025-12-21 18:07:55 +01:00
Alejandro Gómez
5d432300b2 ui: use label for branch 2025-12-21 15:42:43 +01:00
Alejandro
a0932c856e Merge pull request #9 from purrgrammer/claude/repo-state-visualization-wDWJE
Implement repository state kind visualization
2025-12-21 15:39:55 +01:00
Claude
a34fa2becd fix: apply linter formatting and fix useMemo dependencies 2025-12-21 14:28:12 +00:00
Claude
2792cab04d feat: link repository names in repository state renderers
- Repository name in both feed and detail views now links to the repository (kind 30617)
- Uses same link styling as issues: cursor-crosshair, underline decoration-dotted
- Fetches repository event to display proper name instead of identifier
- Only "pushed <commit>" part opens the state event itself
- Repository link opens in new window using addWindow("open")
2025-12-21 12:50:08 +00:00
Claude
1519e30e5c feat: add repository state (kind 30618) visualization
Implement renderers for NIP-34 repository state announcements:
- Add helper functions in nip34-helpers.ts to parse HEAD refs, branches, and tags
- Create RepositoryStateRenderer for compact feed view showing push notifications
- Create RepositoryStateDetailRenderer for detailed view with all refs
- Register both renderers in the kind registry

Feed view shows: "pushed <commit> to <branch> in <repo>"
Detail view shows: HEAD info, all branches, all tags with copyable commit hashes
2025-12-21 12:35:23 +00:00
Alejandro
eb74306127 Merge pull request #5 from purrgrammer/claude/setup-github-actions-qa-n7cC3
Set up GitHub Actions for quality assurance
2025-12-21 12:28:04 +01:00
Claude
ec76155037 fix: add missing mocks in publish-spell test
- Add pubkey to mocked accountManager.active
- Mock relayListCache.getOutboxRelays to prevent undefined error
2025-12-21 11:24:58 +00:00
Claude
e178aff9cd ci: add GitHub Actions QA workflow
Set up automated quality assurance checks:
- Lint: runs ESLint
- Build: runs TypeScript + Vite build
- Test: runs Vitest in CI mode

All jobs run in parallel on push/PR to main/master.
2025-12-21 11:19:09 +00:00
Alejandro Gómez
bf3d451068 ui: change copy and icon 2025-12-20 16:54:47 +01:00