Skip to content

Conversation

@brymut
Copy link
Contributor

@brymut brymut commented Sep 30, 2025

Description

Changing nym should still point to the user mentioned instead of losing link.

fixes #2232

Tested scenarios with screen recording:

  1. Simple nym change
Screen.Recording.2025-11-26.at.18.43.02.mov
  1. Nym change with multiple mentions in one post. Changing both should mentions should point mentions to new nyms
Screen.Recording.2025-11-26.at.18.44.44.mov
  1. Nym change and then a third party claims originally mentioned nym. The mentioned profile at the point of post creation should be the one linked, even if someone else claims the nym later on.
Screen.Recording.2025-11-26.at.19.00.00.mov

Checklist

Are your changes backward compatible? Please answer below:
Y

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:
10

For frontend changes: Tested on mobile, light and dark mode? Please answer below:
Y

Did you introduce any new environment variables? If so, call them out explicitly here:
N

Did you use AI for this? If so, how much did it assist you?
Y. Mostly gathering context on how mentions are stored in DB and helping me debug ordering problem of mentions.


Note

Resolve mentions to the correct user even after username changes by adding userByMention GraphQL query and wiring frontend mention/popover to use it with itemId.

  • GraphQL/API:
    • Add Query.userByMention(name: String!, itemId: ID): User with resolver that resolves a user from Mention records for a given itemId, falling back to user(name).
  • Frontend:
    • components/text.js: Pass itemId into mention renderer and UserPopover; dynamically link mentions to /${user.name} when resolved. Update useMemo deps to include itemId.
    • components/user-popover.js: Query USER_BY_MENTION (when itemId provided) and fall back to USER; expose resolved user to children; refine loading and display logic.
  • GQL Fragments:
    • Add USER_BY_MENTION query in fragments/users.js.

Written by Cursor Bugbot for commit 0f58cd2. This will update automatically on new commits. Configure here.

@brymut brymut force-pushed the fix/maintain-mention-nym-change branch from 86071e6 to 4639417 Compare September 30, 2025 14:08
@brymut brymut marked this pull request as ready for review September 30, 2025 14:16
cursor[bot]

This comment was marked as outdated.

@brymut brymut force-pushed the fix/maintain-mention-nym-change branch from 4639417 to 95745c5 Compare September 30, 2025 21:59
cursor[bot]

This comment was marked as outdated.

@brymut brymut force-pushed the fix/maintain-mention-nym-change branch from 95745c5 to 363af8e Compare September 30, 2025 22:18
cursor[bot]

This comment was marked as outdated.

@brymut brymut force-pushed the fix/maintain-mention-nym-change branch from 363af8e to ea13f2e Compare September 30, 2025 22:51
cursor[bot]

This comment was marked as outdated.

@brymut brymut force-pushed the fix/maintain-mention-nym-change branch from ea13f2e to 44e4154 Compare September 30, 2025 23:05
cursor[bot]

This comment was marked as outdated.

@brymut brymut force-pushed the fix/maintain-mention-nym-change branch from 44e4154 to 0f58cd2 Compare September 30, 2025 23:29
@ekzyis ekzyis added the bug label Oct 19, 2025
Copy link
Member

@Soxasora Soxasora left a comment

Choose a reason for hiding this comment

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

Hi @brymut, sorry for the delay, we've been hard at work with flagship features.

As you may know, I'm working on the new editor, and everything kind of changed. Including mentions, so I wanted to review this in order to see how I can adapt it to the new paradigm and give you recognition for it.


This logic doesn't actually fix anything, it adds a way to get a User via Mention, but it still uses the name parsed from markdown. So if I change my nym, the mention breaks.1

Screen.Recording.2025-11-13.at.15.26.20.mp4

I don't understand how you made it work in your video, and probably your fix actually did work in previous commits, but it's hard to see them because of force-pushing.

Footnotes

  1. in the video I'm using the rich_text branch, but I merged your PR to test it.

item: true
}
})
const matchingMention = mentions.find(mention => mention.user?.name === name)
Copy link
Member

Choose a reason for hiding this comment

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

this breaks if the mentioned user changes nym.

@brymut
Copy link
Contributor Author

brymut commented Nov 13, 2025

Hi @Soxasora, let me re-familiarise myself, will rebase and update this PR and get back to you if that's ok.

@brymut brymut force-pushed the fix/maintain-mention-nym-change branch from 0f58cd2 to 4293c54 Compare November 26, 2025 16:27
@brymut
Copy link
Contributor Author

brymut commented Nov 26, 2025

Hi @Soxasora, sorry for the force pushing again. Noticed my original solution hadn't properly factored in the order in which mentions are stored in the DB and multiple mentions in the same post. Updated the screen recording in the PR description with those test cases. Should be good to be used, let me know if you have any questions.

@brymut brymut requested a review from Soxasora November 26, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing nym does not update earlier tags

3 participants