summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-16 15:49:12 -0300
committerGabriel Schneider <[email protected]>2026-08-18 23:44:42 -0300
commit1551e409c31992437cb2fa864f576d45c8433801 (patch)
treee2fae8451f87b735a1360c7c2e383fdc40165789 /src/config.zig
parentbe2a9957708cbf0c478ca861c4a1f0f227bbfe10 (diff)
downloadpardes-1551e409c31992437cb2fa864f576d45c8433801.tar.gz
pardes-1551e409c31992437cb2fa864f576d45c8433801.zip
big slow change: prebuilt shaders (SPIR-V/Metal), core gui reflow, docs, web + snapshot refresh
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig67
1 files changed, 51 insertions, 16 deletions
diff --git a/src/config.zig b/src/config.zig
index de971db9..c8a8f8cf 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -145,7 +145,6 @@ pub const leader_path = paths: {
.Wrap = "tw",
.Tagbottom = "tb",
.NextColor = "tn",
- .Crt = "tr",
// the theme picker joins the toggles it belongs with; `Theme` itself takes
// a NAME, and a key path can never carry one, so it has none (the same
// reason Look and Exec have none)
@@ -180,20 +179,39 @@ pub const leader_path = paths: {
.Look = null,
.Exec = null,
});
- // The GUI's two font builtins, in the same `t` group as the theme picker
- // they mirror — but set here rather than named above, because on tty and
- // web they are not builtins at all (see builtins.zig) and the literal's
- // type has no field to write. `Font` takes a NAME, so it has no path, for
- // the same reason `Theme` has none.
- if (pardes.font_picker) {
+ // The GUI's font setting and picker, in the same `t` group as the theme
+ // picker they mirror. Their explicit availability metadata means tty and
+ // web Builtin enums have no fields for them. `Font` takes a NAME and
+ // `TaglineSize` takes a percentage, so neither has a path: a leader chord
+ // cannot carry either argument.
+ if (builtins.capabilities.font_picker) {
table.set(.FontSel, "tf");
table.set(.Font, null);
+ table.set(.TaglineSize, null);
}
- // The pane-local PDF commands exist only in MuPDF builds (their run
- // declarations deliberately change shape when the feature is off), so
- // name their paths through the same comptime branch rather than making
- // feature-off enums mention them. PdfTint/PdfFit retain their display
- // slots and PdfSections takes the mnemonic `s` between them.
+ // Panel transitions are implemented by the fixed cell grid in TTY and by
+ // shader-capable native GUI shells. The DOM web shell does not advertise
+ // them until it has an equivalent renderer.
+ if (builtins.capabilities.panel_transitions) {
+ table.set(.PanelSlide, "as");
+ table.set(.PanelZoom, "az");
+ table.set(.PanelDissolve, "ad");
+ table.set(.PanelAscii, "aa");
+ table.set(.PanelVertical, "av");
+ }
+ if (builtins.capabilities.scene_shaders) {
+ table.set(.Crt, "tr");
+ table.set(.Ripple, "tR");
+ table.set(.Glitch, "tg");
+ }
+ // Takes the name of an effect builtin; a leader path cannot carry it.
+ // The web build has no runnable effect argument, so it has no command,
+ // help row, dispatcher case, or leader entry for EffectCode either.
+ if (builtins.EffectCode.enabled) table.set(.EffectCode, null);
+ // The pane-local PDF commands exist only in MuPDF builds through their
+ // explicit registry availability, so name their paths inside the same
+ // comptime branch. PdfTint/PdfFit retain their display slots and
+ // PdfSections takes the mnemonic `s` between them.
if (pardes.pdf_enabled) {
table.set(.PdfTint, "ti");
table.set(.PdfSections, "ts");
@@ -328,10 +346,11 @@ pub const tty_blank: enum { prompt, prompt_and_input } = .prompt;
// is where topbar clicks land, so its exact bytes are load-bearing (every
// snapshot golden records the column each word starts at). Comptime-checked
// against the enum in pardes.zig so a rename cannot silently rot it.
-// Colors and Crt are NOT here: both are set-once display switches you flip and
-// forget, and a bar you read every frame should not spend width on them now
-// that `SPC t c` / `SPC t r` press them. NextColor stays — it is the one you
-// cycle repeatedly, so a click beats a three-key path.
+// Colors and the scene/panel effects are NOT here: they are display switches
+// you flip and forget, and a bar read every frame should not spend width on
+// them now that their leader paths are discoverable through Help. NextColor
+// stays — it is the one you cycle repeatedly, so a click beats a three-key
+// path.
//
// Ordered by day-to-day usefulness, in stable functional groups: creation
// (New/Newcol), search/navigation (Find/Grep), learning (Help/Tutor), session
@@ -431,6 +450,21 @@ pub const search_submit: []const Chord = &.{.{ .cp = Key.enter }};
pub const wheel_rows: i32 = 1;
pub const wheel_cols: i32 = 4;
+/// Enabled by default: rest the pointer over text for this many animation
+/// frames before showing the exact span a right-click Look would expand.
+/// Repeated motion inside the same cell does not restart the count; moving to
+/// another cell does. Set to `null` to compile the preview out while retaining
+/// ordinary mouse hover and resize-handle hints.
+pub const look_preview_delay_frames: ?u16 = 2;
+
+/// GUI shells rasterize pane-tag text at this percentage of the body face
+/// while retaining the same cell geometry. TTY ignores the visual role.
+pub const gui_tagline_font_percent: u8 = 82;
+comptime {
+ if (gui_tagline_font_percent == 0 or gui_tagline_font_percent > 100)
+ @compileError("config.gui_tagline_font_percent must be in 1...100");
+}
+
/// Touchpad drift guard, in ticks. A two-finger swipe that is MEANT to be
/// vertical carries a little sideways drift, and the pad faithfully turns that
/// drift into wheel_left/wheel_right — so a plain scroll slides the view
@@ -669,6 +703,7 @@ pub const pipe_marker = " |";
pub const search_buffer = "+Search";
pub const help_buffer = "+Help";
pub const config_buffer = "+Config";
+pub const effect_code_buffer = "+EffectCode";
pub const jumps_buffer = "+Jumps";
pub const themes_buffer = "+Themes";
pub const fonts_buffer = "+Fonts";