Skip to content

Slack: custom emoji show as :name: until the emoji picker has been opened - #820

Closed
itz4blitz wants to merge 1 commit into
mainfrom
issue/563-slack-custom-emoji
Closed

itz4blitz wants to merge 1 commit into
mainfrom
issue/563-slack-custom-emoji

Conversation

@itz4blitz

Copy link
Copy Markdown
Collaborator

What changed and why

A custom Slack emoji in a message, a reaction, or a status is a picture as soon as the workspace list is known. The list is fetched the first time one is needed, at most once a day, and a rename keeps the picture under the new name instead of waiting for the next daily list. Rows already on screen are filled in from the stored page.

Tested with cargo test -p chatd --no-default-features --test slack (the new fixture test and the existing Slack tests) and cargo clippy -p chatd --no-default-features --all-targets. Not tested against a live Slack workspace. The lab was not run.

Type

  • feature
  • fix
  • perf
  • refactor
  • chore
  • docs

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

Proof

Scenario: e2e/scenarios/slack-custom-emoji

Lab run: not run

Compatibility

No protocol change. An older build ignores the prove variable and keeps serving, so the scenario driver fails there.

Risk and rollback

A stale list would show the wrong picture until the next day or an emoji change event. Revert this commit.

Release note

Custom Slack emoji show as pictures without opening the emoji picker.

Closes #563

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Tiny Code Review

⚠️ Code review unavailable · run

the AI provider rate-limited the request

This is advice, not a gate. Re-run with the agent:review label or a /review comment.

@unRekable unRekable left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code Review

🟢 No findings.

The PR moves the Slack emoji.list fetch from picker-only to any message that names an unknown custom emoji, throttled to once a day by the same note the picker used and paced through the existing pacer, which matches the house pattern (usergroups.list already works this way on the parse path). The repaint of rows already on screen reads the newest 50 from the store only, writes back through the standard history ingest, and never refetches a page. The byte scan in paint_emoji is panic-safe (emoji_end only runs at a real ':' boundary, and the cursor strictly advances), the rename handling keeps file ids stable (same emoji:name:fnv construction as before), and tests plus the lab's e2e scenario cover the new behavior. I found no blocker and no major; the design holds.

Residual risk

  • docs/architecture.md still says 'Catalogs are asked when a picker tab opens, never before' (line 206); Slack's emoji catalog is now also asked by an arriving message, so that sentence should be updated when the docs phase runs.
  • Repaint only adds Style::Emoji { file } spans, so a custom emoji that aliases a standard one (:shipit: to a rocket) stays literal ':name:' text in rows stored before the list was fetched, while rows ingested afterwards show the glyph; the two disagree until Slack serves the page again.
  • paint_emoji scans raw stored text for ':name:' shapes, so prose like 12:30:45 is looked up as an emoji name; it stays text unless the workspace really has such an emoji, which matches Slack's own renderer but can add a picture span Slack's rich text never marked.
  • Renamed rows are written back after a read of the newest 50; a send outcome or an edit landing between that read and the write can be replaced by the older copy. The same read-then-ingest window already exists for history pages, so this widens nothing in kind, only in frequency (once per emoji event).

@itz4blitz

Copy link
Copy Markdown
Collaborator Author

Superseded by and merged in #903 (d387971 — Release 2026-11-20 combined PR).

@itz4blitz itz4blitz closed this Nov 21, 2026
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.

Slack: custom emoji show as :name: until the emoji picker has been opened

2 participants