Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ function App() {

// Parse for chart (existing logic)
if (line.trim().startsWith('#')) {
const names = line.replace(/^\s*#+\s*/, '').split(/[\s,\t]+/).filter(Boolean)
const names = line.replace(/^\(/, '').replace(/\)$/, '').replace(/^\s*#+\s*/, '').split(/[\s,\t]+/).filter(Boolean)
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The parentheses removal logic should be applied after the hash symbol removal, not before. The current order may incorrectly handle cases where parentheses are part of the hash prefix (e.g., '#(data)'). Consider reordering: line.replace(/^\s*#+\s*/, '').replace(/^\(/, '').replace(/\)$/, '')

Suggested change
const names = line.replace(/^\(/, '').replace(/\)$/, '').replace(/^\s*#+\s*/, '').split(/[\s,\t]+/).filter(Boolean)
const names = line.replace(/^\s*#+\s*/, '').replace(/^\(/, '').replace(/\)$/, '').split(/[\s,\t]+/).filter(Boolean)

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The parentheses removal logic is duplicated. Consider extracting this into a helper function to improve maintainability and ensure consistent behavior across both parsing paths.

Copilot uses AI. Check for mistakes.
if (names.length > 0) store.setSeries(names)
return
}
const parts = line.trim().split(/[\s,\t]+/).filter(Boolean)
const parts = line.trim().replace(/^\(/, '').replace(/\)$/, '').split(/[\s,\t]+/).filter(Boolean)
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The parentheses removal logic is duplicated. Consider extracting this into a helper function to improve maintainability and ensure consistent behavior across both parsing paths.

Copilot uses AI. Check for mistakes.
if (parts.length === 0) return
const values: number[] = []
for (const p of parts) {
Expand Down