-
Notifications
You must be signed in to change notification settings - Fork 1
feat: support brf export in braille mode #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
This PR contains changes to files that affect the model layer and unit tests. Before merging, please ensure:
|
There was a problem hiding this 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 PR adds functionality to export the current braille output as an ASCII BRF (Braille Ready Format) file. Users can trigger this export using Ctrl+S when in braille mode.
Key Changes:
- Added a new keybinding (Ctrl+S) for exporting braille to BRF format
- Implemented braille-to-ASCII conversion logic with proper character mapping
- Created a new command to handle the export functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/state/viewModel/brailleViewModel.ts | Added export functionality and braille-to-ASCII conversion method |
| src/service/keybinding.ts | Added EXPORT_TO_BRF keybinding (Ctrl+S) and reformatted ALLOW_DEFAULT |
| src/command/toggle.ts | Created ToggleExport command to handle the export operation |
| src/command/factory.ts | Registered the new ToggleExport command and reformatted existing code |
| public ExportBraille(braille: string): void { | ||
| // trigger download of current braille | ||
| const ascii = this.brailleToAscii(braille); | ||
| const blob = new Blob([ascii], { type: 'text/plain;charset=utf-8' }); | ||
| const url = URL.createObjectURL(blob); | ||
| const a = document.createElement('a'); | ||
| a.href = url; | ||
| a.download = 'braille.brf'; | ||
| a.click(); | ||
| URL.revokeObjectURL(url); | ||
| } |
Copilot
AI
Aug 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method contains UI manipulation logic (DOM element creation and triggering downloads) which violates the layered architecture. ViewModels should not directly manipulate the DOM. This functionality should be moved to a service layer or handled through proper UI layer delegation.
Pull Request
Description
Added an exporter to save an ascii brf of the current braille output
Related Issues
Fixes #405