Skip to content

Conversation

@KCoderVA
Copy link
Owner

This pull request introduces significant improvements and refactoring to the Generate-ProductivityReport.ps1 script, focusing on enhancing the HTML report output, improving user interaction, and updating the summary and configuration display. The changes include a redesigned report layout with a new activity trend chart, more flexible user prompts, and improved KPI presentation. Some code was also cleaned up and reorganized for clarity.

Report Output & Layout Enhancements

  • Redesigned the HTML report output with a new layout, updating CSS for better readability, introducing a responsive .container, .chart-card, and improved KPI cards. Added a canvas-based activity trend chart (commits per period) with dynamic resizing and period grouping (daily/weekly/monthly) for visualizing commit activity. (copilot-instructions/Generate-ProductivityReport.ps1, [1] [2] [3] [4] [5]
  • Improved the KPI summary section to display commit counts, lines added/removed/modified, files changed, and estimated work hours in a more visually appealing format. (copilot-instructions/Generate-ProductivityReport.ps1, copilot-instructions/Generate-ProductivityReport.ps1R1471-R1552)

User Interaction Improvements

  • Updated interactive prompts for report type and output format to accept both numeric and named choices, enhancing usability and clarity for users. (copilot-instructions/Generate-ProductivityReport.ps1, [1] [2]
  • Enhanced the intro and help text to clarify the tool's purpose, expected results, and usage notes, making it more accessible for new users. (copilot-instructions/Generate-ProductivityReport.ps1, [1] [2]

Configuration & Summary Display

  • Improved the configuration summary to optionally display the selected Git repository path and other report options, providing clearer feedback on user selections. (copilot-instructions/Generate-ProductivityReport.ps1, [1] [2]

Code Cleanup

Overall, these changes make the productivity report more informative, visually engaging, and user-friendly.

KCoderVA and others added 7 commits August 29, 2025 00:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
feat: Collapsible Workspace Guidance + docs sync + validator JSON guidance generation
Enhance license header script and update README
Resolved merge conflicts and integrated changes in Generate-ProductivityReport.ps1, improving interactive prompts, report generation, and output formatting. Added a new, more detailed New-RowObject implementation to Recursive-Directory-Analysis.ps1, supporting enhanced CSV export with Excel hyperlink formulas and reordered columns for better usability.
Resolved merge conflicts and integrated changes in Generate-ProductivityReport.ps1, improving interactive prompts, report generation, and output formatting. Added a new, more detailed New-RowObject implementation to Recursive-Directory-Analysis.ps1, supporting enhanced CSV export with Excel hyperlink formulas and reordered columns for better usability.
@KCoderVA KCoderVA requested a review from Copilot August 29, 2025 06:35
@KCoderVA KCoderVA self-assigned this Aug 29, 2025
@KCoderVA KCoderVA merged commit 536d768 into feature/collapsible-guidance Aug 29, 2025
3 checks passed
KCoderVA added a commit that referenced this pull request Aug 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces significant improvements and refactoring to the Generate-ProductivityReport.ps1 script, focusing on enhancing the HTML report output, improving user interaction, and updating the summary and configuration display. The changes include a redesigned report layout with a new activity trend chart, more flexible user prompts, and improved KPI presentation.

  • Redesigned HTML report output with new CSS layout, responsive components, and a canvas-based activity trend chart with dynamic period grouping
  • Enhanced user interaction prompts to accept both numeric and named choices for better usability
  • Improved configuration summary display and updated intro text for better clarity

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
copilot-instructions/tasks.json Removed trailing space from command line arguments
copilot-instructions/Validate-WorkspaceSetup.ps1 Updated condition to trigger guidance generator for both errors and warnings
copilot-instructions/Recursive-Directory-Analysis.ps1 Added commented-out duplicate function definition
copilot-instructions/Generate-ProductivityReport.ps1 Major refactoring with new HTML layout, enhanced user prompts, improved chart functionality, and git merge conflict markers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +463 to +528
<#
---------------------------------------------------------------------
function New-RowObject {
param(
[string]$ItemType,
[System.IO.FileSystemInfo]$Item,
[Nullable[int64]]$SizeBytes,
[string]$Author,
[Nullable[int]]$Lines,
[Nullable[int64]]$Chars)
$ext = if (-not $Item.PSIsContainer) { ($Item.Extension.ToLowerInvariant()); } else { $null }
$attrs = Get-ItemAttributesBooleans -Item $Item
$created = try { $Item.CreationTime.ToString("yyyy-MM-ddTHH:mm:ss.fffK") } catch { '' }
$modified = try { $Item.LastWriteTime.ToString("yyyy-MM-ddTHH:mm:ss.fffK") } catch { '' }
$name = try { $Item.Name } catch { [System.IO.Path]::GetFileName($Item.FullName) }
$full = try { $Item.FullName } catch { $null }
$extVal = if ($ext) { $ext } else { '' }
$sizeVal = if ($null -ne $SizeBytes) { [string]$SizeBytes } else { '' }
$linesVal = if ($null -ne $Lines) { [string]$Lines } else { '' }
$charsVal = if ($null -ne $Chars) { [string]$Chars } else { '' }
# Build Excel HYPERLINK formula for the FullPath column
# Requirement: clicking opens the containing folder/location, not the item itself.
$fullForLink = if ($full) { $full } else { '' }
$containingFolder = try {
if ($Item.PSIsContainer) {
if ($Item.Parent) { $Item.Parent.FullName } else { $Item.FullName }
} else {
$Item.DirectoryName
}
} catch { $fullForLink }
if ([string]::IsNullOrWhiteSpace($containingFolder)) { $containingFolder = $fullForLink }
# Escape double quotes for CSV/formula safety (Excel uses doubled quotes inside formulas)
$dispText = $fullForLink -replace '"','""'
$targetPath = $containingFolder -replace '"','""'
$fullHyperlink = if ([string]::IsNullOrEmpty($fullForLink)) { '' } else { [string]::Format('=HYPERLINK("{0}","{1}")', $targetPath, $dispText) }
# Reordered columns:
# Far left: CreatedTime, LastModifiedTime, Author, IsReparsePoint, IsHidden, IsReadOnly, IsSystem, IsArchive
# Then FullPath (as hyperlink), Name, and remaining columns
$obj = [ordered]@{
CreatedTime = $created
LastModifiedTime = $modified
Author = $Author
IsReparsePoint = [string](Test-ReparsePoint -Item $Item)
IsHidden = [string]$($attrs.IsHidden)
IsReadOnly = [string]$($attrs.IsReadOnly)
IsSystem = [string]$($attrs.IsSystem)
IsArchive = [string]$($attrs.IsArchive)
FullPath = $fullHyperlink
Name = $name
ItemType = $ItemType
Extension = $extVal
SizeBytes = $sizeVal
LinesOfText = $linesVal
CharacterCount = $charsVal
}
return [PSCustomObject]$obj
}
----------------------------------------------------------------------
#>
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

There is a large block of commented-out code that appears to be a duplicate of the existing New-RowObject function. This duplicated code should be removed to improve maintainability and avoid confusion.

Copilot uses AI. Check for mistakes.

Comment on lines +214 to +225
<<<<<<< Updated upstream
<<<<<<< Updated upstream
# Conditional console writer (suppressed when -Quiet)
function Write-Info {
param([string]$Text, [ConsoleColor]$Color = [ConsoleColor]::Gray)
if (-not $Quiet) { Write-Host $Text -ForegroundColor $Color }
}

=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

Git merge conflict markers are present in the code. These need to be resolved before merging.

Suggested change
<<<<<<< Updated upstream
<<<<<<< Updated upstream
# Conditional console writer (suppressed when -Quiet)
function Write-Info {
param([string]$Text, [ConsoleColor]$Color = [ConsoleColor]::Gray)
if (-not $Quiet) { Write-Host $Text -ForegroundColor $Color }
}
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
# Conditional console writer (suppressed when -Quiet)
function Write-Info {
param([string]$Text, [ConsoleColor]$Color = [ConsoleColor]::Gray)
if (-not $Quiet) { Write-Host $Text -ForegroundColor $Color }
}

Copilot uses AI. Check for mistakes.

Comment on lines +261 to 265
<<<<<<< Updated upstream
<<<<<<< Updated upstream
Write-Host ""
Write-Host "What this tool does:" -ForegroundColor Cyan
Write-Host " Creates a decision-ready snapshot of development activity in this workspace for a selected period." -ForegroundColor Gray
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

Git merge conflict markers are present in the code. These need to be resolved before merging.

Copilot uses AI. Check for mistakes.

Comment on lines +305 to +318
=======
=======
>>>>>>> Stashed changes
Write-Host ""; Write-Host "About this tool" -ForegroundColor Cyan
Write-Host "Purpose: Generate a concise productivity snapshot for a chosen time period." -ForegroundColor Gray
Write-Host "Scope: Analyzes Git activity in this workspace and parses productivity logs (if present)." -ForegroundColor Gray
Write-Host "Intended use: Management/status reporting and personal tracking—not precise timekeeping." -ForegroundColor Gray
Write-Host "Expected results: A report file (Markdown/HTML/JSON/CSV) with commit counts, code deltas, and an effort estimate." -ForegroundColor Gray
Write-Host "Notes: The report is a snapshot of the selected period (Daily/Weekly/Monthly/All time/Custom)." -ForegroundColor Gray
Write-Host " Use Custom for exact start/end dates. Opening the report is optional and can be automated." -ForegroundColor Gray
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

Git merge conflict markers are present in the code. These need to be resolved before merging.

Copilot uses AI. Check for mistakes.

Comment on lines +2561 to +2572
Write-Progress -Id $progressId -Activity "Productivity Report" -Status "Analyzing workspace activity..." -PercentComplete 35

# Select output format (interactive if not provided)
if (-not $PSBoundParameters.ContainsKey('OutputFormat')) {
$OutputFormat = Get-OutputFormatInteractive
}
Write-Host "Output Format: $OutputFormat" -ForegroundColor Yellow

Show-ConfigSummary -ReportType $ReportType -StartDate $StartDate -EndDate $EndDate -OutputFormat $OutputFormat -OpenAfterGeneration:$OpenAfterGeneration -IncludeDetailed:$IncludeDetailed

Write-Progress -Id $progressId -Activity "Productivity Report" -Status "Analyzing workspace activity..." -PercentComplete 35

Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

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

There is duplicated code block that selects output format, shows configuration summary, and writes progress. This duplication should be removed to avoid redundant execution.

Suggested change
Write-Progress -Id $progressId -Activity "Productivity Report" -Status "Analyzing workspace activity..." -PercentComplete 35
# Select output format (interactive if not provided)
if (-not $PSBoundParameters.ContainsKey('OutputFormat')) {
$OutputFormat = Get-OutputFormatInteractive
}
Write-Host "Output Format: $OutputFormat" -ForegroundColor Yellow
Show-ConfigSummary -ReportType $ReportType -StartDate $StartDate -EndDate $EndDate -OutputFormat $OutputFormat -OpenAfterGeneration:$OpenAfterGeneration -IncludeDetailed:$IncludeDetailed
Write-Progress -Id $progressId -Activity "Productivity Report" -Status "Analyzing workspace activity..." -PercentComplete 35

Copilot uses AI. Check for mistakes.

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.

1 participant