Commit graph

549 commits

Author SHA1 Message Date
f85cbaa65e Refactors type hints for clarity
Some checks failed
CI / lint (push) Has been cancelled
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled
Updates type hints in `crud.py`, `helpers.py`, and `models.py` for improved readability and maintainability.

Replaces `Merchant | None` with `Optional[Merchant]` and `list[X]` with `List[X]` for consistency with standard Python typing practices.
2025-12-31 12:07:51 +01:00
e0fdada15c Improves Nostr message handling and error logging
Enhances the processing of Nostr messages by adding more robust error handling and logging, providing better insights into potential issues.

Specifically:
- Improves the checks on the websocket connection to log errors and debug information.
- Implements more comprehensive error logging for failed product quantity checks.
- Enhances logging and validation of EVENT messages to prevent potential errors.
- Implements a more robust merchant lookup logic to avoid double processing of events.
- Implements a more lenient time window for direct message subscriptions.
2025-12-31 12:06:07 +01:00
1fd01f8c06 Adds order discovery analysis document
Adds a document analyzing the order discovery mechanism in Nostrmarket.

The document identifies the reasons merchants need to manually refresh to see new orders, instead of receiving them automatically. It analyzes timing window issues, connection stability, subscription state management, and event processing delays. It proposes solutions such as enhanced persistent subscriptions, periodic auto-refresh, WebSocket health monitoring, and event gap detection.
2025-12-31 12:06:07 +01:00
61c2db8e80 Enhances websocket connection robustness
Improves websocket connection reliability by predefining the websocket URL and handling potential queueing errors.

This change also updates the websocket close message for clarity.
2025-12-31 12:06:07 +01:00
0fec454006 TEMP: set merchant active to True by default 2025-12-31 12:06:07 +01:00
7245123e49 Improve merchant creation with automatic keypair generation
Enhance the merchant creation process by automatically generating Nostr keypairs
for users who don't have them, and streamline the API interface.

Changes:
- Add CreateMerchantRequest model to simplify merchant creation API
- Auto-generate Nostr keypairs for users without existing keys
- Update merchant creation endpoint to use user account keypairs
- Improve error handling and validation in merchant creation flow
- Clean up frontend JavaScript for merchant creation

This ensures all merchants have proper Nostr keypairs for marketplace
functionality without requiring manual key management from users.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-31 12:04:22 +01:00
7c7d6c7953 interactive rebase commit, clean logs 2025-12-31 11:55:28 +01:00
631675d2a0 add DEBUG logs 2025-12-31 11:55:28 +01:00
arcbtc
7771201c32 moved to orders tab 2025-12-30 11:46:45 +00:00
Arc
20dc241c89
Merge pull request #158 from BenGWeeks/feature/merchant-keys-panel-146
feat: improve merchant profile panel UI (#146)
2025-12-30 11:42:31 +00:00
arcbtc
1777b5df6d Merge branch 'main' into feature/merchant-keys-panel-146 2025-12-30 11:40:14 +00:00
Arc
1a6d1aed10
Merge pull request #169 from lnbits/messg#ages_m2
tweak: message card always open
2025-12-27 22:33:03 +00:00
Arc
d5c9e39b7b message card always open 2025-12-27 22:31:48 +00:00
Arc
2bde92bef6
Merge pull request #161 from lnbits/ui_fixup
fixup: ui
2025-12-27 21:56:57 +00:00
Ben Weeks
7aec14854c feat: multi-profile support and UI improvements
- Remove backend restriction on one merchant per user
- Add "Generate New Key" dialog with npub/nsec display
- Add "Import Existing Key" option with duplicate check
- Change "Save" to "Save & Publish" in edit profile dialog
- Remove standalone Publish button (now part of Save)
- Add trash icon to saved profile for removal
- Show display_name in saved profiles dropdown
- Hide nsec by default with eye toggle in generate dialog

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 14:05:18 +00:00
Ben Weeks
f466559b51 feat: add Switch dropdown options for profile management
- Add "Import Existing Key" option with vpn_key icon
- Add "Generate New Key" option to create fresh nsec
- Add "Remove <name>" option to delete merchant from DB
- Wire up generate-key event to existing generateKeys function

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 13:18:51 +00:00
Ben Weeks
ce0cc3813e chore: hide Following/Followers counts until implemented
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:55:36 +00:00
Ben Weeks
0d945d5bfd fix: improve profile avatar alignment and styling
- Add left margin to inset avatar from banner edge
- Use dark background color for avatar
- Add object-fit: cover to prevent image stretching
- Add profile-avatar CSS class with border and shadow

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:48:55 +00:00
Ben Weeks
a21b5289c1 feat: add merchant profile edit, keys dialog, and publish to Nostr
- Add PATCH endpoint for updating merchant profile config
- Add website field to MerchantProfile model
- Fix to_nostr_event to include all profile fields (display_name, banner, website, nip05, lud16)
- Always publish merchant profile (kind 0) when publishing to Nostr
- Extract edit-profile-dialog and nostr-keys-dialog into separate components
- Fix profile avatar alignment to match original design
- Simplify keys dialog to show only npub QR code (no nsec QR)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:42:03 +00:00
Ben Weeks
c3dea9f01d feat: add merchant profile panel to Merchant tab
Display merchant profile information with:
- Banner image or grey placeholder
- Profile avatar with shadow
- Display name (or name fallback)
- About description
- NIP-05 verified identity indicator
- Lightning address (LUD16)

Extends MerchantProfile model with new fields:
display_name, banner, nip05, lud16

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 11:10:39 +00:00
Arc
cd0bca1c85 tweak 2025-12-24 05:59:51 +00:00
Arc
19dbe64e7f make 2025-12-24 05:33:27 +00:00
Arc
a2931d675a fixup: ui 2025-12-24 05:32:27 +00:00
Arc
053dcd1785
Merge pull request #148 from BenGWeeks/fix/orders-by-customer-pubkey
fix: add missing AND in dynamic SQL query for orders
2025-12-24 04:03:23 +00:00
Arc
e2150edc10
Merge branch 'main' into fix/orders-by-customer-pubkey 2025-12-24 03:59:39 +00:00
Arc
5e22796198
Merge pull request #133 from BenGWeeks/feature/nostrclient-status-indicator
feat: add nostrclient status indicator and connection button
2025-12-24 03:58:48 +00:00
Arc
05a23fae0b Merge remote-tracking branch 'origin/main' into feature/nostrclient-status-indicator 2025-12-24 03:57:27 +00:00
Arc
db550bc9dd
Merge pull request #129 from BenGWeeks/feature/tab-navigation-119
feat: restructure UI with tab-based navigation
2025-12-24 03:53:20 +00:00
Arc
3d503cefff Merge branch 'main' into feature/tab-navigation-119 2025-12-24 03:51:38 +00:00
Arc
18dd78b50f
Merge pull request #127 from BenGWeeks/fix/currency-config-116
fix: respect admin-configured allowed currencies in dropdowns
2025-12-24 03:35:12 +00:00
Arc
9b95ae22a9
Merge branch 'main' into fix/currency-config-116 2025-12-24 03:34:15 +00:00
Arc
34fde3dc13
Merge pull request #151 from BenGWeeks/feature/update-icon
feat: update extension icon with shop storefront design
2025-12-24 03:31:58 +00:00
Arc
9bdc54e57a
Merge branch 'main' into feature/update-icon 2025-12-24 03:31:02 +00:00
Arc
3a5e0628bf
Merge pull request #160 from BenGWeeks/feature/extension-info-card-159
feat: enhance extension info card with Nostr introduction and resources (#159)
2025-12-24 03:29:58 +00:00
Arc
1f9f037fb9
Merge branch 'main' into feature/extension-info-card-159 2025-12-24 03:28:36 +00:00
Arc
c7febeb9f5
Merge pull request #156 from BenGWeeks/feature/shipping-zone-ux-improvements
feat: improve shipping zone UX
2025-12-24 03:25:54 +00:00
Ben Weeks
65a6bb3786 fix: correct Ben Arc's GitHub URL
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:28:05 +00:00
Ben Weeks
c4f0eb4d91 feat: enhance extension info card with Nostr introduction and resources
- Add Nostrich banner image at top of card
- Change title to "Nostr Market" with intro description
- Add expandable sections: What is Nostr?, Getting Started, For Merchants, For Customers, Contributors
- Add links: Market Client, API Documentation, NIP-15 Specification, GitHub Issues
- Add Ben Weeks to contributors
- Mention NIP-15 interoperability with other marketplaces (Amethyst, Plebeian Market)

Closes #159

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:27:01 +00:00
Ben Weeks
0b8ed70350 fix: country list fixes for shipping-zones-list component (#153)
- Remove asterisks from United Kingdom and United States
- Move China to alphabetical position
- Remove "Flat rate" option
- Alphabetize country list

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:46:57 +00:00
Ben Weeks
7bfc687a87 revert: remove country list fixes, keep only search/sort (#157)
Country list fixes will come from PR #156 instead.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:44:21 +00:00
Ben Weeks
e568d55760 style: move Currency column after Cost column
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:40:00 +00:00
Ben Weeks
0e2cad101d feat: add search and sorting to shipping zones table (#157)
- Add search filter input to zones table
- Make all columns sortable with default sort by name
- Fix country list: alphabetize, remove asterisks from UK/US, remove "Flat rate"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:34:43 +00:00
Ben Weeks
284608e73c feat: disable Create Shipping Zone button if no name entered
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:07:29 +00:00
Ben Weeks
bcdd001e1b feat: add validation for max 2 decimal places on non-sat currencies
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:04:34 +00:00
Ben Weeks
3c16ebb2b7 chore: add CLAUDE.md to gitignore
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:03:29 +00:00
Ben Weeks
4dad0a0029 fix: remove extra left padding on cost field
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:59:41 +00:00
Ben Weeks
d51a66cd69 feat: move currency dropdown inline with cost field
Layout now shows: [Default shipping cost] [Currency ▼]

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:58:00 +00:00
Ben Weeks
dbd64f7faf feat: improve shipping zone UX
- Remove asterisks from UK/US country names (#153)
- Remove unclear "Flat rate" option (#153)
- Alphabetize country list, move China to correct position (#153)
- Rename "Unit" to "Currency" (#154)
- Rename cost label to "Default shipping cost" (#154)
- Add currency suffix to cost field (#154)
- Add hint about per-product shipping costs (#154)
- Add validation for whole number sats (#155)
- Disable submit button when sats validation fails (#155)
- Show error message for invalid sats values (#155)

Closes #153, #154, #155

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:53:21 +00:00
Ben Weeks
1f708fff66 style: fix prettier formatting in index.html
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:24:35 +00:00
Ben Weeks
bd010ece6b style: fix prettier formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:21:59 +00:00