Suggestion for @mention improvement #160

Closed
opened 2026-10-19 12:35:44 +00:00 by littlefox · 4 comments
Owner

This is from a user on LysKOM who suggested the combined use of person number and person name and translating it upon display:

En idé är att i inlägget skriva det som <person 14777: Johan Holtz,
Lysator> men sedan i klienten visa det som @Johan Holtz, Lysator. Då
fungerar det bra även i andra klienter. Dessutom har du ett visst
skydd mot att personen byter namn mellan att inlägget skrivs och att
det läses.

This is from a user on LysKOM who suggested the combined use of person number and person name and translating it upon display: En idé är att i inlägget skriva det som <person 14777: Johan Holtz, Lysator> men sedan i klienten visa det som @Johan Holtz, Lysator. Då fungerar det bra även i andra klienter. Dessutom har du ett visst skydd mot att personen byter namn mellan att inlägget skrivs och att det läses.
Author
Owner

Triage: a good fit, added to 0.4. Recorded as D-047.

This is exactly elisp's own link syntax. lyskom-edit-insert-link (edit-text.el) writes <person N: Name>, <möte N: name> and <text N: subject>, and elisp shows them as buttons. So elisp users get a clickable person, not raw text, and other clients still see something readable.

Plan:

  • Writing: picking a name from the @-suggestions inserts <person 14777: Johan Holtz, Lysator> into the body. The composer shows it as an @Johan Holtz, Lysator chip, so the user never edits the raw form by accident.
  • Reading: <person N: …> is shown as @ + the person's current name (looked up by number, with the written name as the fallback). It links to their profile (#151). <möte N: …> and <text N: …> become links to the channel and the post.
  • Finding mentions of me: by person number first, so a rename doesn't break it. Plain @Name in posts from other clients (and NeoKOM's 0.3 posts) still counts, as today.
  • Notifications (#103) and the Mentions list use the same check.

Compat check before building: what elisp does with the name part after a rename (it should just show what was written), and that lyskomd's text limit isn't an issue for long names.

Triage: a good fit, added to 0.4. Recorded as D-047. This is exactly elisp's own link syntax. `lyskom-edit-insert-link` (edit-text.el) writes `<person N: Name>`, `<möte N: name>` and `<text N: subject>`, and elisp shows them as buttons. So elisp users get a clickable person, not raw text, and other clients still see something readable. Plan: - **Writing:** picking a name from the @-suggestions inserts `<person 14777: Johan Holtz, Lysator>` into the body. The composer shows it as an `@Johan Holtz, Lysator` chip, so the user never edits the raw form by accident. - **Reading:** `<person N: …>` is shown as `@` + the person's *current* name (looked up by number, with the written name as the fallback). It links to their profile (#151). `<möte N: …>` and `<text N: …>` become links to the channel and the post. - **Finding mentions of me:** by person number first, so a rename doesn't break it. Plain `@Name` in posts from other clients (and NeoKOM's 0.3 posts) still counts, as today. - **Notifications** (#103) and the Mentions list use the same check. Compat check before building: what elisp does with the name part after a rename (it should just show what was written), and that lyskomd's text limit isn't an issue for long names.
Author
Owner

Extended (D-047, your comment): NeoKOM will also write <möte N: name> and <text N: subject>, not only show them, the same convention as elisp and jskom. In the composer, picking a channel or a post to link inserts that form (a # suggestion list for channels, and a post number for texts), shown as a chip. In the reader, all three become links with the current name or subject.

Extended (D-047, your comment): NeoKOM will also *write* `<möte N: name>` and `<text N: subject>`, not only show them, the same convention as elisp and jskom. In the composer, picking a channel or a post to link inserts that form (a # suggestion list for channels, and a post number for texts), shown as a chip. In the reader, all three become links with the current name or subject.
Author
Owner

A correction to my plan: the composer shows the raw <person N: Name> text, not a chip. A plain textarea can't hold chips, and the raw form is what elisp users see too. Implementation in PR #162.

A correction to my plan: the composer shows the raw `<person N: Name>` text, not a chip. A plain textarea can't hold chips, and the raw form is what elisp users see too. Implementation in PR #162.
Author
Owner

Merged in #162 (D-047).

  • Writing: @name writes <person N: Full Name>, #name writes <möte N: name>, and #123 writes <text 123: subject>.
  • Reading: all three, and elisp's variants, show as links with the current name or subject. A post link opens the post, a channel link enters the channel, and a person link opens their status page until #151.
  • Mentions: a link to my person number is a mention, whatever name it carries.
  • Wrapping: never splits a link.

Verified: markup and wrap unit tests; links.spec on desktop, Android and iPhone (write with @/#, read, follow each, Tove sees the mention); the mentions, compose, format and notifications specs; screenshots checked; CI green.

Merged in #162 (D-047). - **Writing:** `@name` writes `<person N: Full Name>`, `#name` writes `<möte N: name>`, and `#123` writes `<text 123: subject>`. - **Reading:** all three, and elisp's variants, show as links with the current name or subject. A post link opens the post, a channel link enters the channel, and a person link opens their status page until #151. - **Mentions:** a link to my person number is a mention, whatever name it carries. - **Wrapping:** never splits a link. Verified: markup and wrap unit tests; links.spec on desktop, Android and iPhone (write with @/#, read, follow each, Tove sees the mention); the mentions, compose, format and notifications specs; screenshots checked; CI green.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
littlefox/neokom#160
No description provided.