Skip to content

Enable owner-only inline profile description and country editing on user profile page#808

Draft
benckx with Copilot wants to merge 8 commits into
masterfrom
copilot/benckx-93-edit-profile-settings
Draft

Enable owner-only inline profile description and country editing on user profile page#808
benckx with Copilot wants to merge 8 commits into
masterfrom
copilot/benckx-93-edit-profile-settings

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

This updates the profile page to let users edit their own profile details in place, instead of navigating to settings. Edit controls are now shown only when the viewer owns the profile.

  • Ownership-aware rendering

    • HtmlRouting now derives isOwnProfile by comparing the resolved token user id with the profile owner id.
    • UserProfilePageRenderer accepts this flag and emits ownership/country data attributes for client behavior.
  • Owner-only edit UI on profile page

    • user_profile.html now includes owner-only inline edit controls:
      • description pencil trigger button
      • hidden description textarea
      • hidden save button
    • The profile header country area now supports owner editing:
      • if a country is set, the current flag stays visible and a small update country text trigger is shown
      • if no country is set, a small add country text trigger is shown
      • hidden country <select> is revealed only after clicking the text trigger
    • Existing description and flag rendering remains unchanged for non-owners.
  • Client-side edit flow

    • user-profile.js adds inline edit behavior:
      • toggle from rendered description to textarea on pencil click
      • prefill textarea from current visible description (empty for placeholder state)
      • hide the rendered description when editing so the textarea replaces it
      • fill and manage owner-only country dropdown from the countries module
      • submit to existing POST /api/user/settings/profile endpoint with both description and selected country
      • refresh view after successful save so server-sanitized/rendered content is reflected
  • Styling and interaction polish

    • user-profile.css adds minimal styles for the new controls, including focus/hover treatment for edit buttons and styling for the country helper text.
    • Added a local .hidden-by-default rule so profile edit controls are truly hidden until activated.
// HtmlRouting.kt
val verifiedToken = extractAndVerifyToken() as? VerifiedToken
val isOwnProfile = verifiedToken?.userId == userProfileResponse.userId
call.respondHtml(renderer.renderUserProfile(userProfileResponse, isOwnProfile))

Copilot AI changed the title [WIP] Add pencil icon and textarea for editing profile settings Enable owner-only inline profile description editing on user profile page Jun 16, 2026
Copilot AI requested a review from benckx June 16, 2026 11:17

@benckx benckx left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot Since we need both the country and description to make the update, then we should make it possible to click on the flag and get the drop down for list of country. If country not set yet (i.e. no flag), add a little text.

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Since we need both the country and description to make the update, then we should make it possible to click on the flag and get the drop down for list of country. If country not set yet (i.e....

Implemented in e3f4388: profile owners can now click the flag to open a country dropdown, and when no country is set they get a small add country text trigger that opens the same dropdown. Save now submits both description and the selected country from the profile page.

Copilot AI changed the title Enable owner-only inline profile description editing on user profile page Enable owner-only inline profile description and country editing on user profile page Jun 16, 2026
Copilot AI requested a review from benckx June 16, 2026 12:19

@benckx benckx left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot The textarea should only be visible after we click on the pencil icon. And it should replace the div. For the flag, there should be a little text to update it before showing the drop down. This looks terrible lol.

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot The textarea should only be visible after we click on the pencil icon. And it should replace the div. For the flag, there should be a little text to update it before showing the drop down. Th...

Implemented in b0a65af:

  • description textarea/save are now actually hidden by default and only shown after clicking the pencil, while the visible description is hidden at that point
  • for country, owners now see a small update country text trigger (or add country when empty) before the dropdown is shown

Copilot AI requested a review from benckx June 16, 2026 15:25
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