Skip to content

bugfix/ui-output-formatting#29

Merged
wcollins merged 3 commits intotorerodev:mainfrom
wcollins:bugfix/ui-output-formatting
Sep 15, 2025
Merged

bugfix/ui-output-formatting#29
wcollins merged 3 commits intotorerodev:mainfrom
wcollins:bugfix/ui-output-formatting

Conversation

@wcollins
Copy link
Contributor

✨ Fix: UI output formatting for OpenTofu executions

📒 Summary

Fixed JSON output formatting issue in the torero UI where OpenTofu execution results were displayed as raw JSON instead of properly formatted console output. The issue was caused by nested JSON structure where execution data contained a stringified JSON object with the actual stdout/stderr content.

🔧 Changes

  • Modified showExecutionDetails() to parse nested JSON in execution_data when it's a string
  • Updated generateExecutionDetailHTML() to detect and handle nested JSON structure in execution_data.stdout
  • Enhanced formatConsoleOutput() to properly parse and format execution output with timing information
  • Improved formatTimingInfo() to display execution details in a clean format matching CLI output
  • Added logic to auto-detect OpenTofu executions and apply appropriate formatting
  • Implemented cache-busting for JavaScript file to ensure updates are loaded
  • Cleaned up code style to match project conventions (lowercase comments, minimal debug logging)

🧪 Testing

  • Tested with OpenTofu plan executions displaying nested JSON output
  • Verified proper formatting of stdout with ANSI color code conversion
  • Confirmed execution timing details display correctly
  • Tested cache clearing and browser refresh to ensure changes take effect
  • Validated that CLI and UI output now match in formatting quality

@wcollins wcollins added the bug Something isn't working label Sep 15, 2025
@wcollins wcollins merged commit f5d2fc4 into torerodev:main Sep 15, 2025
3 checks passed
@wcollins wcollins deleted the bugfix/ui-output-formatting branch September 15, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant