Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.

Add dark mode, UI improvements, and Select File button to CCP Log Parser - #109

Open
aws-kwyee wants to merge 2 commits into
amazon-connect:masterfrom
aws-kwyee:feature/dark-mode-ui
Open

Add dark mode, UI improvements, and Select File button to CCP Log Parser#109
aws-kwyee wants to merge 2 commits into
amazon-connect:masterfrom
aws-kwyee:feature/dark-mode-ui

Conversation

@aws-kwyee

Copy link
Copy Markdown

Summary

Adds dark mode support, UI layout improvements, and a Select File button to the CCP Log Parser tool.

Changes

Dark mode (ThemeContext.jsx, all view components)

  • New ThemeContext provider with light/dark theme definitions
  • Theme toggle button in the AppBar
  • All view components (DraggingView, EmptyView, LoadingView, LogLineView, LogView, SnapshotListView) updated to consume theme context
  • New ThemedMetricsView wrapper for metrics components

UI layout improvements (App.jsx)

  • AppBar changed from static to fixed positioning with proper content offset
  • Containers use full viewport width (maxWidth={false})
  • Scrollable container with calc(100vh - ...) for proper overflow handling

Select File button (EmptyView.jsx, App.jsx)

  • Added a "Select File" button to the drag-and-drop area as an alternative to dragging
  • Wired to a hidden file input via dropzoneRef

Build fixes

  • Added .eslintrc.js configuration
  • Fixed ESLint errors across components
  • Updated version to 2026.01.07

Files changed

  • .eslintrc.js (new)
  • src/ThemeContext.jsx (new)
  • src/ThemedMetricsView.jsx (new)
  • package.json, package-lock.json
  • src/App.css, src/App.jsx
  • src/DraggingView.jsx, src/EmptyView.jsx, src/LoadingView.jsx
  • src/LogLineView.jsx, src/LogView.jsx, src/MetricsView.jsx, src/SnapshotListView.jsx
  • src/utils/findExtras.js

Testing

Verified locally — dark/light toggle works, layout is responsive, Select File button opens file picker correctly.

- Guard API_REPLY handler against undefined matched[3] before JSON.parse
- Wrap API error-details JSON.parse in try/catch with fallback
- Accept files by .json/.txt extension when MIME type is missing
- Validate file content before JSON.parse; surface clearer error messages
- Handle FileReader onerror
- Skip log events missing a timestamp instead of crashing
- Add dark mode with theme toggle button and ThemeContext provider
- Allow containers to use full viewport width
- Improve UI layout with fixed AppBar and responsive scrollable containers
- Add Select File button to drag-and-drop area
- Update version to 2026.01.07
- Fix ESLint errors and build issues
- Add .eslintrc.js configuration
/>
</div>
{ !isExpanded
? <Button variant="link" className={classes.expand} onClick={() => expand()}><UnfoldMore style={{ transform: 'rotate(90deg)' }} /></Button>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

Using Function.prototype.bind and arrows functions as attributes will negatively impact performance in React. Each time the parent is rendered, the function will be re-created and trigger a render of the component causing excessive renders and more memory use.

isMessageContained={isMessageContained}
cause={cause}
hasMoreInfo={hasMoreInfo}
toggleMoreInfo={() => this.toggleMoreInfo()}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

Using Function.prototype.bind and arrows functions as attributes will negatively impact performance in React. Each time the parent is rendered, the function will be re-created and trigger a render of the component causing excessive renders and more memory use.

</div>
{ !isExpanded
? <Button variant="link" className={classes.expand} onClick={() => expand()}><UnfoldMore style={{ transform: 'rotate(90deg)' }} /></Button>
: <Button variant="link" className={classes.expand} onClick={() => expand()}><UnfoldLess style={{ transform: 'rotate(90deg)' }} /></Button> }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

Using Function.prototype.bind and arrows functions as attributes will negatively impact performance in React. Each time the parent is rendered, the function will be re-created and trigger a render of the component causing excessive renders and more memory use.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants