Repository navigation
Conversation
Tiny Code Reviewthe AI provider rate-limited the request This is advice, not a gate. Re-run with the |
unRekable
left a comment
There was a problem hiding this comment.
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).
453c447 to
aab21e6
Compare
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) andcargo clippy -p chatd --no-default-features --all-targets. Not tested against a live Slack workspace. The lab was not run.Type
Platforms
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