-
-
Notifications
You must be signed in to change notification settings - Fork 17
feat(tui): add optional Nerd Font icons #313
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
Closed
frigidplatypus
wants to merge
9
commits into
outlmd:main
from
frigidplatypus:feat/tui-icons-emoji-default
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
82ab5fd
feat(tui): add optional Nerd Font icons
frigidplatypus fe06692
refactor: keep icon changes under file-size ratchet
frigidplatypus dfc861f
fix(desktop): restore [tui] section when the settings modal saves
frigidplatypus c07e79f
fix(tui): route play glyphs and the boot warning chip through IconSet
frigidplatypus 63195d2
refactor(tui): keep the icon-style param under the file-size ratchet
frigidplatypus 02ddb7b
fix(tui): route chrome chips and fold markers through IconSet
frigidplatypus dd01fb7
fix(tui): fix icon glyphs and route all toast kinds through IconSet
frigidplatypus 08119f0
fix(desktop): restore [snapshot] and [storage] on settings save
frigidplatypus e97806a
Merge branch 'main' into feat/tui-icons-emoji-default
frigidplatypus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| //! TUI-only preferences and icon selection. | ||
|
|
||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| /// TUI-only preferences (the desktop ignores this section). | ||
| #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] | ||
| #[serde(default)] | ||
| pub struct TuiCfg { | ||
| /// Chrome icon set. Emoji is portable across ordinary terminal fonts; | ||
| /// Nerd Font glyphs are available as an explicit opt-in. | ||
| pub icons: TuiIconStyle, | ||
|
|
||
| /// Capture the mouse so the app owns selection: drag across blocks | ||
| /// selects a range and copies it as clean markdown on release, the | ||
| /// scroll wheel moves the outline selection, a click selects a block. | ||
| /// | ||
| /// Default `false`, and deliberately opt-in: capturing the mouse | ||
| /// **disables the terminal's own text selection** (selecting a URL, | ||
| /// copying a single word, dragging across panes), which is muscle | ||
| /// memory for many terminal users. Turn it on only if you want | ||
| /// mouse-driven copy inside outl more than the terminal's native | ||
| /// selection. The keyboard yank (`yy` / `Y` / Visual `y`) copies | ||
| /// markdown to the clipboard regardless of this flag. | ||
| pub mouse_capture: bool, | ||
| } | ||
|
|
||
| /// Icon set used by TUI chrome. | ||
| #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)] | ||
| #[serde(rename_all = "kebab-case")] | ||
| pub enum TuiIconStyle { | ||
| /// Unicode emoji and symbols supported by ordinary terminal fonts. | ||
| #[default] | ||
| Emoji, | ||
| /// Font Awesome / Material Design glyphs from a Nerd Font. | ||
| NerdFont, | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::*; | ||
|
|
||
| #[test] | ||
| fn tui_icon_style_parses_and_defaults_to_emoji() { | ||
| let c: crate::Config = toml::from_str("[tui]\nicons = \"nerd-font\"\n").unwrap(); | ||
| assert_eq!(c.tui.icons, TuiIconStyle::NerdFont); | ||
|
|
||
| let c: crate::Config = toml::from_str("[theme]\npreset = \"nord\"\n").unwrap(); | ||
| assert_eq!(c.tui.icons, TuiIconStyle::Emoji); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
real fix, thanks.
[snapshot]and[storage]have the identical bug though, and the comments at lines 194 and 197 already claimsaverestores them from disk.Confighas 12 sections, this function restores 6,Settingsmodels 5. a hand-setop_thresholdorlru_capgets reset to the default on every modal save, silently, same asiconsdid.and extend
save_restores_the_tui_section_the_desktop_never_modelsto cover them.