Skip to content

Conversation

@ellvix
Copy link
Collaborator

@ellvix ellvix commented Aug 19, 2025

Pull Request

Description

Added an exporter to save an ascii brf of the current braille output

Related Issues

Fixes #405

@github-actions
Copy link

⚠️ Changes detected in model-related files

This PR contains changes to files that affect the model layer and unit tests. Before merging, please ensure:

  1. Run the unit tests locally:

    npm run test
  2. Update tests if necessary

@jooyoungseo jooyoungseo requested a review from Copilot August 28, 2025 17:02
Copy link
Contributor

Copilot AI left a 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

Comment on lines +70 to +80
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);
}
Copy link

Copilot AI Aug 28, 2025

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.

Copilot generated this review using guidance from repository custom instructions.
@jooyoungseo jooyoungseo changed the title Feat/brf export feat: support brf export in braille mode Aug 28, 2025
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.

feat: stopgap brf export

2 participants