Skip to content

feat: publish Ferrite-Ramix viewer workflow (bug fix, new viewer focused options) - #172

Open
rami123 wants to merge 2 commits into
OlaProeis:masterfrom
rami123:master
Open

rami123 wants to merge 2 commits into
OlaProeis:masterfrom
rami123:master

Conversation

@rami123

@rami123 rami123 commented Jul 18, 2026 •

Copy link
Copy Markdown

Description

Hi great viewer/editor! This PR first fixes an existing Rendered-view navigation bug: clicking a heading in the Outline could scroll to the wrong location.

The original navigation estimated the rendered position from the Markdown source-line number multiplied by a plain row height. That estimate becomes inaccurate when a document contains wrapped paragraphs, large headings, code blocks, tables, images, or other content whose rendered height differs from its source representation.

The fix uses the measured source-line-to-rendered-position mapping produced by the actual rendered layout. Outline and Chapters navigation therefore lands on the selected heading instead of a preceding or nearby section.

After fixing that bug, I added several viewer-oriented options for people who frequently open Markdown files for quick reading and navigation. These additions are also useful during editing, but their main purpose is to make Ferrite a more practical document viewer.

Almost all new behavior is optional and disabled by default, preserving Ferrite's existing behavior unless the user explicitly enables an option.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change
  • Refactoring with no functional changes
  • Performance improvement

Primary Bug Fix

  • Replaced source-line × plain-row-height navigation estimates with measured rendered positions.
  • Corrected navigation from both the original Outline and the new Chapters panel.
  • Retained the old estimate only as a fallback when rendered-position information is not yet available.
  • Added reproduction material and screenshots demonstrating the original mismatch.

Viewer-Oriented Changes

Chapters panel

  • Added an optional dedicated Chapters tab.
  • Recognizes ATX headings (#, ##, ###, and so on).
  • Recognizes Setext headings using === or --- underline syntax.
  • Preserves heading hierarchy.
  • Supports making Chapters the default document-information view.
  • Can mark the last heading visible in the Rendered view.
  • Can show code-block references.
  • Can show image references.
  • Chapter entries use a slightly larger, bold font for easier scanning.

Rendered-view interface

  • Optionally show the left File Tree and right Document panel in Rendered view.
  • Optionally disable the New File toolbar button while in Rendered mode.
  • Optionally start Ferrite maximized.
  • Added configurable Escape-to-exit behavior for Raw, Split, and Rendered modes.

Document tabs

  • Close a tab by double-clicking.
  • Close a tab with the middle mouse button.
  • Drag tabs to reorder them.
  • Keep tabs on a single line with an overflow dropdown.
  • Add a Close other button.
  • Configure Close other for left-click, middle-click, or Ctrl+left-click.

Links, images, and local files

  • Open links with middle-click or Ctrl+left-click.
  • Preserve normal right-click behavior.
  • Added tooltips explaining the available link actions.
  • Open supported local files such as Markdown and JSON from rendered links.
  • Optionally display linked images inline.
  • Double-click an inline image to open it in its own tab.
  • Added Back navigation for linked documents and images using:
    • the Back button;
    • Ctrl+Backspace;
    • Alt+Left; and
    • the mouse Back button.

Font-size workflow

  • Display the current font size in the status bar.
  • Optionally use the current document's dynamically adjusted font size for subsequently opened files.
  • Font size can still be changed with Ctrl+Plus, Ctrl+Minus, or Ctrl+mouse-wheel.
  • Enforces a minimum carried-forward font size of 6 px.
  • Displays the currently remembered font size in Settings.

Multi-tab Exit and bulk-close safety

Ferrite 0.3.0 had a minor multi-tab Exit bug: after warning about unsaved changes, the Save action called the single-document save handler only once, so it saved only the active tab despite a source comment claiming all modified tabs were saved. The Close All path also had no bulk-save implementation.

This update lists every affected modified filename for Exit, Close All, and Close Other, with Save all, Discard all, and Cancel actions. Save all processes every affected tab, including Save As for untitled documents; cancellation or failure aborts the bulk close. Exit also persists recovery content for all modified tabs before presenting the decision dialog.

Portable Windows build

  • Removed the unnecessary wrapper launcher.
  • Uses Ferrite's native portable behavior: placing a portable directory beside ferrite.exe keeps configuration and session data with the application.
  • Added a fast portable build script that performs the optimized build directly without first running a redundant cargo check.

Screenshots

Rendered view with File Tree and Chapters panel

Ferrite-Ramix rendered viewer

Added Appearance settings

Ferrite-Ramix Appearance settings

Additional bug reproduction material is included under:

Ramix - Readme/Bug - Ferrite wrongly estimated rendered positions using source line × plain row height causing mismatch bwtween main view, and outline/

Defaults and Compatibility

The new viewer-interface, Chapters, tab-management, font carry-forward, maximized-startup, inline-image, and Escape-to-exit options are disabled by default.

Existing users therefore retain Ferrite's original interaction model until they deliberately enable the additions in Settings → Appearance.

The corrected Outline navigation, status-bar font-size display, link tooltips, supported local-file opening, the on-screen Back button, and the mouse Back button work without additional configuration. Alt+Left and Ctrl+Backspace Back navigation are separate options and default to off because enabling them may change normal editing or application shortcut behavior.

Checklist

  • My code follows the project's code style
  • I have run cargo fmt and it produces no changes
  • I have run cargo clippy and it produces no warnings
  • I have run cargo test and all tests pass
  • I have run cargo build --release successfully
  • I have updated the documentation
  • I have added tests for new functionality where applicable
  • My changes generate no new warnings

Breaking Changes

No intentional breaking changes.

The existing behavior remains the default for almost all newly added options.

Testing

  • Built the application successfully using cargo build --release.
  • Tested Outline and Chapters navigation against Markdown documents containing wrapped text, headings, code blocks, tables, and other variable-height rendered elements.
  • Tested the viewer-oriented settings in Raw, Split, and Rendered modes.
  • Tested link and image opening with middle-click and Ctrl+left-click.
  • Tested linked-document Back navigation with Ctrl+Backspace, Alt+Left, the toolbar Back button, and the mouse Back button.
  • Tested tab closing, tab overflow, tab reordering, and Close other behavior.
  • Tested the native portable directory layout on Windows.

Additional Notes

The fork began specifically to correct the Rendered Outline navigation bug. The additional features were added afterward to support a fast, viewer-focused Markdown workflow.

The changes are deliberately configurable rather than forcing a different workflow on existing Ferrite users.

Summary by CodeRabbit

  • New Features
    • Added improved Rendered-view outline navigation with chapters tracking.
    • Introduced an optional Chapters tab (headings-only) with configurable code/image references and “last visible” marking.
    • Added inline Markdown image rendering and richer link interactions in Rendered view, including local-file opening and Back navigation.
    • Expanded Appearance settings: per-mode Escape-to-exit, viewer layout toggles, disable New File in Rendered, always-start-maximized, font-size carry-forward, and configurable tab behaviors including “Close other” plus safer bulk close.
    • Added portable Windows build scripts.
  • Bug Fixes
    • Fixed Outline → Rendered-view heading navigation misalignment.
  • Other
    • Display current editor font size in the status bar.

@rami123 rami123 changed the title feat: publish Ferrite-Ramix viewer workflow (big fix, new viewer focused options) feat: publish Ferrite-Ramix viewer workflow (bug fix, new viewer focused options) Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Ferrite-Ramix extends Ferrite with Rendered-view navigation improvements, chapters and link interactions, configurable tab and viewer behavior, dynamic font sizing, portable Windows builds, and comprehensive documentation of fork-specific features.

Changes

Viewer features and application integration

Layer / File(s) Summary
Settings and outline data
src/config/settings.rs, src/editor/outline.rs
Settings adds per-ViewMode Escape-exit flags, Rendered-mode toggles, chapter/tab/font behaviors, and defaults; outline extraction populates code previews and image filenames for chapters.
Outline panel chapters rendering
src/ui/outline_panel.rs
Outline panel adds Chapters tab variant with headings-only display, optional code/image references, state tracking for default view and marked chapters, and adaptive tab-bar rendering.
Rendered Markdown links and images
src/markdown/editor.rs, src/markdown/widgets.rs
Rendered Markdown tracks inline link spans with kind classification (URL/image/file), renders configured inline images, handles click-to-open for URLs and local files, and defers local-file requests for application routing.
Application navigation, tabs, and tab management
src/app/central_panel.rs, src/app/navigation.rs
Application navigation activates/deactivates viewer layout, maps rendered scroll to interpolated positions using line mappings, handles parent-tab tracking for Back navigation, adds tab overflow caret menu and close-other button controls.
State and dialog management for tab closing
src/state.rs, src/app/dialogs.rs
State adds parent-tab tracking and close-other-tabs pending action; dialogs implement per-tab save/discard/cancel confirmation for bulk close and exit flows with recovery writes.
Input, font, window behavior, and settings UI
src/app/keyboard.rs, src/app/mod.rs, src/main.rs, src/ui/ribbon.rs, src/app/status_bar.rs, src/ui/settings.rs
Per-view Escape behavior, dynamic editor font sizing and status-bar display, startup maximization, Rendered-mode New-button control, and settings UI for all viewer options.

Portable packaging and documentation

Layer / File(s) Summary
Portable build automation
build-portable-fast.bat, scripts/build-portable-custom.ps1, .gitignore
Adds Windows batch and PowerShell entry points for portable bundle creation, optional execution, and ignores generated artifacts.
Fork and utility documentation
README.md, Ramix - Readme/...
Documents Ferrite-Ramix as a Ferrite-based fork with Rendered-view navigation fixes, viewer-focused settings, portable packaging behavior, and relative shortcut utility reference.
Supporting cleanup, formatting, and tests
src/config/session.rs, src/markdown/..., src/preview/sync_scroll.rs, src/terminal/pty.rs, src/ui/about.rs, src/ui/productivity_panel.rs
Formatting-only edits, logging adjustments, test updates, and module export ordering changes.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MarkdownEditor
  participant CentralPanel
  participant Navigation
  participant AppState
  User->>MarkdownEditor: Click local Markdown link
  MarkdownEditor->>CentralPanel: Report local_file_clicked
  CentralPanel->>Navigation: Record parent→child relationship
  Navigation->>AppState: Open file in new tab
  AppState-->>CentralPanel: Activate opened tab
  User->>CentralPanel: Click "← Back" or Alt+Left
  CentralPanel->>AppState: Restore parent tab
Loading

Suggested reviewers: olaproeis

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: a Ferrite-Ramix viewer workflow update with a bug fix and new viewer-focused options.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (1)
src/editor/ferrite/editor.rs (1)

400-402: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the shared font-size bounds.

This change required manually synchronizing literals with Settings; reference its constants in both implementation and test to prevent future drift.

Proposed refactor
-        let new_size = size.clamp(6.0, 72.0);
+        let new_size = size.clamp(
+            crate::config::Settings::MIN_FONT_SIZE,
+            crate::config::Settings::MAX_FONT_SIZE,
+        );
-        assert!((editor.font_size() - 6.0).abs() < 0.01);
+        assert!(
+            (editor.font_size() - crate::config::Settings::MIN_FONT_SIZE).abs() < 0.01
+        );

Also applies to: 3821-3821

🤖 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/editor/ferrite/editor.rs` around lines 400 - 402, Update set_font_size to
use the shared minimum and maximum font-size constants from Settings instead of
hardcoded bounds. Update the related font-size test to reference those same
Settings constants, preserving the existing clamping behavior and preventing
future drift.
🤖 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/app/central_panel.rs`:
- Around line 2852-2883: Update cleanup_tab_state to remove closed-tab entries
from both newly introduced per-tab maps: remove the tab ID from
self.state.ui.navigation_parents in src/app/central_panel.rs:2852-2883 and from
self.rendered_chapter_tracking in src/app/navigation.rs:755-755. Preserve the
existing cleanup behavior for all other tab state.
- Around line 791-800: Update the back-navigation input handling around alt_left
and ctrl_backspace so linked-tab navigation does not consume editor shortcuts
while a text editor is focused. Gate Ctrl+Backspace and Alt+Left on the
appropriate non-editor-focus condition, while preserving navigation behavior
when focus is outside an editor and retaining mouse_back handling.

In `@src/app/dialogs.rs`:
- Around line 58-64: Update the Save action handling in the dialog to explicitly
handle PendingAction::CloseOtherTabs and PendingAction::CloseAllTabs by
performing the bulk save-and-confirm flow, or disable Save for those pending
actions. Ensure pending_action is cleared and the dialog closes instead of
remaining open.

In `@src/app/status_bar.rs`:
- Around line 560-564: Update the font-size wording in src/app/status_bar.rs
lines 560-564 and src/ui/settings.rs lines 1503-1507 to use logical points
(“pt”) or omit the unit, keeping the status label and tooltip terminology
consistent.

In `@src/editor/outline.rs`:
- Around line 728-773: Update test_parse_image assertions to match parse_image’s
Option<(String, String)> return type, checking both the parsed title and
filename in each expected tuple while preserving the existing test cases.

In `@src/ui/settings.rs`:
- Around line 1110-1117: Move the “Always start maximized” control out of the
Rendered-mode UI settings section and into a general window settings section,
keeping its behavior unchanged. Update the surrounding grouping so the
Rendered-mode description only covers settings that affect Rendered mode.

---

Nitpick comments:
In `@src/editor/ferrite/editor.rs`:
- Around line 400-402: Update set_font_size to use the shared minimum and
maximum font-size constants from Settings instead of hardcoded bounds. Update
the related font-size test to reference those same Settings constants,
preserving the existing clamping behavior and preventing future drift.
🪄 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: 3d91cad1-7960-47b5-a90f-368ace2b2dc1

📥 Commits

Reviewing files that changed from the base of the PR and between 3ba085c and 90923d7.

⛔ Files ignored due to path filters (5)
  • Ramix - Readme/Bug - Ferrite wrongly estimated rendered positions using source line × plain row height causing mismatch bwtween main view, and outline/Cap_0040.png is excluded by !**/*.png
  • Ramix - Readme/Bug - Ferrite wrongly estimated rendered positions using source line × plain row height causing mismatch bwtween main view, and outline/Cap_0041.png is excluded by !**/*.png
  • Ramix - Readme/Screenshots/Cap_0144.png is excluded by !**/*.png
  • Ramix - Readme/Screenshots/Cap_0161.png is excluded by !**/*.png
  • portable/FerriteMDPortable/FerriteMDPortable.exe is excluded by !**/*.exe
📒 Files selected for processing (46)
  • .gitignore
  • README.md
  • Ramix - Readme/Bug - Ferrite wrongly estimated rendered positions using source line × plain row height causing mismatch bwtween main view, and outline/____lnk-url_README.md
  • Ramix - Readme/README.md
  • build-portable-fast.bat
  • portable/.gitignore
  • portable/FerriteMDPortable/App/AppInfo/Launcher/FerriteMDPortable.ini
  • portable/FerriteMDPortable/App/AppInfo/appinfo.ini
  • portable/FerriteMDPortable/App/DefaultData/settings/.gitkeep
  • portable/FerriteMDPortable/Data/settings/.gitkeep
  • portable/FerriteMDPortable/Other/Help/Images/.gitkeep
  • portable/FerriteMDPortable/Other/Help/help.html
  • portable/FerriteMDPortable/Other/Source/LICENSE
  • portable/FerriteMDPortable/help.html
  • portable/README.md
  • portable/installer.nsi
  • scripts/build-portable-custom.ps1
  • src/app/central_panel.rs
  • src/app/dialogs.rs
  • src/app/keyboard.rs
  • src/app/mod.rs
  • src/app/navigation.rs
  • src/app/status_bar.rs
  • src/config/session.rs
  • src/config/settings.rs
  • src/editor/ferrite/editor.rs
  • src/editor/outline.rs
  • src/editor/widget.rs
  • src/main.rs
  • src/markdown/code_execution.rs
  • src/markdown/csv_viewer.rs
  • src/markdown/editor.rs
  • src/markdown/mod.rs
  • src/markdown/parser.rs
  • src/markdown/rendered_session.rs
  • src/markdown/video_embed.rs
  • src/markdown/widgets.rs
  • src/preview/sync_scroll.rs
  • src/state.rs
  • src/terminal/pty.rs
  • src/ui/about.rs
  • src/ui/outline_panel.rs
  • src/ui/productivity_panel.rs
  • src/ui/ribbon.rs
  • src/ui/settings.rs
  • src/ui/terminal_panel.rs
💤 Files with no reviewable changes (9)
  • portable/FerriteMDPortable/Other/Source/LICENSE
  • portable/FerriteMDPortable/App/AppInfo/appinfo.ini
  • portable/.gitignore
  • portable/FerriteMDPortable/App/AppInfo/Launcher/FerriteMDPortable.ini
  • portable/FerriteMDPortable/Other/Help/help.html
  • portable/README.md
  • portable/FerriteMDPortable/help.html
  • portable/installer.nsi
  • src/ui/about.rs

Comment thread src/app/central_panel.rs Outdated
Comment thread src/app/central_panel.rs
Comment on lines +2852 to +2883
// Open local Markdown links only after editor rendering releases its tab borrow.
if let Some((path, parent_tab_id)) = pending_local_file {
let time = self.get_app_time();
match self.open_file_smart(path.clone(), true, Some(time)) {
Ok(index) => {
let child_tab_id = self.state.tab(index).map(|tab| tab.id);
if let Some(child_tab_id) = child_tab_id {
if child_tab_id != parent_tab_id {
self.state
.ui
.navigation_parents
.insert(child_tab_id, parent_tab_id);
}
}
if let Some(tab) = self.state.tab_mut(index) {
if let TabKind::ImageViewer(viewer) = &mut tab.kind {
viewer.parent_tab_id = Some(parent_tab_id);
}
}
}
Err(error) => {
log::warn!(
"Failed to open local Markdown link '{}': {}",
path.display(),
error
);
self.state
.show_error(format!("Failed to open file:\n{}", error));
}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

New per-tab maps aren't pruned on tab close. cleanup_tab_state intentionally removes every other per-tab map (tree_viewer_states, csv_viewer_states, sync_scroll_states) to prevent leaks, but the two maps added in this PR keep accumulating entries for closed tabs for the whole session. Not a correctness bug (tab ids aren't reused), but it drifts from the established cleanup contract.

  • src/app/central_panel.rs#L2852-L2883: entries inserted into self.state.ui.navigation_parents here are never removed; add self.state.ui.navigation_parents.remove(&tab_id) in cleanup_tab_state.
  • src/app/navigation.rs#L755-L755: entries created in rendered_chapter_tracking here are never removed; add self.rendered_chapter_tracking.remove(&tab_id) in cleanup_tab_state.
📍 Affects 2 files
  • src/app/central_panel.rs#L2852-L2883 (this comment)
  • src/app/navigation.rs#L755-L755
🤖 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/app/central_panel.rs` around lines 2852 - 2883, Update cleanup_tab_state
to remove closed-tab entries from both newly introduced per-tab maps: remove the
tab ID from self.state.ui.navigation_parents in
src/app/central_panel.rs:2852-2883 and from self.rendered_chapter_tracking in
src/app/navigation.rs:755-755. Preserve the existing cleanup behavior for all
other tab state.

Comment thread src/app/dialogs.rs
Comment thread src/app/status_bar.rs
Comment on lines +560 to +564
ui.separator();
ui.label(format!(
"Font size: {:.0} px",
self.current_editor_font_size(&ctx)
));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Label logical font sizes consistently as points, not pixels.

Both new strings describe egui logical point sizes as physical pixels, which is inaccurate under DPI scaling.

  • src/app/status_bar.rs#L560-L564: use pt or omit the unit in the status label.
  • src/ui/settings.rs#L1503-L1507: use the same terminology in the tooltip.
📍 Affects 2 files
  • src/app/status_bar.rs#L560-L564 (this comment)
  • src/ui/settings.rs#L1503-L1507
🤖 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/app/status_bar.rs` around lines 560 - 564, Update the font-size wording
in src/app/status_bar.rs lines 560-564 and src/ui/settings.rs lines 1503-1507 to
use logical points (“pt”) or omit the unit, keeping the status label and tooltip
terminology consistent.

Comment thread src/editor/outline.rs
Comment thread src/ui/settings.rs
@rami123 rami123 closed this Jul 18, 2026
@rami123 rami123 reopened this Jul 18, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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/app/dialogs.rs`:
- Around line 125-130: Localize the bulk-action labels in the dialog button
logic, including the save-label branch near the visible code and the
corresponding discard-label branch. Add translation keys for “Save all” and
“Discard all” to the appropriate localization resources, then replace the
hardcoded strings with t!(...) calls consistent with the adjacent button labels.

In `@src/state.rs`:
- Around line 4380-4395: Bound the unsaved-title lists used by the Close Other
Tabs flow at src/state.rs lines 4380-4395, Close All Tabs flow at lines
4427-4439, and exit prompt at lines 5651-5666 by displaying only a limited
number of titles with a remaining-count indicator, or by rendering each list in
a bounded ScrollArea; preserve the existing confirmation behavior and formatting
for the displayed titles.
🪄 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: 780acfcd-419c-4b8e-9960-7c3b4fc8e982

📥 Commits

Reviewing files that changed from the base of the PR and between 90923d7 and 42fb6b4.

⛔ Files ignored due to path filters (2)
  • Ramix - Readme/Screenshots/Cap_0161.png is excluded by !**/*.png
  • Ramix - Readme/Screenshots/Cap_0251.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • README.md
  • Ramix - Readme/README.md
  • src/app/central_panel.rs
  • src/app/dialogs.rs
  • src/app/mod.rs
  • src/app/status_bar.rs
  • src/config/settings.rs
  • src/editor/ferrite/editor.rs
  • src/editor/outline.rs
  • src/state.rs
  • src/ui/settings.rs
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/app/status_bar.rs
  • Ramix - Readme/README.md
  • src/ui/settings.rs
  • README.md
  • src/config/settings.rs
  • src/app/mod.rs
  • src/app/central_panel.rs
  • src/editor/outline.rs

Comment thread src/app/dialogs.rs
Comment on lines 125 to +130
// "Save" button - save then proceed with action
if ui
.button(t!("dialog.unsaved_changes.save").to_string())
.clicked()
{
let save_label = if is_bulk_close || is_exit {
"Save all".to_string()
} else {
t!("dialog.unsaved_changes.save").to_string()
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Localize the bulk-action labels.

Save all and Discard all remain English under every configured UI language. Add translation keys and use t!(...), consistent with the adjacent buttons.

Also applies to: 217-222

🤖 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/app/dialogs.rs` around lines 125 - 130, Localize the bulk-action labels
in the dialog button logic, including the save-label branch near the visible
code and the corresponding discard-label branch. Add translation keys for “Save
all” and “Discard all” to the appropriate localization resources, then replace
the hardcoded strings with t!(...) calls consistent with the adjacent button
labels.

Comment thread src/state.rs
Comment on lines +4380 to +4395
let unsaved_titles: Vec<String> = self
.tabs
.iter()
.filter(|tab| {
tab.id != keep_tab_id
&& tab.should_prompt_to_save(&self.settings, SavePromptContext::TabClose)
})
.map(Tab::persisted_session_display_title)
.collect();

if !unsaved_titles.is_empty() {
self.ui.show_confirm_dialog = true;
self.ui.confirm_dialog_message = format!(
"The following tabs have unsaved changes:\n\n• {}",
unsaved_titles.join("\n• ")
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Bound the tab list shown in confirmation dialogs.

The non-resizable dialog renders this message without a scroll area. With enough unsaved tabs, the action buttons can be pushed outside the usable viewport. Show a limited number of titles plus a remaining count, or render the list in a bounded ScrollArea.

  • src/state.rs#L4380-L4395: bound the Close Other Tabs title list.
  • src/state.rs#L4427-L4439: apply the same bound to Close All Tabs.
  • src/state.rs#L5651-L5666: apply the same bound to the exit prompt.
📍 Affects 1 file
  • src/state.rs#L4380-L4395 (this comment)
  • src/state.rs#L4427-L4439
  • src/state.rs#L5651-L5666
🤖 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/state.rs` around lines 4380 - 4395, Bound the unsaved-title lists used by
the Close Other Tabs flow at src/state.rs lines 4380-4395, Close All Tabs flow
at lines 4427-4439, and exit prompt at lines 5651-5666 by displaying only a
limited number of titles with a remaining-count indicator, or by rendering each
list in a bounded ScrollArea; preserve the existing confirmation behavior and
formatting for the displayed titles.

@OlaProeis

Copy link
Copy Markdown
Owner

very nice :) I will look into this and include it in the next release, currently on vacation, scheduled to mid or late August

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