openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Add gameplay review workflows for streamers

Open Ayush-Raj-Chourasia opened this issue 6 months ago • 2 comments

Summary

Adds a gameplay-review workflow in the core and Intelligence tab so streamers can import keyframe folders, generate recaps/highlights, ask follow-up questions, and draft clip metadata.

Validation

  • git diff --check
  • Editor diagnostics passed on the touched Rust and TypeScript files
  • Local push succeeded to Ayush-Raj-Chourasia/openhuman
  • Focused Vitest and Rust cargo validation were blocked in the container earlier because the toolchain was missing, but the branch is now published

Notes

The feature is implemented as a new gameplay-review domain backed by workspace persistence, with the UI using local keyframe import plus RPC analysis.

Summary by CodeRabbit

  • New Features

    • Gameplay tab in Intelligence with end-to-end session review: import keyframes, analyze sessions, view recap and highlights, ask questions, and draft platform metadata.
    • Save/load coaching presets and manage session history with refresh.
  • Backend / Platform

    • Server-backed gameplay review APIs, analysis pipeline, and filesystem session/preset storage.
    • New capability flags exposing gameplay review features (beta, local privacy).
  • Tests

    • Added integration-style tests for the gameplay review UI and flows.

Review Change Stack

Ayush-Raj-Chourasia avatar May 13 '26 19:05 Ayush-Raj-Chourasia

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc7b4ded-ad4d-4597-8da5-717aca7e0b8e

📥 Commits

Reviewing files that changed from the base of the PR and between eaf3addadebbd98a1425fdf94e6dd1573a1f121f and 7194eb0a0df9dc8106e721140638af3f71c7a25c.

📒 Files selected for processing (5)
  • app/src/components/intelligence/GameplayReviewWorkspace.tsx
  • src/openhuman/gameplay_review/ops.rs
  • src/openhuman/gameplay_review/schemas.rs
  • src/openhuman/gameplay_review/store.rs
  • src/openhuman/mod.rs
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/openhuman/mod.rs
  • src/openhuman/gameplay_review/schemas.rs
  • src/openhuman/gameplay_review/store.rs
  • app/src/components/intelligence/GameplayReviewWorkspace.tsx
  • src/openhuman/gameplay_review/ops.rs

📝 Walkthrough

Walkthrough

Adds a full gameplay review system: Rust backend RPCs, schemas, and storage; a TypeScript service layer; a React workspace UI for importing/analyzing frames, Q&A, and drafting clip metadata; Intelligence page integration; and component tests.

Changes

Gameplay Review Feature

Layer / File(s) Summary
Rust data types and module setup
src/openhuman/gameplay_review/types.rs, src/openhuman/gameplay_review/mod.rs
Defines SpoilerMode, HighlightKind, and request/response structs for frames, sessions, presets, analysis, highlights, clips, drafts, and question results; wires gameplay_review module and re-exports.
Backend RPC operations and analysis pipeline
src/openhuman/gameplay_review/ops.rs
Async RPC handlers for register/analyze/get/list sessions, set/list presets, ask_session, and draft_clip_metadata; analysis iterates frames, calls engine per frame with fallback summaries, classifies highlights, builds recap/clip candidates/platform drafts/tags, and includes unit tests.
Controller schemas, RPC dispatch & capability catalog
src/openhuman/gameplay_review/schemas.rs, src/core/all.rs, src/openhuman/about_app/catalog.rs
Controller schema definitions and async wrappers that deserialize JSON, call RPC ops, serialize outputs; registers controllers/schemas into core and adds five screen_intelligence.* capability entries.
Persistent storage for sessions & presets
src/openhuman/gameplay_review/store.rs
Filesystem-backed storage under gameplay_review/{sessions,presets} with atomic session writes, load/list helpers tolerant of missing dirs/files, slugify for presets, and workspace path derivation.
Frontend service layer
app/src/services/gameplayReviewService.ts
TypeScript types mirroring Rust, prepareGameplayFrames (image→base64, ordering, optional timestamps), RPC wrappers (register/analyze/list, presets, ask, draft), flattening helpers, formatting, and error normalization/logging.
React component: GameplayReviewWorkspace
app/src/components/intelligence/GameplayReviewWorkspace.tsx
Form state and validation, folder frame selection, import-and-analyze orchestration, ask-session Q&A, refresh/draft clip metadata flow, active session viewer (recap, highlights, clip candidates, platform drafts), error panel, busy flags, and optional toast callback prop.
Page integration
app/src/pages/Intelligence.tsx
Adds Gameplay tab, imports GameplayReviewWorkspace, extends IntelligenceTab, and conditionally renders the component with onToast={addToast}.
Component tests
app/src/components/intelligence/GameplayReviewWorkspace.test.tsx
Vitest/React Testing Library test mocking gameplayReviewService functions, simulating file selection, import/analyze, and ask-session flows, asserting rendered recap, highlight, and answer UI.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • tinyhumansai/openhuman#1674 — This PR implements the gameplay review system described in the issue (backend RPCs, storage, frontend service, UI, and tests).

Possibly related PRs

Suggested reviewers

  • senamakel

Poem

🐰 Frames hop in, highlights bloom bright,

Questions bounce back in the soft moonlight.
Sessions tucked on disk, drafts take flight,
Spoilers kept gentle, coaching in sight.
A rabbit cheers the full-stack delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.72% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add gameplay review workflows for streamers' directly and concisely summarizes the main change: introducing a new gameplay review feature targeting streamer workflows, as evidenced by the new GameplayReviewWorkspace component, supporting services, and RPC handlers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.

[!TIP]

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar May 13 '26 19:05 coderabbitai[bot]

@Ayush-Raj-Chourasia CI is failing on changes in this PR — please fix before review.

graycyrus avatar May 15 '26 10:05 graycyrus

Hi @Ayush-Raj-Chourasia — thanks for this contribution!

I've opened #2856 which supersedes this PR. It contains your work, rebased onto current main (resolved 2 merge conflicts), with a compilation-error fix and the CodeRabbit feedback applied. Authorship credit preserved via Co-authored-by.

I couldn't push the rebase / fixes onto this branch directly because Allow edits by maintainers was off on this PR. Closing this in favor of #2856 to keep momentum on issue #1674 — but feel free to push back if you'd like to drive the merge yourself instead.

sanil-23 avatar May 28 '26 15:05 sanil-23