Skip to content

fix: resolve Lua migration regressions - #1879

Merged
kRHYME7 merged 7 commits into
HyDE-Project:devfrom
JaredBautist:fix/lua-migration-regressions
Jul 29, 2026
Merged

fix: resolve Lua migration regressions#1879
kRHYME7 merged 7 commits into
HyDE-Project:devfrom
JaredBautist:fix/lua-migration-regressions

Conversation

@JaredBautist

@JaredBautist JaredBautist commented Jul 29, 2026

Copy link
Copy Markdown

Description

This fixes several regressions that remained after the Hyprland Lua configuration migration:

  • restore the public/documented HyDE keybind contract in key_binds.lua, including screenshots, scratchpads, workspace scrolling, media keys, selectors, grouping, and resize actions;
  • make the bare Print key call the full-screen screenshot action instead of the monitor action;
  • replace the stale experimental Grimblast source with its fixed official upstream, removing the double slurp prompt and invalid mixed window/monitor geometry;
  • default Satty to the compatible GTK GL renderer when no explicit GSK_RENDERER override is configured, preventing a black annotation preview when launched from Hyprland;
  • isolate hyde-shell app from an unrelated exported DEBUG value by providing explicit defaults for APP2UNIT_DEBUG and XTE_DEBUG;
  • align the generated desktop startup schema with batterynotify.lua, replacing the removed batterynotify.sh command;
  • update the keybinding reference and changelog;
  • add regression coverage for the documented shortcuts, screenshot dispatch, app-wrapper environment, and generated startup artifacts.

The app-wrapper failure can be reproduced by launching an application through hyde-shell app from an environment that exports DEBUG=release. app2unit previously interpreted the generic value as a boolean and emitted:

Error
Assuming 'release' means no

The screenshot regression can be reproduced by pressing Print: the Lua binding previously dispatched hyde-shell screenshot m (monitor) rather than hyde-shell screenshot p (full screen).

The area-capture regression can be reproduced with Super + P: the pinned experimental Grimblast branch invokes slurp once for the output and then again for the actual region/window. For window choices it also combines the first output geometry with a toplevel handle. The corrected official upstream performs one selection and passes either region geometry or the selected window handle.

After that selection completes, Satty can open as a fully black window when launched through Hyprland's Lua dispatcher with the default GTK renderer. Running the same command with GSK_RENDERER=gl renders both the captured image and Satty's toolbars correctly. The wrapper now supplies that compatible default only for Satty and preserves any explicit user override.

After the migration moves the superseded batterynotify.sh aside, a config generated from the committed schema still tries to start it. This produces an Executable not found: 'batterynotify.sh' desktop notification even though the replacement batterynotify.lua is installed and the Lua defaults already reference it.

The existing v26.7.4 migration on dev already handles obsolete selector scripts; this PR addresses the remaining runtime and keybinding regressions.

Related: #1863

No new dependencies are required.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (non-breaking change; modified files are limited to the documentations)
  • Technical debt (a code change that does not fix a bug or add a feature but makes something clearer for devs)
  • Other (provide details below)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My commit message follows the commit guidelines.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added a changelog entry.
  • I have added necessary comments/documentation to my code.
  • I have added tests to cover my changes.
  • I have tested my code locally and it works as expected.
  • All new and existing tests passed.

Validation

  • sh tests/run.sh: 8 cases, 0 failures
  • ShellCheck 0.11.0: 106 shell files passed at error severity
  • pre-commit hooks: all passed for the changed files
  • Hyprland --verify-config: config ok
  • controlled area capture: one slurp invocation and a valid non-black 1920x1080 PNG
  • Hyprland-dispatched Satty run: captured image and annotation toolbars rendered correctly
  • the new binding and app-wrapper checks fail against the current origin/dev baseline and pass with this patch

Screenshots

Not applicable; these are configuration, command-dispatch, and environment-handling fixes.

Additional context

The restored combinations follow the repository's published KEYBINDINGS.md behavior. The regression tests assert both key/modifier presence and the exact screenshot command dispatched by each shortcut.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed launcher errors when DEBUG contains non-boolean values.
    • Corrected Hyprland shortcuts for window management, screenshots, workspaces, Waybar, and navigation.
    • Fixed screenshot capture for selected areas and all monitors.
    • Satty now uses a compatible renderer by default.
    • Restored battery notifications at desktop startup.
  • Documentation

    • Updated keybinding, configuration, and changelog documentation.
  • Tests

    • Added coverage for launcher debug handling, schemas, screenshots, and keybinding behavior.

Restore the documented HyDE keymap in the Lua configuration, fix the all-monitors screenshot action, and isolate app2unit from unrelated DEBUG values. Add regression coverage for the public shortcuts and app wrapper environment.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The app wrapper now isolates debug variables. Hyprland Lua shortcuts, battery notification defaults, Satty rendering, Grimblast sourcing, documentation, changelog entries, and regression tests are updated.

Changes

Runtime and keybinding corrections

Layer / File(s) Summary
App wrapper debug defaults
Configs/.local/lib/hyde/app.sh, tests/test_app_wrapper.sh, tests/README.md
Exports scoped debug defaults before path selection and tests defaults, overrides, direct launches, and systemd launches.
Hyprland shortcut updates
Configs/.local/share/hypr/lua/key_binds.lua, tests/lua/bind_harness.lua, KEYBINDINGS.md
Remaps window, layout, audio, screenshot, wallpaper, Waybar, and workspace shortcuts and validates documented bindings.
Battery notification schema migration
Configs/.local/share/hyde/schema/*, tests/test_schema.sh
Changes battery autostart defaults and schema references from batterynotify.sh to batterynotify.lua.
Satty renderer handling
Configs/.local/lib/hyde/screenshot.sh, tests/test_screenshot_wrapper.sh
Defaults Satty to GSK_RENDERER=gl when unset and preserves explicit renderer overrides.
Grimblast source and release notes
Scripts/dots/hyde.toml, tests/test_dots.sh, CHANGELOG.md
Uses the upstream Grimblast main branch, validates the source configuration, and records the related fixes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

Possibly related PRs

Suggested labels: bug

Suggested reviewers: krhyme7

Poem

A bunny hops through keys anew,
Debug flags settle into view.
Lua binds spring, screenshots glow,
Battery scripts now softly flow,
Grimblast carrots grow.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main theme of the PR: fixing regressions introduced by the Lua migration.
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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/test_app_wrapper.sh (1)

8-11: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise the non-systemd branch instead of skipping it.

When systemd is unavailable, this test exits successfully without running any assertions. That leaves the direct exec "$@" path—the path where the wrapper currently fails to export the scoped debug defaults—untested. Add a fallback-path case, including the xdg-terminal-exec consumer documented in tests/README.md Line 22, or guarantee a complementary non-systemd CI job.

🤖 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 `@tests/test_app_wrapper.sh` around lines 8 - 11, Update the systemd
availability guard in the test setup so unavailable systemd does not simply skip
coverage; add a non-systemd fallback case that exercises the wrapper’s direct
exec "$@" path, including the xdg-terminal-exec consumer documented in
tests/README.md, or provide an equivalent dedicated non-systemd CI job.
🤖 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 `@Configs/.local/lib/hyde/app.sh`:
- Around line 9-15: Move the APP2UNIT_DEBUG and XTE_DEBUG default assignments
and export in app.sh above the sys availability check, so both the systemd path
and the direct exec "$@" path initialize scoped values while preserving
user-provided settings.

In `@tests/lua/bind_harness.lua`:
- Around line 242-280: Add the omitted restored shortcuts to the
required_defaults table: SUPER + SHIFT + G, SUPER + SHIFT + P, SUPER + CTRL + S,
SUPER + SHIFT + W, SUPER + SHIFT + R, and SUPER + SHIFT + T. Extend the
screenshot_commands coverage so the relevant OCR shortcut dispatches hyde-shell
screenshot sc, preserving the existing canonical lookup and assertion patterns.

---

Nitpick comments:
In `@tests/test_app_wrapper.sh`:
- Around line 8-11: Update the systemd availability guard in the test setup so
unavailable systemd does not simply skip coverage; add a non-systemd fallback
case that exercises the wrapper’s direct exec "$@" path, including the
xdg-terminal-exec consumer documented in tests/README.md, or provide an
equivalent dedicated non-systemd CI job.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ff830570-af8e-4851-8362-6699135510e5

📥 Commits

Reviewing files that changed from the base of the PR and between d5b2854 and 584835b.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • Configs/.local/lib/hyde/app.sh
  • Configs/.local/share/hypr/lua/key_binds.lua
  • KEYBINDINGS.md
  • tests/README.md
  • tests/lua/bind_harness.lua
  • tests/test_app_wrapper.sh

Comment thread Configs/.local/lib/hyde/app.sh Outdated
Comment thread tests/lua/bind_harness.lua
Apply scoped debug defaults before selecting the systemd or direct execution path. Exercise xdg-terminal-exec without systemd and extend the restored keybinding assertions.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/test_app_wrapper.sh (1)

46-58: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy lift

Make systemd-path coverage independent of the host.

On non-systemd CI, the only runtime assertions for app2unit are skipped. The source-order check does not prove that the systemd branch exports the correct values; add a test seam or otherwise exercise both execution paths explicitly.

🤖 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 `@tests/test_app_wrapper.sh` around lines 46 - 58, The test currently skips all
runtime assertions when systemd is unavailable, so it does not verify both
app2unit execution paths. Update the test around the systemd detection and
wrapper invocation to add a seam or controlled override that exercises the
systemd and non-systemd branches independently, then assert APP2UNIT_DEBUG and
XTE_DEBUG default to 0 for each path while retaining relevant ordering
validation.
🤖 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 `@tests/test_app_wrapper.sh`:
- Around line 30-44: Add a test case in the app wrapper test around the existing
DEBUG environment setup that exports explicit nonzero APP2UNIT_DEBUG and
XTE_DEBUG values before invoking the wrapper. Assert the corresponding
APP2UNIT_CONSUMER_DEBUG and XTE_CONSUMER_DEBUG outputs preserve those
caller-provided values, while retaining the existing unset-variable coverage.

---

Nitpick comments:
In `@tests/test_app_wrapper.sh`:
- Around line 46-58: The test currently skips all runtime assertions when
systemd is unavailable, so it does not verify both app2unit execution paths.
Update the test around the systemd detection and wrapper invocation to add a
seam or controlled override that exercises the systemd and non-systemd branches
independently, then assert APP2UNIT_DEBUG and XTE_DEBUG default to 0 for each
path while retaining relevant ordering validation.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ec93be4-b5b2-467b-b092-cbcc9c875a38

📥 Commits

Reviewing files that changed from the base of the PR and between 584835b and f94550a.

📒 Files selected for processing (4)
  • Configs/.local/lib/hyde/app.sh
  • tests/README.md
  • tests/lua/bind_harness.lua
  • tests/test_app_wrapper.sh
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/README.md
  • Configs/.local/lib/hyde/app.sh
  • tests/lua/bind_harness.lua

Comment thread tests/test_app_wrapper.sh
Cover caller-provided APP2UNIT_DEBUG and XTE_DEBUG values in addition to the unrelated DEBUG fallback regression.
Keep generated desktop startup defaults aligned with the Lua implementation installed by the migration. Add regression coverage so removed shell commands cannot return through generated schema artifacts.
Replace the stale experimental toplevel branch with upstream main, which performs a single slurp selection and avoids combining monitor geometry with window capture. Guard the installer source with the dotfile regression test.
Default Satty to the compatible GSK GL renderer when launched from Hyprland while preserving explicit user overrides. Add wrapper regression coverage.
@JaredBautist

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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