Skip to content

fix(activity): keep short messages whole in backlinks and mark truncated ones - #11127

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/backlink-text-ellipsis
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/backlink-text-ellipsis

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Fixes #9046

Problem and change

When a document was mentioned, the backlink (ActivityReference) stored only the
block that contained the mention, so the rest of a short message was lost and
for long messages nothing showed that the text was cut.

getReferencesData now builds the backlink message via getReferenceMessage:
messages with up to 500 characters of text are kept as a whole; for longer ones
only the block containing the mention is kept and an ellipsis is appended.
Single-block messages are stored as before.

Tests

New cases in server-plugins/activity-resources/src/__tests__/references.test.ts (short multi-paragraph message kept whole, exactly 500 and 501 characters). Checked manually on a self-hosted instance: a two-paragraph message mentioning an issue shows both paragraphs in the issue's backlink; with a long first paragraph only the mention paragraph is shown, ending with " …"; single-paragraph mentions look as before.

…ted ones

When a document was mentioned, the backlink (ActivityReference) stored only the
block that contained the mention, so the rest of a short message was lost and
for long messages nothing showed that the text was cut.

getReferencesData now builds the backlink message via getReferenceMessage:
messages with up to 500 characters of text are kept as a whole; for longer ones
only the block containing the mention is kept and an ellipsis is appended.
Single-block messages are stored as before.

Fixes hcengineering#9046

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Improve backlink text selection

1 participant