Skip to content

Add line wrapping option - #5

Merged
cyanzhong merged 1 commit into
mainfrom
line-wrapping
Dec 26, 2025
Merged

Add line wrapping option#5
cyanzhong merged 1 commit into
mainfrom
line-wrapping

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

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.

Pull request overview

This PR adds a line wrapping toggle feature for the source code viewer in the macOS app. The feature allows users to enable/disable line wrapping for code display through a menu item in the View menu, with the setting persisted in UserDefaults.

Key changes:

  • Added a toggleable "Line Wrapping" menu item in the View menu with validation based on display mode
  • Implemented line wrapping control through JavaScript by dynamically setting the whiteSpace CSS property
  • Added preference storage for the line wrapping state using a new AppPreferences.Viewer.lineWrapping property

Reviewed changes

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

Show a summary per file
File Description
Main.xcstrings Added localized strings for "Line Wrapping" menu item in English, Simplified Chinese, and Traditional Chinese
DataViewer.swift Added setLineWrapping method to propagate line wrapping changes to the code view based on display mode
MainVC.swift Implemented menu item validation and toggle action handler for line wrapping with responder chain integration
AppPreferences.swift Added Viewer.lineWrapping preference property using the @Storage property wrapper for persistence
AppDelegate.swift Implemented NSMenuDelegate to dynamically update menu item state based on current display mode
index.html Added JavaScript functions loadCode and setLineWrapping to control CSS whiteSpace property, plus static overflow-wrap CSS rule
CodeView.swift Added lineWrapping parameter to initializer and setLineWrapping method to invoke JavaScript function
Main.storyboard Added "Line Wrapping" menu item with icon, separator, action binding, and menu delegate connection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread WhatCopiedMac/Sources/Controllers/MainVC.swift Outdated
Comment thread WhatCopiedMac/Sources/Controllers/MainVC.swift Outdated
Comment thread WhatCopiedMac/Modules/Sources/AppKitControls/Resources/index.html
Comment thread WhatCopiedMac/Modules/Sources/AppKitControls/Resources/index.html Outdated

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cyanzhong
cyanzhong merged commit eb8df20 into main Dec 26, 2025
7 checks passed
@cyanzhong
cyanzhong deleted the line-wrapping branch December 26, 2025 09:21
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.

2 participants