Skip to content

feat: Edit Profile for project founders (mirrors angor-profile web app)#778

Merged
dangershony merged 4 commits intomainfrom
copilot/add-edit-project-profile-functionality
Apr 24, 2026
Merged

feat: Edit Profile for project founders (mirrors angor-profile web app)#778
dangershony merged 4 commits intomainfrom
copilot/add-edit-project-profile-functionality

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Implements the "Edit" button in My Projects → project card. Opens a full edit profile page matching the tab structure and functionality of profile.angor.io.

Relay Service (Angor.Shared)

  • FetchProfileMetadataAsync — async task-based wrapper for kind-0 profile lookup
  • FetchAppSpecificDataAsync — fetches kind-30078 (NIP-78) events by d tag (client-side filtered)
  • PublishAppSpecificDataAsync — publishes kind-30078 events with a given d tag

SDK Operations (Angor.Sdk)

  • FetchProjectProfileData — resolves project → fetches kind-0 metadata + angor:project / angor:faq / angor:members / angor:media in parallel; exposes FaqItem / MediaItem shared types
  • UpdateProjectProfile — resolves founder key via IProjectService, derives project Nostr private key from wallet seed, publishes kind-0 + kind-30078 events

Both operations are exposed through IProjectAppService / ProjectAppService.

App Layer (App)

  • EditProfileViewModel — reactive VM injecting only IProjectAppService (no direct SDK-layer service access); [Reactive] fields follow camelCase-without-underscore convention
  • EditProfileView.axaml — 6-tab UI: Profile | Project | FAQ | Members | Media | Relays
  • EditProfileView.axaml.cs — tab switching, back navigation, bubbled remove-item button handling
  • MyProjectsViewModelOpenEditProfile() / CloseEditProfile() + SelectedEditProject reactive state
  • MyProjectsView.axaml.csPART_EditButton now calls vm.OpenEditProfile(project), visibility subscription mirrors the manage-project pattern
  • CompositionRoot — registers Func<MyProjectItemViewModel, EditProfileViewModel> factory

Data flow

EditProfileViewModel
  └─ IProjectAppService.FetchProjectProfileData(projectId)
       └─ FetchProjectProfileDataHandler
            ├─ IProjectService.GetAsync → resolves NostrPubKey
            └─ IRelayService.Fetch{Profile,AppSpecificData} × 5 (parallel)

EditProfileViewModel.SaveAsync()
  └─ IProjectAppService.UpdateProjectProfile(walletId, projectId, metadata, ...)
       └─ UpdateProjectProfileHandler
            ├─ ISeedwordsProvider → wallet seed
            ├─ IDerivationOperations.DeriveProjectNostrPrivateKeyAsync(founderKey)
            └─ IRelayService.CreateNostrProfileAsync + PublishAppSpecificDataAsync × 4

Copilot AI and others added 2 commits April 22, 2026 22:19
- Add relay service methods: FetchProfileMetadataAsync, FetchAppSpecificDataAsync, PublishAppSpecificDataAsync
- Add UpdateProjectProfile SDK operation (derives project Nostr key, publishes kind 0 + kind 30078 events)
- Add UpdateProjectProfile to IProjectAppService and ProjectAppService
- Create EditProfileViewModel with tabs: Profile, Project, FAQ, Members, Media, Relays
- Create EditProfileView.axaml with multi-tab UI matching angor-profile web app structure
- Create EditProfileView.axaml.cs with tab switching and save/back actions
- Wire PART_EditButton in MyProjectsView to open edit profile panel
- Add SelectedEditProject state to MyProjectsViewModel
- Register EditProfileViewModel factory in CompositionRoot

Agent-Logs-Url: https://github.com/block-core/angor/sessions/67d28a2c-7d1b-4ef3-a0ce-7888423dc938

Co-authored-by: dangershony <7487930+dangershony@users.noreply.github.com>
…ind IProjectAppService

- Add FetchProjectProfileData SDK operation that fetches profile + all app-specific data
- Add FaqItem and MediaItem shared data types in FetchProjectProfileData.cs
- Update UpdateProjectProfile to resolve project via IProjectService internally (not via ProjectSeedDto)
- Add FetchProjectProfileData and UpdateProjectProfile to IProjectAppService/ProjectAppService
- Fix EditProfileViewModel to use only IProjectAppService (no direct IRelayService/IProjectService)
- Fix camelCase field naming convention in FaqItemViewModel, MediaItemViewModel, EditProfileViewModel
- Update CompositionRoot factory accordingly

Agent-Logs-Url: https://github.com/block-core/angor/sessions/67d28a2c-7d1b-4ef3-a0ce-7888423dc938

Co-authored-by: dangershony <7487930+dangershony@users.noreply.github.com>

// Publish app-specific data events (kind 30078)
if (request.ProjectContent != null)
await relayService.PublishAppSpecificDataAsync("angor:project", request.ProjectContent, nostrKeyHex, NoopCallback);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why do we publish to PublishAppSpecificDataAsync on each content are they not stored all in one event?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each content type is intentionally a separate kind-30078 (NIP-78 AppSpecificData) event, differentiated by its d tag (angor:project, angor:faq, angor:members, angor:media). This is NIP-33 "parameterized replaceable events" — each unique (pubkey, kind, d) triple identifies one replaceable event, so a founder can update just their FAQ without republishing the project description, members list, etc.

The angor-profile web app does exactly the same: saveProjectContent, saveFaqContent, saveMediaContent, and saveMembers are separate functions each publishing their own kind-30078 event with the appropriate d tag (see createEventsFromData in relay.service.ts which constructs one event per section and then publishes them all in parallel via Promise.all).

@dangershony dangershony marked this pull request as ready for review April 24, 2026 22:49
@dangershony dangershony merged commit 86bbed6 into main Apr 24, 2026
3 of 4 checks passed
@dangershony dangershony deleted the copilot/add-edit-project-profile-functionality branch April 24, 2026 22:50
Copilot AI restored the copilot/add-edit-project-profile-functionality branch April 24, 2026 22:50
Copilot AI requested a review from dangershony April 24, 2026 22:51
Copilot stopped work on behalf of dangershony due to an error April 24, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants