Skip to content

Multi-instance PGCR uses standard PGCR UI - #319

Merged
owens1127 merged 14 commits into
mainfrom
feat/multi-pgcr-unified-view
Jun 15, 2026
Merged

Multi-instance PGCR uses standard PGCR UI#319
owens1127 merged 14 commits into
mainfrom
feat/multi-pgcr-unified-view

Conversation

@owens1127

Copy link
Copy Markdown
Contributor

Summary

Renders multi-PGCR sessions with the same components as single-instance PGCR (PGCRHeader, PGCRPlayers, player details panel, query params).

Changes

  • Add mergeRaidHubInstances to build a synthetic RaidHubInstanceExtended from multiple instance payloads.
  • MultiLoader now renders the shared PGCR view with merged data; reporting is disabled when the session is merged (no single RaidHub instance id).
  • Session timeline (2+ instances) appears inside the PGCR card via PGCRMultiTimeline.
  • RIIS for merged sessions uses uncapped time (capTPS: false) to match the previous multi combinator.
  • Remove legacy multi combinator / player / weapons list components.

Testing

  • Open a multi-PGCR link with 2+ instances and confirm layout matches single PGCR plus timeline.
  • Confirm player panel, URL params, and share behavior.
  • Confirm Report is hidden for merged multi; visible when the multi contains a single instance.

Made with Cursor

Merge multiple RaidHub instances into one synthetic InstanceExtended so
multi sessions use PGCRHeader, PGCRPlayers, and the player details panel
like single-instance PGCR. Add mergeRaidHubInstances, session timeline for
2+ instances, and hide reporting when the view is merged. Remove the
legacy multi combinator/player/details components.

Made-with: Cursor
@vercel

vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
raid-hub Ready Ready Preview Jun 15, 2026 6:32pm

Request Review

Mark the shared PGCR view as client-rendered so MultiLoader can render it without tripping RSC/Suspense failures, and add a single Playwright suite plus local multi seeding so the multi PGCR path is exercised end to end.

Made-with: Cursor
Run Playwright through bunx in GitHub Actions so the binary resolves correctly, and commit the Prettier output needed for the formatting check. This keeps the seeded multi E2E flow green in CI and locally.

Made-with: Cursor
Point the libsql-backed local Prisma adapter at the same sqlite file that migrations and E2E seeding use so Playwright can resolve pgcr_multi during CI and local runs.

Made-with: Cursor
Commit the local Prisma adapter path change that CI needs for seeded multi E2E, and ignore the empty repo-root sqlite artifact so local runs stay clean.

Made-with: Cursor
Use pathToFileURL for the local sqlite adapter path so libsql initializes correctly on Linux runners while still pointing at the seeded prisma database used by multi E2E.

Made-with: Cursor
Use the seeded prisma SQLite path for local APP_ENV runs because the absolute file URL form breaks libsql on the Linux Playwright runner.

Made-with: Cursor
Ensure the spawned Next.js server runs with APP_ENV=local so E2E uses the seeded SQLite database instead of trying to initialize the remote libsql client in CI.

Made-with: Cursor
Point the local libsql adapter at the seeded prisma database without the leading ./ because the Linux Playwright runner still rejects that native sqlite path shape.

Made-with: Cursor
Avoid the libsql adapter for APP_ENV=local so Playwright uses Prisma's built-in SQLite path handling while production still uses the Turso adapter.

Made-with: Cursor
Return an empty local manifest in APP_ENV=local when RAIDHUB_API_KEY is unavailable so the E2E app shell can render in CI while API-backed production behavior stays unchanged.

Made-with: Cursor
Run Playwright entirely against local fixture-backed PGCR data when CI is missing external RaidHub auth so the seeded single and multi PGCR pages stay testable without live API dependencies.

Made-with: Cursor
@owens1127
owens1127 marked this pull request as ready for review April 23, 2026 03:54
Copilot AI review requested due to automatic review settings April 23, 2026 03:54
Comment on lines +71 to +77
function mergeNullableBool(values: readonly (boolean | null)[]): boolean | null {
if (values.length === 0) return null
if (values.every(v => v === true)) return true
if (values.every(v => v === false)) return false
if (values.every(v => v === null)) return null
return false
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The mergeNullableBool function incorrectly merges mixed true and null values into false, causing incorrect UI states for properties like fresh and flawless.
Severity: MEDIUM

Suggested Fix

Update the mergeNullableBool function to handle mixed values correctly. If an array contains both true and null values, the function should not default to false. It should prioritize true if present, or return null to represent the mixed/unknown state, ensuring the UI can distinguish between a definitive false and an ambiguous null state.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/lib/multi/merge-instances.ts#L71-L77

Potential issue: The `mergeNullableBool` function at
`src/lib/multi/merge-instances.ts:71-77` incorrectly handles merging arrays containing
both `true` and `null` values. It defaults to returning `false` in this scenario. This
affects properties like `fresh` and `flawless`, where `null` represents an "unknown" or
"not applicable" state, while `false` means a definitive "no". For example, merging an
instance with `fresh: true` and another with `fresh: null` results in `false`, causing
the UI to incorrectly display that the activity started from a checkpoint, when the
correct state should be ambiguous or reflect the fresh start.

Did we get this right? 👍 / 👎 to inform future reviews.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the multi-instance PGCR flow to render using the standard single-instance PGCR UI by synthesizing a merged RaidHubInstanceExtended and optionally embedding a per-instance session timeline.

Changes:

  • Added mergeRaidHubInstances to aggregate multiple instance payloads into one synthetic PGCR dataset plus timeline segments.
  • Updated multi PGCR loading to render the shared PGCR view (with reporting disabled for merged sessions) and added PGCRMultiTimeline inside the PGCR card.
  • Removed the legacy multi combinator/player/weapons list components and replaced the old combined-data types with timeline segment types.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/multi/multi-types.ts Replaces legacy combined multi types with MultiInstanceTimelineSegment for the new timeline UI.
src/lib/multi/merge-instances.ts New merge function to synthesize a RaidHubInstanceExtended and timeline from multiple instances.
src/hooks/profile/useRaidTags.ts Reformats an op-item event entry (but retains an invalid date range).
src/hooks/pgcr/ClientStateManager.tsx Adds allowsReporting to PGCR context to support hiding reporting for merged sessions.
src/components/pgcr/pgcr-view.tsx Allows multi rendering via merged data + timeline + RIIS options + reporting toggle.
src/components/pgcr/pgcr-multi-timeline.tsx New/updated timeline component for multi-instance session visualization within PGCR.
src/components/pgcr/pgcr-menu.tsx Hides the Report option when allowsReporting is false.
src/components/pgcr/pgcr-header-bg.tsx Fixes potential crash by guarding variant with optional chaining.
src/components/multi/multi-loader.tsx Loads multiple instances, merges them, and renders shared PGCR view (instead of legacy combinator).
src/components/multi/multi-weapons-list.tsx Removed legacy multi-only weapons list component.
src/components/multi/multi-player.tsx Removed legacy multi-only player component.
src/components/multi/multi-combinator.tsx Removed legacy multi combinator logic/UI.
src/app/multi/[multiId]/page.tsx Passes multiId into MultiLoader for synthetic instance IDs and merge behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

shattershafts: { start: new Date("2026-01-27T17:00:00Z"), end: new Date("2025-02-03T17:00:00Z") },
shattershafts: {
start: new Date("2026-01-27T17:00:00Z"),
end: new Date("2025-02-03T17:00:00Z")
Comment on lines +156 to +161
const merged: RaidHubInstanceExtended = {
...first,
instanceId: `multi:${multiId}`,
completed: sorted.every(i => i.completed),
flawless: mergeNullableBool(sorted.map(i => i.flawless)),
fresh: mergeNullableBool(sorted.map(i => i.fresh)),
Resolve pgcr-header-bg duplicate line and combine allowsReporting
with blacklist menu support from main.

Co-authored-by: Cursor <cursoragent@cursor.com>
@owens1127 owens1127 mentioned this pull request Jun 15, 2026
@owens1127
owens1127 merged commit 25ce31b into main Jun 15, 2026
6 checks passed
@owens1127
owens1127 deleted the feat/multi-pgcr-unified-view branch June 15, 2026 18:40
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.

2 participants