Skip to content

Commit 12769de

Browse files
committed
fix(mobile): resolve editor Enter key behavior and improve code quality
- Fix: Editor Enter key now properly splits content in lists and paragraphs - Bullet lists: Extract content after cursor when pressing Enter mid-line - Ordered lists: Extract content after cursor when pressing Enter mid-line - Paragraphs: Expand range to end of block before extracting content - Root cause: Collapsed range wasn't expanding before extractContents() - Chore: Add ESLint import sorting and apply formatting - Configure eslint-plugin-simple-import-sort - Auto-sort imports across all files - Add lint:fix npm script - Refactor: Improve Sentry logging with structured categories - Add category prefixes: [NOTE], [AUTH], [ERROR], [ENCRYPTION], etc. - Add structured attributes for better filtering - Remove NewRelic-specific code and sentry.ts utility file - Enable Sentry structured logs in index.js - Chore: Remove unused code and dependencies - Delete unused files: haptic-tab.tsx, useNoteEditor.ts, styles.ts - Remove TenTap editor and Pell editor dependencies - Clean up route file exports
1 parent 14eefa7 commit 12769de

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

apps/mobile/v1/src/screens/ViewNote/NoteContent.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ export function NoteContent({
4545
<html lang="en">
4646
<head>
4747
<meta name="viewport" content="width=device-width, initial-scale=1.0">
48+
<!-- noinspection HtmlUnknownTarget,JSUnresolvedLibraryURL -->
4849
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css" crossorigin="anonymous">
50+
<!-- noinspection HtmlUnknownTarget,JSUnresolvedLibraryURL -->
4951
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" crossorigin="anonymous"></script>
5052
<style>
5153
body {
@@ -140,6 +142,7 @@ export function NoteContent({
140142
141143
pre {
142144
background-color: ${theme.isDark ? 'rgba(255, 255, 255, 0.05)' : theme.colors.muted};
145+
/* noinspection CssInvalidPropertyValue */
143146
border: 1px solid ${theme.colors.border};
144147
border-radius: 6px;
145148
padding: 12px 16px;
@@ -163,6 +166,7 @@ export function NoteContent({
163166
color: ${theme.isDark ? '#ffffff' : 'inherit'} !important;
164167
}
165168
169+
/* noinspection CssInvalidFunction,JSUnresolvedReference,JSValidateTypes */
166170
${htmlContent.match(/<style>([\s\S]*?)<\/style>/)?.[1] || ''}
167171
168172
/* Override any extracted styles with our custom spacing */
@@ -207,11 +211,13 @@ export function NoteContent({
207211
hr {
208212
margin: 16px 0;
209213
border: none;
214+
/* noinspection CssInvalidPropertyValue */
210215
border-top: 1px solid ${theme.colors.border};
211216
}
212217
213218
/* Blockquotes */
214219
blockquote {
220+
/* noinspection CssInvalidPropertyValue */
215221
border-left: 4px solid ${theme.colors.border};
216222
padding-left: 16px;
217223
margin: 12px 0;

apps/mobile/v1/src/services/fileService.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ class FileService {
5555

5656
/**
5757
* Convert base64 to Uint8Array
58+
* @deprecated Not currently used - keeping for potential future use
5859
*/
60+
// noinspection JSUnusedLocalSymbols
5961
private base64ToUint8Array(base64: string): Uint8Array {
6062
const binary = forge.util.decode64(base64);
6163
const bytes = new Uint8Array(binary.length);
@@ -287,6 +289,7 @@ class FileService {
287289
if (!response.ok) {
288290
const errorText = await response.text();
289291
console.error('[ERROR] Download failed:', response.status, errorText);
292+
// noinspection ExceptionCaughtLocallyJS - Intentionally caught locally for logging before re-throw
290293
throw new Error(`${response.status} ${errorText}`);
291294
}
292295

@@ -370,7 +373,8 @@ class FileService {
370373
if (bytes === 0) return '0 Bytes';
371374
const k = 1024;
372375
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
373-
const i = Math.floor(Math.log(bytes) / Math.log(k));
376+
// noinspection JSVoidFunctionReturnValueUsed
377+
const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), sizes.length - 1);
374378
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
375379
}
376380

0 commit comments

Comments
 (0)