Personal Telegram developer console for GitHub
fix: show multi-file Ready summary (#60)
davoodmehraban89 committed
Oct 7, 2026 at 21:41 UTC
e354ff4c09f29f4e7db2878ab17205805261f87b
2 files changed
+10
-1
src/plugins/github/workspace.js
+1
-1
@@ -364,7 +364,7 @@ export function createWorkspaceController({ github, workspaces, editorUrl = DEFA
364
});
365
if (!intent?.id || !/^[A-Za-z0-9_-]{8}$/.test(intent.id)) throw new Error('Commit intent ID is invalid');
366
return {
367
- text: `✅ <b>آمادهٔ تأیید Commit</b>\nفایل: <code>${escapeHtml(workspace.path)}</code>\nBranch: <code>${escapeHtml(targetBranch)}</code>\nBase: <code>${escapeHtml(String(workspace.baseHeadSha).slice(0, 10))}</code>\n\nمرحلهٔ بعد فقط درخواست تأیید امن را میسازد؛ تا تأیید معتبر مصرف نشود GitHub WRITE اجرا نمیشود.`,
367
+ text: `✅ <b>آمادهٔ تأیید Commit</b>\n${workspaceFiles ? `Change Set: <b>${changedFiles.length} فایل تغییرکرده</b>\n${changedFiles.map(file => `• <code>${escapeHtml(file.path)}</code>`).join('\n')}` : `فایل: <code>${escapeHtml(workspace.path)}</code>`}\nBranch: <code>${escapeHtml(targetBranch)}</code>\nBase: <code>${escapeHtml(String(workspace.baseHeadSha).slice(0, 10))}</code>\n\nمرحلهٔ بعد فقط درخواست تأیید امن را میسازد؛ تا تأیید معتبر مصرف نشود GitHub WRITE اجرا نمیشود.`,
368
reply_markup: {
369
inline_keyboard: [
370
[{ text: '✅ تأیید و Commit', callback_data: `wscommit:${workspace.repoId}:${intent.id}` }],
test/phase2-controller.test.js
+9
@@ -63,3 +63,12 @@ test('multi-file workspace exposes a direct editor button for every file', async
63
assert.equal(editors[1].web_app.url,'https://example.com/workspace/editor?workspaceId=W000000001&path=src%2Fa.js');
64
assert.match(editors[1].text,/src\/a\.js/);
65
});
66
+
67
+test('ready view lists every changed file in the sealed change set', async()=>{
68
+ const workspaces={async getWorkspace(){return structuredClone(ws)},async sealIntent({intent}){return {id:'INTENT01',...intent}}};
69
+ const c=createWorkspaceController({github:{},workspaces});
70
+ const v=await c.resolveCallback('wready:W000000001',{ownerId:'42'}).execute();
71
+ assert.match(v.text,/README\.md/);
72
+ assert.match(v.text,/src\/a\.js/);
73
+ assert.match(v.text,/2/);
74
+});