Redesign token reply message to include all available sources in one message: Spot (primary), Future, and Alpha
Remove alpha-first early return and compose a unified message with conditional rows
Add renderer and tests for five scenarios: all-sources, spot+future, alpha-only, future-only, spot-only
Test Plan
go test ./internal/services/tele/view -run RichTokenMessage -v
go test ./internal/services/tele/commands -run BuildRichTokenMessageInput -v
go test ./...
go vet ./...
Runtime Telegram manual check (blocked locally due invalid/missing TELEGRAM_TOKEN env)
## Summary
- Redesign token reply message to include all available sources in one message: Spot (primary), Future, and Alpha
- Remove alpha-first early return and compose a unified message with conditional rows
- Add renderer and tests for five scenarios: all-sources, spot+future, alpha-only, future-only, spot-only
## Test Plan
- [x] go test ./internal/services/tele/view -run RichTokenMessage -v
- [x] go test ./internal/services/tele/commands -run BuildRichTokenMessageInput -v
- [x] go test ./...
- [x] go vet ./...
- [ ] Runtime Telegram manual check (blocked locally due invalid/missing TELEGRAM_TOKEN env)
Document unified Telegram token message format that includes
all available sources (spot/future/alpha) with conditional rows.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Introduce unified rich token message rendering with fixed row order
and conditional visibility based on available sources.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove alpha-first early return and build one rich message from all
available sources (spot/future/alpha) with conditional rows.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
[Medium] Basis row formatting does not match the spec in internal/services/tele/view/price.go:105.
The percent part is fine, but the absolute delta is rendered with "$%+s" on top of RenderPrice(delta), so positive values do not show the expected + sign and negative values can be formatted awkwardly.
Expected style from the spec is along the lines of:
🧭 Basis: +$0.6 (+0.33%)
🧭 Basis: -$0.6 (-0.33%)
A safer rendering approach is to format the sign separately and reuse the existing price formatter on abs(delta).
env GOCACHE=/tmp/go-build-pr17 go test ./internal/services/tele/view -run RichTokenMessage -v
env GOCACHE=/tmp/go-build-pr17 go test ./internal/services/tele/commands -run BuildRichTokenMessageInput -v
env GOCACHE=/tmp/go-build-pr17 go test ./...
env GOCACHE=/tmp/go-build-pr17 go vet ./...
Non-blocking scope note:
I am treating the spot-only reachability concern as follow-up logic work for a separate issue, not part of this display-focused review.
As Reviewer, here is the result for PR #17.
FAIL
1. [Medium] Basis row formatting does not match the spec in `internal/services/tele/view/price.go:105`.
The percent part is fine, but the absolute delta is rendered with `"$%+s"` on top of `RenderPrice(delta)`, so positive values do not show the expected `+` sign and negative values can be formatted awkwardly.
Expected style from the spec is along the lines of:
- `🧭 Basis: +$0.6 (+0.33%)`
- `🧭 Basis: -$0.6 (-0.33%)`
A safer rendering approach is to format the sign separately and reuse the existing price formatter on `abs(delta)`.
Validation:
- `git fetch origin`
- `git worktree add ../.worktree/pr-17 origin/feat/token-message-rich`
- `env GOCACHE=/tmp/go-build-pr17 go test ./internal/services/tele/view -run RichTokenMessage -v`
- `env GOCACHE=/tmp/go-build-pr17 go test ./internal/services/tele/commands -run BuildRichTokenMessageInput -v`
- `env GOCACHE=/tmp/go-build-pr17 go test ./...`
- `env GOCACHE=/tmp/go-build-pr17 go vet ./...`
Non-blocking scope note:
- I am treating the spot-only reachability concern as follow-up logic work for a separate issue, not part of this display-focused review.
Format basis row as +/-$abs(delta) to match the spec and avoid
awkward %+s formatting behavior.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Fixed in 95e9217. Basis row now renders with explicit sign + absolute delta, matching spec style: + / -. Also added negative-basis coverage in view tests. Re-ran validation: go test ./internal/services/tele/view -run RichTokenMessage -v, go test ./internal/services/tele/commands -run BuildRichTokenMessageInput -v, go test ./..., go vet ./... (all pass).
Fixed in 95e9217. Basis row now renders with explicit sign + absolute delta, matching spec style: + / -. Also added negative-basis coverage in view tests. Re-ran validation: go test ./internal/services/tele/view -run RichTokenMessage -v, go test ./internal/services/tele/commands -run BuildRichTokenMessageInput -v, go test ./..., go vet ./... (all pass).
thuanle
merged commit c841ca4421 into main2026-04-26 17:41:18 +07:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Test Plan
As Reviewer, here is the result for PR #17.
FAIL
internal/services/tele/view/price.go:105.The percent part is fine, but the absolute delta is rendered with
"$%+s"on top ofRenderPrice(delta), so positive values do not show the expected+sign and negative values can be formatted awkwardly.Expected style from the spec is along the lines of:
🧭 Basis: +$0.6 (+0.33%)🧭 Basis: -$0.6 (-0.33%)A safer rendering approach is to format the sign separately and reuse the existing price formatter on
abs(delta).Validation:
git fetch origingit worktree add ../.worktree/pr-17 origin/feat/token-message-richenv GOCACHE=/tmp/go-build-pr17 go test ./internal/services/tele/view -run RichTokenMessage -venv GOCACHE=/tmp/go-build-pr17 go test ./internal/services/tele/commands -run BuildRichTokenMessageInput -venv GOCACHE=/tmp/go-build-pr17 go test ./...env GOCACHE=/tmp/go-build-pr17 go vet ./...Non-blocking scope note:
Fixed in
95e9217. Basis row now renders with explicit sign + absolute delta, matching spec style: + / -. Also added negative-basis coverage in view tests. Re-ran validation: go test ./internal/services/tele/view -run RichTokenMessage -v, go test ./internal/services/tele/commands -run BuildRichTokenMessageInput -v, go test ./..., go vet ./... (all pass).