Release v0.5.9: Image Support, UI Consistency, Linux CI Fix#90
Conversation
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds image paste support with asset save/read commands and inline image rendering, disables the ChangesImage paste and asset persistence feature
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Editor
participant tauriApi
participant TauriFS
participant AssetStore
participant ImageWidget
Editor->>tauriApi: saveAsset(dataBase64, ext, folder)
tauriApi->>TauriFS: invoke save_asset
TauriFS->>AssetStore: write asset bytes
Editor->>tauriApi: readAsset(path)
tauriApi->>TauriFS: invoke read_asset
TauriFS->>AssetStore: read asset bytes
ImageWidget->>tauriApi: readAsset(path)
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src-tauri/src/commands/fs.rs`:
- Around line 530-545: The asset filename generation in the save flow uses only
a millisecond timestamp, which can collide and overwrite an existing pasted
file. Update the filename construction in the asset-saving logic around the
`timestamp`, `prefix`, `filename`, and `file_path` steps to add a random/UUID
suffix or check for an unused path before writing. Keep the existing
decode/write flow (`BASE64.decode` and `tokio::fs::write`) but ensure the chosen
path is unique before persisting the asset.
- Around line 551-557: `read_asset` is currently using `get_safe_path()`, which
creates parent directories and allows non-asset paths under `.papercache`;
update this resolver to be read-only by rejecting any path outside the allowed
asset prefixes (such as `.images` and `.audio`) and resolving the target path
without calling directory-creating logic. Keep the fix localized to `read_asset`
and use the existing helper symbols like `get_safe_path`/path validation logic
to ensure broken embeds do not mutate disk state before the read.
In `@src/api.ts`:
- Line 70: The readAsset helper is sending the wrong argument shape to the Tauri
command, so `read_asset` never receives the file path. Update the `readAsset`
function in `api.ts` to pass the path using the exact `path` key expected by
`invoke('read_asset', ...)`, keeping the `readAsset` symbol and its call to
`invoke` aligned with the command contract.
In `@src/components/KeybindsModal.tsx`:
- Around line 64-70: The KeybindsModal entry for the voice memo shortcut
references a missing SETTINGS_KEYS value, so either add SHORTCUT_VOICE_MEMO to
SETTINGS_KEYS in the settingsKeys module and wire it through the shortcut
handling path, or remove the shortcut row from KeybindsModal if it is not meant
to be supported. Make sure the label, storageKey, and any handler usage all stay
consistent with the new or removed shortcut definition.
In `@src/lib/editor/extensions.ts`:
- Around line 280-291: The paste handling in extensions.ts should preserve the
original selection across the async FileReader/saveAsset gap, because reading
view.state.selection.main.from after await can insert into the wrong place and
never replace a non-empty selection. In the reader.onload flow, capture the
selection range synchronously before starting the async work, replace that range
immediately (or with a placeholder token), and then use the saved range/marker
to swap in the final image embed once window.electronAPI.saveAsset returns.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c6c7f584-5c71-49a7-a8b8-f759e636963b
⛔ Files ignored due to path filters (1)
src-tauri/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (17)
AUDIT_LOG.mdCHANGELOG.mdnotes/New Features in v0.5.9.mdpackage.jsonsrc-tauri/Cargo.tomlsrc-tauri/src/commands/fs.rssrc-tauri/src/lib.rssrc-tauri/tauri.conf.jsonsrc/App.csssrc/api.tssrc/components/KeybindsModal.tsxsrc/components/TimersPage.tsxsrc/lib/editor/extensions.tssrc/lib/editor/markdownPlugin.tssrc/lib/editor/widgets.test.tssrc/lib/editor/widgets.tssrc/types.d.ts
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 5 file(s) based on 5 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 5 file(s) based on 5 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/lib/editor/extensions.ts (1)
299-308: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winResolve the upload placeholder by marker, not stale offsets.
The async completion still replaces
from..from + placeholder.length. If the user edits before the placeholder while the asset is saving, this can replace unrelated note text. Use a unique placeholder/decoration and resolve its current range before replacing; wirereader.onerror/reader.onabortto the same failure replacement path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lib/editor/extensions.ts` around lines 299 - 308, The async image save flow in extensions.ts still uses the original from/to range after the upload completes, which can become stale if the document changes. Update the placeholder replacement logic in the image upload path to identify the placeholder by a unique marker or decoration and resolve its current range at dispatch time before inserting the final image or failure text. Also route reader.onerror and reader.onabort through the same failure handling used in the catch block so all upload failures replace the active placeholder consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/editor/extensions.ts`:
- Around line 307-309: The dispatch call in the editor placeholder update uses a
single-line object for changes, which violates the Prettier-required multiline
object format. Update the object passed to view.dispatch in the placeholder
handling logic so the changes property is written in multiline form, matching
the project's formatting rules and keeping the structure consistent with the
surrounding editor extension code.
---
Duplicate comments:
In `@src/lib/editor/extensions.ts`:
- Around line 299-308: The async image save flow in extensions.ts still uses the
original from/to range after the upload completes, which can become stale if the
document changes. Update the placeholder replacement logic in the image upload
path to identify the placeholder by a unique marker or decoration and resolve
its current range at dispatch time before inserting the final image or failure
text. Also route reader.onerror and reader.onabort through the same failure
handling used in the catch block so all upload failures replace the active
placeholder consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0acd0dac-73b7-44b6-92be-7986e3373762
📒 Files selected for processing (5)
src-tauri/src/commands/fs.rssrc/api.tssrc/lib/editor/extensions.tssrc/lib/settingsKeys.tssrc/setupTests.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/api.ts
- src-tauri/src/commands/fs.rs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Release v0.5.9
Features & Improvements
.imagesand rendered inline as image cards.ubuntu-22.04forglibc 2.35compatibility.Pre-PR Verification
npm run lintpassed clean (0 errors)npx vitest runpassed clean (68/68 passing)cargo checkpassed cleanSummary by CodeRabbit