Review: LIVE badge + pause button

review-1778-2026-07-04 Review

review ready

Verdict: READY

Template Completeness

  • [x] Type -- Feature
  • [x] Lineage -- Sub-ticket of #90, split 2 of 2
  • [x] Repo -- ldraney/prediction-assistant
  • [x] User Story -- As a user with active trading bots...
  • [x] Context -- explains LIVE badge vs active distinction, dependency chain
  • [x] File Targets -- 5 modify targets, 3 exclusions
  • [x] Feature Flag -- none (correct, this repo has no feature flag infra)
  • [x] Acceptance Criteria -- 4 criteria
  • [x] Test Expectations -- 5 test cases + run command
  • [x] Constraints -- Hotwire patterns, CSS consistency, field naming
  • [x] Checklist -- present
  • [x] Related -- lists parent #85, parent sub #90, deps #88/#89

Traceability

  • [x] story:portfolio-builder label -- AI Portfolio Builder
  • [x] story note verified -- found in project-prediction-assistant user-stories section (key: portfolio-builder, role: Trader (Lucas))
  • [x] arch:rails label -- Rails component
  • [ ] arch note MISSING -- [SCOPE] Create architecture note arch-rails for component rails (note: arch:rails is used across 20+ board items; this is a cross-cutting gap, not specific to this ticket)
  • [x] Forgejo issue -- #95, open

File Targets

  • [x] app/views/bots/_bot_card.html.erb -- verified: exists, 41 lines, already has bot.active? conditional and status indicator patterns. Agent will add LIVE badge alongside existing status group.
  • [x] app/views/bots/show.html.erb -- verified: exists, ~800+ lines, already has status-badge--live CSS class and @bot.active? conditionals. Contains existing badge styling infrastructure the agent can extend.
  • [x] app/controllers/bots_controller.rb -- verified: exists, already has toggle action. Agent adds pause action alongside it.
  • [x] config/routes.rb -- verified: exists, no existing pause route. Agent adds route for pause action.
  • [x] test/controllers/bots_controller_test.rb -- verified: exists. Agent adds pause tests.
  • [x] app/services/order_service.rb (do-not-touch) -- verified: exists with dry_run enforcement, correctly excluded.
  • [x] app/models/strategy.rb (do-not-touch) -- verified: exists, correctly excluded. Note: trading_enabled field does NOT yet exist in schema -- depends on #88 migration.
  • [x] app/views/bots/_activation_panel.html.erb (do-not-touch) -- confirmed does not exist yet (handled in split 1, #94).

Repo Placement

OK -- issue filed on ldraney/prediction-assistant, all file targets are in prediction-assistant. Single-repo scope.

Dependencies

  • #88 (Trading fields migration + Strategy model validations) -- board item #1764, backlog. Adds trading_enabled field to Strategy. CRITICAL: this ticket cannot be started until #88 is merged. The trading_enabled? method referenced throughout the AC does not yet exist in the codebase.
  • #89 (OrderService dry_run enforcement + budget guardrails) -- board item #1765, backlog. Adds enforcement layer. Required for the pause semantics to have meaning.
  • #94 (Activation panel + controller toggle action, split 1) -- board item #1777, backlog. Sibling split; provides the activate action this ticket's pause button complements.
  • All dependencies are documented in the issue body. All are in backlog -- ordering is correct (this ticket should be scheduled after its dependencies).

Acceptance Criteria

4 criteria, all testable by an agent:
  • LIVE badge on bot card -- verifiable via rendered HTML assertion
  • LIVE badge on detail page -- verifiable via rendered HTML assertion
  • Pause button visibility -- verifiable via conditional rendering test
  • Pause action behavior -- verifiable via controller test (trading_enabled: false, active: true)
Test commands are real: bin/rails test test/controllers/bots_controller_test.rb. Coverage is adequate.

Blast Radius

Naming collision awareness needed: The existing show.html.erb already uses status-badge--live CSS class tied to @bot.active?, and BotPresenter#status_label already returns "Live" when active? is true. The new "LIVE" badge will be a separate concept tied to trading_enabled?. The ticket context explains this distinction (active = monitoring, trading_enabled = actual trading), but the implementing agent must take care not to conflate the two. No action needed -- the constraint is implicit in the design and the ticket context is clear enough.
No sibling services affected. All changes are UI/controller-level in a single app.

Decomposition Assessment

5 file targets across 1 repo. 4 acceptance criteria. Estimated agent work: under 5 minutes (badge partial, controller action, route, tests). No decomposition needed.

Recommendation

  • [SCOPE] Create architecture note arch-rails for the Rails component. This is a cross-cutting gap affecting 20+ board items, not specific to this ticket. Does not block this ticket.
No other action needed. Scope is solid.