MCPcopy Index your code
hub / github.com/Fission-AI/OpenSpec / displaySummary

Method displaySummary

src/core/view.ts:164–205  ·  view source on GitHub ↗
(
    changesData: { draft: any[]; active: any[]; completed: any[] },
    specsData: any[]
  )

Source from the content-addressed store, hash-verified

162 }
163
164 private displaySummary(
165 changesData: { draft: any[]; active: any[]; completed: any[] },
166 specsData: any[]
167 ): void {
168 const totalChanges =
169 changesData.draft.length + changesData.active.length + changesData.completed.length;
170 const totalSpecs = specsData.length;
171 const totalRequirements = specsData.reduce((sum, spec) => sum + spec.requirementCount, 0);
172
173 // Calculate total task progress
174 let totalTasks = 0;
175 let completedTasks = 0;
176
177 changesData.active.forEach((change) => {
178 totalTasks += change.progress.total;
179 completedTasks += change.progress.completed;
180 });
181
182 changesData.completed.forEach(() => {
183 // Completed changes count as 100% done (we don't know exact task count)
184 // This is a simplification
185 });
186
187 console.log(chalk.bold('Summary:'));
188 console.log(
189 ` ${chalk.cyan('●')} Specifications: ${chalk.bold(totalSpecs)} specs, ${chalk.bold(totalRequirements)} requirements`
190 );
191 if (changesData.draft.length > 0) {
192 console.log(` ${chalk.gray('●')} Draft Changes: ${chalk.bold(changesData.draft.length)}`);
193 }
194 console.log(
195 ` ${chalk.yellow('●')} Active Changes: ${chalk.bold(changesData.active.length)} in progress`
196 );
197 console.log(` ${chalk.green('●')} Completed Changes: ${chalk.bold(changesData.completed.length)}`);
198
199 if (totalTasks > 0) {
200 const overallProgress = Math.round((completedTasks / totalTasks) * 100);
201 console.log(
202 ` ${chalk.magenta('●')} Task Progress: ${chalk.bold(`${completedTasks}/${totalTasks}`)} (${overallProgress}% complete)`
203 );
204 }
205 }
206
207 private createProgressBar(completed: number, total: number, width: number = 20): string {
208 if (total === 0) return chalk.dim('─'.repeat(width));

Callers 1

executeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected