Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/game-controller.tsx
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Type error in this file. Type error: Parameter 'card' implicitly has an 'any' type.

Please fix so that the vercel build succeeds.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed the TypeScript error by adding the Initiative type import and properly typing the card parameter in the map function. Also updated to use the existing isGrowthInitiative() helper function for better consistency. The Vercel build should now succeed. (commit 8403ba1)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Names of forecasted cards should be "growth" and "hostile" not "visionary" and "insider".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated the forecast display to show "growth" and "hostile" card types instead of "Visionary" and "Insider" faction names. The forecast action now properly displays the card types themselves for better clarity. (commit b24a1db)

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useState, useEffect, useMemo, useCallback, useRef } from "react";
import { GameState, Phase, Vote, isGrowthInitiative } from "@/lib/types";
import { GameState, Phase, Vote, Initiative, isGrowthInitiative } from "@/lib/types";
import { RoleAssignment } from "./role-assignment";
import { COOActionPanel } from "./coo-action-panel";
import { RulesModal } from "./rules-modal";
Expand Down Expand Up @@ -289,7 +289,10 @@ export function GameController({
message += `\n\n${result.target_name} is a ${result.actual_faction}`;
}
if (result.next_cards) {
message += `\n\nNext 3 cards: ${result.next_cards.join(", ")}`;
const cardTypes = result.next_cards.map((card: Initiative) =>
isGrowthInitiative(card) ? 'growth' : 'hostile'
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

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

The card type mapping doesn't match the description. According to the PR description, growth initiatives should map to 'Visionary' and hostile initiatives should map to 'Insider', but the code maps them to 'growth' and 'hostile'.

Suggested change
isGrowthInitiative(card) ? 'growth' : 'hostile'
isGrowthInitiative(card) ? 'Visionary' : 'Insider'

Copilot uses AI. Check for mistakes.
);
message += `\n\nNext 3 cards: ${cardTypes.join(", ")}`;
}
if (result.fired_role) {
message += `\n\nFired player was: ${result.fired_role}`;
Expand Down
Loading