Skip to content

feat: send trade phrases by themselves, give quick phrases their own page, and edit the online library - #46

Merged
sunerpy merged 5 commits into
mainfrom
feat/trade-phrases
Nov 6, 2026
Merged

sunerpy merged 5 commits into
mainfrom
feat/trade-phrases

Conversation

@sunerpy

@sunerpy sunerpy commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Trades send their messages by themselves (opt-in). Two switches on the new Phrases page,
    both off by default: 向队友发起交换时自动发送 sends the first quick phrase to the teammate the user
    just asked (the cell whose trade reads SENT), and 交换成功后自动道谢 sends a thank-you once the
    two champions have actually changed places. Each is sent at most once per teammate per champ
    select; a declined, cancelled or abandoned ask is never thanked, and trades between two other
    teammates (BUSY) send nothing. The thank-you is the user's own ({seat}, {champion},
    {name}) or the language's default (「谢谢{seat}大佬!」). Settings: comeback.trade {onAsk, onDone, thanks} (absent in 0.0.19 files, read as off). The messages queue behind champ select's shared
    3 s spacing with the comebacks; Activity reports phraseSent / phraseSkipped with the trigger.
  • Quick phrases get their own page (快捷语, Ctrl+8). Champ select's phrases, the 发给交换的队友
    shortcut and the trade switches move off the Comebacks page into 选人快捷语, with panels 快捷语 and
    交换英雄. The comebacks' shortcuts are renamed 反击发到队伍 / 反击发到全体. Settings stay under
    comeback, so 0.0.19 files need no migration. Ctrl+1–7 keep their pages.
  • The online library can be viewed and edited. 在线语录 › 查看和编辑 opens a dialog: either set
    (口吐芬芳, 火力全开), 50 lines a page, a search, each line edited in place or removed, new lines
    added on top. Every change saves both sets whole, one save after another (edit_comeback_library);
    the core cleans them like the user's own lines (folded spaces, 200 characters, blanks and repeats
    dropped, 5000 a set) and answers what it kept. An edited library shows 已修改, and removing it
    asks first, since a new download brings the original lines back. comeback-library.json gains
    edited (absent before, read as false). The library's switch is untouched by edits.
  • Docs: README, the site in both languages (live, settings, automation, overview, home),
    DESIGN.md, AGENTS.md, docs/platform-notes.md (the SENT state as measured).

Tested

  • scripts/evidence.sh with the CI toolchain (RUSTUP_TOOLCHAIN=1.96.0) on cdc0e4e, every gate
    exit=0 (target/qa/evidence/20261106T182608Z): fmt, clippy -D warnings,
    cargo test --workspace (lcu 12, shell 52, winer-core 345 + 1 ignored), lcu and winer-core alone,
    cargo xwin check, pnpm format, lint, typecheck and test (shared 7, plugin 72, desktop 169). Also
    cargo xwin clippy -p winer --all-targets -D warnings on ce100d3 (d9d00c2 and cdc0e4e touch
    no Windows code).
  • The owner's PC, test build 005e9ab, WeGame client, ARAM (2026-11-06 22:46 CST), both trade
    switches on, a read-only recorder of /lol-champ-select/v1/session every 0.4 s: the user asked
    cell 4; its trade read SENT, every other cell INVALID. winer logged
    sent a trade's message trigger=Asked then, 5.6 s later as the champions swapped,
    trigger=Done. In six other champ selects that evening, with trades between other teammates
    (BUSY) and bench swaps, winer sent nothing. Both recordings are replayed in
    the_champ_selects_recorded_on_the_owners_pc_ask_and_thank_exactly_once.
  • The library editor in tests: paging, search, edit, delete, add, the counts and 已修改; the
    removal confirmation only for an edited library; a newer edit kept on screen while an older save
    answers; a failed read (with retry) and a failed save (the kept lines shown again, nothing marked
    edited). Core: cleaning and capping an edited set, a 0.0.19 library file read as unedited, edits
    kept across a restart and gone with the removal, both commands refused with no library.
  • Not run on hardware: the library editor itself and the 快捷语 page's layout in the real window (the
    owner's PC ran 005e9ab, before the editor); RECEIVED, ACCEPTED, DECLINED and CANCELLED
    were never captured.

BEGIN_COMMIT_OVERRIDE
feat: 选人时交换英雄可自动发消息:向队友发起交换时自动发出第一条快捷语,交换成功后自动道谢;两个开关默认关闭,感谢语可自定义 (#46)

feat: 选人快捷语独立成「快捷语」页(Ctrl+8),与反击页分开;反击的两个快捷键改名为「反击发到队伍」「反击发到全体」 (#46)

feat: 在线语录可以查看和编辑:分档浏览、搜索,逐句修改、删除和添加;改过的语录标「已修改」,移除前会先确认 (#46)
END_COMMIT_OVERRIDE

Two switches in Comebacks › Champ-select phrases, both off by default:
send the first phrase when the user clicks Trade on a teammate in the
client (that cell's trade turns SENT), and a thank-you template once
the two champions are swapped. Each goes to a teammate once per champ
select, over the client's chat API only.

- comeback::trade_events follows the user's own request apart from the
  once-per-teammate suppression, so an ask made again after a cancel is
  still thanked; another teammate's trade and RECEIVED send nothing.
- Every spaced post in champ select (comebacks, the phrase shortcut, the
  trade messages) goes through post_spaced under one chat lock, which
  rechecks the 3 s spacing and records it only for a post that went out;
  the board menu takes the lock without the spacing.
- Trade messages are written when their event is seen and posted from
  one ordered queue that waits out the spacing instead of dropping them.
- PhraseSent and PhraseSkipped name their trigger (shortcut, asked, done).
…backs

The quick phrases, their shortcut and the trade's two switches move from
the Comebacks page to a new Phrases page (快捷语, Ctrl+8, added last so the
other pages keep their numbers). The Live page's phrase menu links there.
The comebacks' two shortcuts are renamed 反击发到队伍 and 反击发到全体.

The settings stay under `comeback`, where 0.0.19 saved the phrases and
their shortcut, so nothing is migrated. The champ-select chat keeps one
3-second spacing for comebacks and phrases, now said on both pages.
在线语录 gets 查看和编辑: a large dialog listing either set (口吐芬芳,
火力全开) 50 lines a page, with a search, each line edited in place or
removed, and new lines added on top. Every change saves both sets whole,
one save after another; the core cleans them as the user's own lines
(folded spaces, 200 characters, blanks and repeats within a set dropped,
5000 a set at most) and answers what it kept.

The library file gains `edited` (absent in files from 0.0.19, read as
false); the panel says 已修改, and removing an edited library asks first,
since a new download brings back the original lines. Editing leaves the
library's switch as it was. Two commands, comeback_library_lines and
edit_comeback_library, both refused while nothing is downloaded.
@sunerpy
sunerpy merged commit 711dea6 into main Nov 6, 2026
6 checks passed
@sunerpy
sunerpy deleted the feat/trade-phrases branch November 6, 2026 18:37
@winer-release winer-release Bot mentioned this pull request Nov 6, 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.

1 participant