Commit Graph
1090 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 321a837d5a chore(dashboard): strip JSDoc blocks and section comments from TasksSection 327→261 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 06:25:40 +02:00
g-butandClaude Sonnet 4.6 cd0c17cb61 refactor(profile): extract useProfileEntityTab hook from ProfileEntityTab 337→185 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 06:15:03 +02:00
g-butandClaude Sonnet 4.6 fc33129034 refactor(messaging): extract useMessageView hook from MessageView 338→140 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 06:01:50 +02:00
g-butandClaude Sonnet 4.6 28a1b39009 refactor(ui): extract useCurrencyInput hook from CurrencyInput 340→197 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 05:50:25 +02:00
g-butandClaude Sonnet 4.6 c162103af9 refactor(ai-chat): extract useAIChatPanel hook from AIChatPanel 346→181 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 05:37:55 +02:00
g-butandClaude Sonnet 4.6 2ba43c379a chore(ui): remove JSDoc blocks and inline comments from component-variants 346→253 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 05:30:31 +02:00
g-butandClaude Sonnet 4.6 b1223e0be4 refactor(loans): extract useMakeOfferForm hook from MakeOfferDialog 354→258 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 05:22:38 +02:00
g-butandClaude Sonnet 4.6 0536ba61fa refactor(ai): decompose AIModelPreferences 355→273 lines
Extract AIModelSelector to own file; add CapabilityToggleCard local
component to eliminate duplicated Vision/FunctionCalling toggle cards.
Remove JSDoc block and section-header comments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 05:13:56 +02:00
g-butandClaude Sonnet 4.6 0b4951cb51 refactor(dashboard): split HeaderCreateButton out of SmartCreateButton 355→235 lines
Extract HeaderCreateButton to its own file; export CREATE_OPTIONS and
shouldShowDivider for shared use. Update Header.tsx import path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 05:03:40 +02:00
g-butandClaude Sonnet 4.6 0ff45dd151 refactor(nostr): extract useNostrConnectionCard hook 359→275 lines
Remove JSDoc block; move all state, balance fetching, and interaction
handlers into useNostrConnectionCard hook.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 04:53:40 +02:00
g-butandClaude Sonnet 4.6 d52b295fab refactor(groups): extract useCreateEventForm hook from CreateEventDialog 360→276 lines
Remove JSDoc block; move form setup, submit handler, and date helper into hook.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 04:46:30 +02:00
g-butandClaude Sonnet 4.6 43138925c4 refactor(ui): extract useLocationInput hook from LocationInput 360→102 lines
Move all state, refs, async handlers (zip lookup, Nominatim search,
suggestion select, click-outside) into useLocationInput hook.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 04:38:30 +02:00
g-butandClaude Sonnet 4.6 3ce8f9fd9d refactor(blog): decompose BlogClientWrapper 364→85 lines
Extract useBlogFilters hook (filter state + time/tag logic),
BlogFilters sub-component, and BlogPostCard sub-component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 04:30:33 +02:00
g-butandClaude Sonnet 4.6 4ec0dbd47b refactor(project): extract useProjectDonation hook
Decompose 364-line god component: move all state, effects, and handlers
into useProjectDonation hook; hoist SUGGESTED_AMOUNTS_SATS to module level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 04:24:07 +02:00
g-butandClaude Sonnet 4.6 f2fe8d78c8 refactor(entity): extract EntityCardImage from EntityCard 369→242 lines
Extracted EntityCardImage (~84 lines) with its own imageError/imageLoaded
state, ImagePlaceholder/ImageLoader helpers, and Link wrapper.
Removed JSDoc block and inline comments. Main card is pure layout/slots.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 04:13:28 +02:00
g-butandClaude Sonnet 4.6 94a5432624 refactor(groups): decompose GroupDetail 371→97 lines
Extracted useGroupDetail hook (~103 lines) for data loading and
computed config values. Extracted GroupDetailSidebar (~146 lines) for
the info/bitcoin/stats cards. Extracted GroupDetailTabs (~136 lines)
for the tabbed main content. Removed 10-line JSDoc block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 03:59:57 +02:00
g-butandClaude Sonnet 4.6 a80adee2e8 refactor(notifications): decompose NotificationCenter 375→184 lines
Extracted useNotificationCenter hook (~119 lines) for all state and
handlers. Extracted NotificationItem component (~124 lines) for the
per-notification row with icon logic. Hoisted FILTER_TABS config to
module level. Main component is pure orchestration + layout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 03:50:43 +02:00
g-butandClaude Sonnet 4.6 727cc9452b refactor(timeline): extract useTimelineView hook 379→193 lines
Moved all state, useCallback handlers, and useMemo computations
into useTimelineView.ts (~156 lines). Removed two JSDoc blocks.
Component now owns only rendering logic across the 5 display states.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 03:41:17 +02:00
g-butandClaude Sonnet 4.6 6b5f80efd7 refactor(ai): decompose AIKeyManager 380→122 lines
Extracted AIKeyCard (~92 lines) for per-key row rendering and
AIKeyAddForm (~170 lines) with self-contained form state.
Main component now owns only isAdding/keyToDelete state + delete dialog.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 03:33:06 +02:00
g-butandClaude Sonnet 4.6 5bce0c2378 refactor(profile): decompose SocialLinksEditor 380→121 lines
Extracted SocialLinkCard (~46 lines) and SocialLinkForm (~193 lines)
into their own files. Main editor now only owns list-management state
(isAdding, editingIndex) and orchestration logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 03:26:15 +02:00
g-butandClaude Sonnet 4.6 7cb973a17c refactor(timeline): strip ComposerShared dead exports + comments 380→272 lines
Deleted PostButton/PostButtonProps (zero external consumers).
Removed Button import, all JSDoc blocks, and section-header comments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 03:18:40 +02:00
g-butandClaude Sonnet 4.6 5bfc8c292d refactor(timeline): decompose PostComposerMobile god component 390→278 lines
Extract full-screen close/post header into PostComposerFullScreenHeader,
inline action bar + loading/hint into PostComposerInlineControls.
Hoist lazy import to module level. Remove stale JSDoc.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 03:07:27 +02:00
g-butandClaude Sonnet 4.6 3a18895ecc refactor(collateral): decompose CollateralSelector god component 406→293 lines
Extract state/effects/memos/handlers into useCollateralSelector hook.
Consolidate coverage bar conditional logic. Remove stale JSDoc.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 02:59:00 +02:00
g-butandClaude Sonnet 4.6 c593ef551c refactor(wishlist): decompose ProofUploadForm god component 407→185 lines
Extract state/handlers into useProofUploadForm hook and drag-drop
image upload zone into ProofImageUpload component. Remove stale JSDoc.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 02:47:33 +02:00
g-butandClaude Sonnet 4.6 612f255157 refactor(messaging): decompose MessageComposer god component 401→118 lines
Extract send logic into useMessageComposer hook and actor
dropdown UI into MessageActorSelector component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 02:32:08 +02:00
g-butandClaude Sonnet 4.6 b75b8a03a4 refactor(timeline): decompose PostCard god component 417→260 lines
Extract all state + handlers into usePostCardActions hook.
PostCard now owns only JSX; hook owns router, repost delegation,
reply flow, edit/delete flow, and selection logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 02:25:04 +02:00
g-butandClaude Sonnet 4.6 9717c89b69 refactor(proposals): decompose CreateProposalDialog god component 418→135 lines
Extract ProposalFormFields component (all 9 FormField instances + Form/form
wrappers + submit/cancel buttons) into own file. Parent becomes a thin
dialog shell with submit handler and guidance panel layout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 02:16:38 +02:00
g-butandClaude Sonnet 4.6 83e92d870d refactor(messaging): decompose MessagePanel god component 419→267 lines
Extract useMessagePanelState hook (conversation selection, bulk delete,
search, tabs, URL initialization) and MessagePanelLoading component
(auth-hydrating state with modal/fullPage variants).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 02:09:42 +02:00
g-butandClaude Sonnet 4.6 fb515a2c17 refactor(navigation): decompose ContextualLoader god component 425→71 lines
Extract route content config (icons, titles, actions per path) to
contextual-loader-config.ts as a typed ROUTE_CONFIGS array. Component
becomes a thin 71-line renderer. Also fixes missing Lightbulb import
(was an inline SVG workaround) by importing directly from lucide-react.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 02:02:53 +02:00
g-butandClaude Sonnet 4.6 e5f432d568 refactor(messaging): decompose ConversationList god component 443→216 lines
Extract ConversationListItem with all helper functions (buildProfileHref,
getConversationDisplayName, getConversationAvatar, etc.) into own file.
Parent becomes a pure list manager with filter/selection/delete logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 01:56:22 +02:00
g-butandClaude Sonnet 4.6 dbb34978a4 refactor(auth): decompose MFASetup god component 446→245 lines
Extract useMFASetup hook (state + handlers) and MFAStatus into own
files; MFASetup.tsx re-exports MFAStatus for API compat. Also removes
any type (factors now typed) and JSDoc comment block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 01:49:47 +02:00
g-butandClaude Sonnet 4.6 a4078f2024 refactor(profile): decompose ProfileLayout god component 447→209 lines
Extract useProfileActions hook (113 lines): follow state/toggle, share
state/outside-click, and profile-save handler with router.refresh.
Extract ProfileBannerSection (139 lines): banner image, avatar, share
button+dropdown, and follow/edit-profile action buttons.
Remove 10-line JSDoc comment block from parent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 01:40:43 +02:00
g-butandClaude Sonnet 4.6 5ae4097a5c refactor(wallets): decompose WalletRecommendationCards god component 456→167 lines
Extract RecommendedWalletCard (131 lines) with its Wallet type, and
WalletRecommendationFilterBar (98 lines) with ACTIVE/INACTIVE_CLASS constants.
Parent retains only state/filter logic + layout — all JSDoc comments removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 01:32:09 +02:00
g-butandClaude Sonnet 4.6 39bb884e49 refactor(create): decompose EntityCreationWizard god component 461→305 lines
Extract WizardProgressBar (82 lines) and WizardTemplateOnlyView (50 lines).
Promote WIZARD_THEMES and WIZARD_STEP_VARIANTS to module-level constants,
inline buildWizardSteps into useMemo, and remove the 27-line doc comment block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 01:24:39 +02:00
g-butandClaude Sonnet 4.6 9b492dbbfd refactor(ai): decompose AIRevenuePanel 483→180 lines into four focused modules
- types.ts: shared interfaces (AssistantRevenue, RevenueData, Withdrawal,
  EarningsData) + MIN_WITHDRAWAL_SATS constant
- useAIRevenue: data-fetching hook (fetchRevenue, fetchWithdrawals,
  refresh + useEffect)
- WithdrawDialog: owns withdrawal form state (amount, address, withdrawing)
  and handleWithdraw; receives earnings + onWithdrawSuccess from parent
- RecentWithdrawals: getStatusIcon helper + list rendering

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 01:07:26 +02:00
g-butandClaude Sonnet 4.6 900bdb38eb refactor(discover): decompose DiscoverResults 499→203 lines into three focused modules
Extracted three standalone pieces to bring the god component under the 300-line limit:

- AnimatedGrid<T>: generic motion grid with no external dependencies
- DiscoverLoadingState: skeleton rendering keyed on activeTab + viewMode
- DiscoverAllTab: builds allSections from genericTabs + 4 typed specials
  and renders them through ResultsSection

In DiscoverResults itself the 4 identical typed-tab if-blocks (investments /
loans / projects / profiles) are collapsed into a single renderTabContent
helper, saving ~40 lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 00:55:08 +02:00
g-butandClaude Sonnet 4.6 664491750e refactor(create): extract useEntityFormSubmit hook + FormFieldGroups component from EntityForm
EntityForm/index.tsx was 500 lines — reduced to 232 by pulling out two
self-contained pieces:

- useEntityFormSubmit: owns the 152-line handleSubmit callback and the
  wallet pre-population useEffect (existingWalletLinkIdRef lives here).
  Also fixes a latent bug: setSubmitting(false) now runs in a finally
  block so the spinner always resets on both success and error paths.

- FormFieldGroups: renders the visibleFieldGroups.map loop (82 lines)
  as a generic component parameterised over T.

WizardMode is now exported from index.tsx so consumers can import from
the barrel rather than duplicating the interface.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 00:44:11 +02:00
g-butandClaude Sonnet 4.6 56c32cddda chore(currency): collapse 786-line index.ts into thin re-export barrel
Sub-modules (rates.ts, conversion.ts, formatting.ts, validation.ts, types.ts)
already contained correct implementations. index.ts was duplicating all of
them, creating two independent rate caches that could silently diverge.

Replace with a 111-line barrel: type re-exports + named re-exports +
currencyService convenience bundle. No consumer changes required — all
exported symbols are preserved at the same import path.

786 → 111 lines (-675). Resolves SSOT violation (dual rate cache).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 00:29:59 +02:00
g-butandClaude Sonnet 4.6 93d134a747 chore: extract usePostThread hook + collapse modal states in tasks page
- post/[id]/page.tsx: 317 → 195 lines (god file resolved). Extracted all
  data-fetching, tree utilities, and state into usePostThread hook. Defined
  pageHeader const to eliminate 3× header duplication.
- post/[id]/usePostThread.ts: new hook containing mainPost/parentPosts/replies
  state, updateReplyTree/appendReplyToTree, fetchPost + useEffect, and all
  three update handlers.
- tasks/[id]/page.tsx: 304 → 299 lines. Collapsed 3 modal boolean states
  (showCompleteModal, showRequestModal, showAttentionModal) into single
  activeModal: 'complete' | 'request' | 'attention' | null state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 00:17:39 +02:00
g-butandClaude Sonnet 4.6 8ef2511011 refactor(discover): collapse 13 individual 'all' tab sections into config-driven loop
The 'all' tab had 13 copy-paste {count > 0 && <ResultsSection>...} blocks
(~287 lines). The 9 generic types are now derived from the existing
genericTabs config (already used by individual tabs). The 4 special types
(projects, investments, loans, profiles) are defined as inline entries.
A single .filter + .map renders all sections.

669 → 475 lines (-194).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 00:03:38 +02:00
g-butandClaude Sonnet 4.6 00d68b8047 refactor: extract useBulkDelete hook — eliminate 4-way duplication
EntityDashboardPage, investments/page, useLoanList, useProjectList
all implemented the same bulk-delete state machine (isDeleting,
bulkDeleteConfirm, handleBulkDelete, executeBulkDelete). Extracted
to src/hooks/useBulkDelete.ts; onSuccess callback covers the
projects case that also needs setShowSelection(false).

Net: -153 lines / +107 lines = -46 lines total.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 23:52:44 +02:00
g-butandClaude Sonnet 4.6 903c1da143 refactor(api): extract duplicated ownership check + deduplicate EntityForm toast
entityCrudHandler: PUT and DELETE shared identical 14-line ownership check
blocks; extracted to defaultOwnershipCheck() helper. Also renamed
existingData2 → existingData in DELETE handler.

EntityForm: toast.success called with identical content in two branches;
extracted to showSuccessToast() local constant.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 23:35:44 +02:00
g-butandClaude Sonnet 4.6 598ae3c67c refactor(profiles): replace 7-query entity count block with config-driven loop
ENTITY_COUNT_CONFIG drives a single Promise.all loop instead of 7
near-identical repeated queries, eliminating 35 lines and 7 named
intermediate variables. entityCounts map flows directly to the component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 23:25:10 +02:00
g-butandClaude Sonnet 4.6 8bd3b4b5d5 refactor(discover): collapse 27-line isEmpty chain into tabItems map
Replaces per-tab isEmpty conditions with a single
Partial<Record<DiscoverTabType, unknown[]>> map — adding a new tab
type now only requires one line instead of two conditions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 23:19:33 +02:00
g-butandClaude Sonnet 4.6 800056d42d refactor(profile): collapse 7 individual entity count props into entityCounts map
Mirrors the DiscoverTabs fix: replaced productCount/serviceCount/causeCount/
eventCount/loanCount/assetCount/aiAssistantCount with a single
entityCounts: Partial<Record<EntityType, number>>.

Also removes statsKey from PROFILE_ENTITY_TABS (now EntityType[]) since
the map key is the EntityType itself.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 23:15:32 +02:00
g-butandClaude Sonnet 4.6 5ef10b0140 refactor(discover): deduplicate DiscoverResults grid components + fix icons
- Replace 4 near-identical XxxGrid components (ResultsGrid/LoansGrid/
  InvestmentsGrid/GenericGrid) with a single AnimatedGrid<T> generic
- Replace 9 identical individual-tab if-blocks with a genericTabs config
  array + single dispatch (genericTabs.find)
- Fix copy-paste icon bug: products/services/events/groups/causes were
  all showing <Users> icon in the 'all' tab; now use correct icons
  (Package, Briefcase, Calendar, Building2, Heart)
- displayedCount simplified via genericTabs.reduce instead of 9 manual
  array length additions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 23:07:00 +02:00
g-butandClaude Sonnet 4.6 e6695c9129 refactor(discover): collapse 13 individual count props into counts object
DiscoverTabsProps went from 13 scalar xxxCount props to a single
Partial<Record<DiscoverTabType, number>> — removes prop explosion,
makes adding new entity types a one-line change instead of 3.
Eliminates TabCounts intermediate type and per-tab getCount functions.
DiscoverTabs.tsx: 281 → 142 lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 22:59:58 +02:00
g-butandClaude Sonnet 4.6 375435b00a refactor(loans): migrate public loan detail page to PublicEntityDetailPage
loans/[id]/page.tsx drops from 318 → 186 lines. Added three optional config
fields to EntityDetailConfig: visibilityFilter (replaces hardcoded
status=active filter), renderSidebarExtra (Quick Stats + Contact CTA),
and showPaymentSection (opt-out for non-transactional entity types).

All 12 public entity detail pages now use the generic component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 22:52:06 +02:00
g-butandClaude Sonnet 4.6 e3ef111614 refactor: remove local formatCurrency wrappers — use service directly
Four files each defined a local formatCurrency that either wrapped or
duplicated src/services/currency's formatCurrency:

- ProjectSummaryRail: pure passthrough wrapper deleted, import renamed
- ProjectPageClient: null-guard wrapper deleted, call sites use ?? 0
- loans/[id]/page.tsx (public): local BTC+fiat implementation deleted,
  replaced with service import; currency null-coalesced to 'USD'
- dashboard/loans/[id]/page.tsx: same; also removes the nested function
  that was duplicating the public page's logic

The service's formatCurrency handles USD/EUR/CHF/BTC/SATS properly,
including edge currencies the local Intl.NumberFormat fallback missed
(e.g. GBP fell through to USD). BTC amounts now render as ₿0.001
instead of 0.00100000 BTC — stricter format, easier to read.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 22:12:13 +02:00
g-butandClaude Sonnet 4.6 9538544f34 fix: link hero stats to discover tabs + remove dead BTC branch in formatCurrency
DiscoverHero: "Active Projects" and "People" stat cards now link to
/discover?type=projects and /discover?type=profiles respectively, with
hover effects. Finance stat stays unlinked (composite of 3 entity types).

loans/[id]/page.tsx + dashboard/loans/[id]/page.tsx: remove unreachable
second `if (currency === 'BTC')` branch that was copy-pasted from prior
version — first branch already returns, so the second was dead code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 21:56:40 +02:00