Skip to content

Commit 344dbf9

Browse files
committed
poker(room): fix accordion button missing in playing state; add Show Details/Show Summary to acting and waiting rows
1 parent 632ab7c commit 344dbf9

2 files changed

Lines changed: 28 additions & 8 deletions

File tree

src/actions/games/poker/room/services/roomService.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,11 @@ export async function broadcastRoomInfo(
245245
const isAdminActing = actingUuid && adminId === actingUuid;
246246
const adminInfo = seatInfoByUser[adminId];
247247
const adminCanCheck = typeof adminInfo?.bet === 'number' ? adminInfo.bet >= currentBetGlobal : false;
248-
const actingRows: Btn[][] = (
249-
adminCanCheck
248+
const showDetailsText = gctx.t('poker.room.buttons.showDetails') || '📋 Show Details';
249+
const showSummaryText = gctx.t('poker.room.buttons.showSummary') || '📝 Show Summary';
250+
251+
const actingRows: Btn[][] = [
252+
...(adminCanCheck
250253
? [
251254
[{ text: gctx.t('poker.game.buttons.check'), callback_data: 'g.pk.r.ck' }],
252255
[{ text: gctx.t('poker.actions.raise'), callback_data: 'g.pk.r.rs' }],
@@ -257,8 +260,13 @@ export async function broadcastRoomInfo(
257260
[{ text: gctx.t('poker.actions.raise'), callback_data: 'g.pk.r.rs' }],
258261
[{ text: gctx.t('poker.game.buttons.fold'), callback_data: 'g.pk.r.fd' }]
259262
]
260-
);
261-
const waitingRows: Btn[][] = [[{ text: gctx.t('bot.buttons.refresh'), callback_data: 'g.pk.r.in' }]];
263+
),
264+
[{ text: isDetailed ? showSummaryText : showDetailsText, callback_data: `g.pk.r.in?detailed=${!isDetailed}` }]
265+
];
266+
const waitingRows: Btn[][] = [
267+
[{ text: gctx.t('bot.buttons.refresh'), callback_data: 'g.pk.r.in' }],
268+
[{ text: isDetailed ? showSummaryText : showDetailsText, callback_data: `g.pk.r.in?detailed=${!isDetailed}` }]
269+
];
262270
await send(
263271
adminRecipients,
264272
adminExtras?.message ?? view.message,
@@ -286,8 +294,11 @@ export async function broadcastRoomInfo(
286294
const canCheck = typeof userInfo?.stack === 'number' && typeof userInfo?.bet === 'number'
287295
? userInfo.bet >= currentBetGlobal
288296
: false;
289-
const actingRows: Btn[][] = (
290-
canCheck
297+
const showDetailsText = gctx.t('poker.room.buttons.showDetails') || '📋 Show Details';
298+
const showSummaryText = gctx.t('poker.room.buttons.showSummary') || '📝 Show Summary';
299+
300+
const actingRows: Btn[][] = [
301+
...(canCheck
291302
? [
292303
[{ text: gctx.t('poker.game.buttons.check'), callback_data: 'g.pk.r.ck' }],
293304
[{ text: gctx.t('poker.actions.raise'), callback_data: 'g.pk.r.rs' }],
@@ -298,8 +309,13 @@ export async function broadcastRoomInfo(
298309
[{ text: gctx.t('poker.actions.raise'), callback_data: 'g.pk.r.rs' }],
299310
[{ text: gctx.t('poker.game.buttons.fold'), callback_data: 'g.pk.r.fd' }]
300311
]
301-
);
302-
const waitingRows: Btn[][] = [[{ text: gctx.t('bot.buttons.refresh'), callback_data: 'g.pk.r.in' }]];
312+
),
313+
[{ text: isDetailed ? showSummaryText : showDetailsText, callback_data: `g.pk.r.in?detailed=${!isDetailed}` }]
314+
];
315+
const waitingRows: Btn[][] = [
316+
[{ text: gctx.t('bot.buttons.refresh'), callback_data: 'g.pk.r.in' }],
317+
[{ text: isDetailed ? showSummaryText : showDetailsText, callback_data: `g.pk.r.in?detailed=${!isDetailed}` }]
318+
];
303319
await send(
304320
[chatId],
305321
message,

src/actions/games/poker/room/services/views.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ export function buildWaitingView(ctx: BuildContext, isDetailed = false): ViewPay
9090

9191
export function buildPlayingView(ctx: BuildContext, isDetailed = false): ViewPayload {
9292
// Default layout is minimal; actual acting player's layout is computed in roomService based on current bet
93+
const showDetailsText = ctx.t('poker.room.buttons.showDetails') || '📋 Show Details';
94+
const showSummaryText = ctx.t('poker.room.buttons.showSummary') || '📝 Show Summary';
95+
9396
const inGameRows: Btn[][] = [
9497
[{ text: ctx.t('bot.buttons.refresh'), callback_data: 'g.pk.r.in' }],
98+
[{ text: isDetailed ? showSummaryText : showDetailsText, callback_data: `g.pk.r.in?detailed=${!isDetailed}` }],
9599
];
96100
const header = isDetailed
97101
? buildDetailedMessage(ctx, ctx.t('poker.room.status.playing'))

0 commit comments

Comments
 (0)