feat: add scramble flag for development text scrambling
This commit introduces a new scramble option to help reduce distractions
during development by scrambling text using rot13. When enabled via the
new `--scramble` flag, text displayed in various views is transformed,
making it easier to focus on layout and behavior without reading the
actual content.
App & Args Updates
- Added a `scramble: bool` field to the main application state (in `app.rs`).
- Extended argument parsing (in `args.rs`) to recognize the `--scramble` flag.
NoteOptions Enhancement
- Introduced a new bit flag `scramble_text` in `NoteOptions` with
corresponding setter/getter methods.
UI Adjustments
- Propagated the scramble flag through note rendering functions across
navigation, timeline, and note view modules.
- Updated several UI components (e.g., in `nav.rs`, `route.rs`, and
`contents.rs`) to accept and apply the new note options.
Rot13 Implementation
- Implemented a helper function (`rot13`) to scramble text
conditionally when the scramble option is enabled.
This feature is intended for development builds only, offering a way to
obscure text content during UI tweaks and testing.
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -8,6 +8,7 @@ pub struct ColumnsArgs {
|
||||
pub columns: Vec<ArgColumn>,
|
||||
pub since_optimize: bool,
|
||||
pub textmode: bool,
|
||||
pub scramble: bool,
|
||||
}
|
||||
|
||||
impl ColumnsArgs {
|
||||
@@ -17,6 +18,7 @@ impl ColumnsArgs {
|
||||
columns: vec![],
|
||||
since_optimize: true,
|
||||
textmode: false,
|
||||
scramble: false,
|
||||
};
|
||||
|
||||
let mut i = 0;
|
||||
@@ -28,6 +30,8 @@ impl ColumnsArgs {
|
||||
res.textmode = true;
|
||||
} else if arg == "--no-since-optimize" {
|
||||
res.since_optimize = false;
|
||||
} else if arg == "--scramble" {
|
||||
res.scramble = true;
|
||||
} else if arg == "--filter" {
|
||||
i += 1;
|
||||
let filter = if let Some(next_arg) = args.get(i) {
|
||||
|
||||
Reference in New Issue
Block a user