Skip to content

Conversation

@john-mutuma
Copy link
Owner

@john-mutuma john-mutuma commented Oct 7, 2025

What does this PR do?

Adds a reusable backdrop utility function and integrates it with the scooter terminal for better visual depth and code reusability.

Changes:

  • Extract create_backdrop function in windows.lua for creating backdrop windows
  • Add automatic highlight setup to create_backdrop function
  • Refactor with_win_backdrop to use the new create_backdrop function (eliminating ~35 lines of duplicate code)
  • Add backdrop support to scooter terminal with on_open/on_close lifecycle management
  • Update scooter terminal configuration (winblend: 12, width: 175)
  • Adjust lazygit window scaling factor from 0.85 to 0.8
  • Update scooter.config.toml preview settings

Why is it needed?

  1. Code Reusability - The backdrop creation logic was duplicated between functions; now it's a reusable utility that can be used across the codebase
  2. Better UX - Semi-transparent backdrop (60% blend) provides visual separation for floating windows, making the scooter terminal stand out
  3. Automatic Management - Backdrop lifecycle is tied to window lifecycle via callbacks, ensuring no manual cleanup is required
  4. Cleaner API - Highlight setup is now handled automatically by create_backdrop, eliminating duplicate setup code
  5. Proper Z-indexing - Backdrop uses z-index 39, positioned below terminal's default 40, ensuring correct visual layering

How have the changes been tested?

  • Code compiles without errors
  • No LSP diagnostics in modified files
  • Refactoring maintains existing functionality of with_win_backdrop
  • Manual testing pending: Open scooter terminal and verify backdrop appears/disappears correctly

Screenshots (if applicable)

Screenshots will be added after manual testing of the backdrop behavior.

Checklist

  • Code follows project Lua conventions and structure
  • Functions are properly documented with luadoc comments
  • No duplicate code - eliminated ~35 lines of duplication
  • Changes committed with descriptive message following conventional commits format
  • All diagnostics resolved
  • Manual testing completed (scooter terminal open/close with backdrop)
  • Verified no z-index conflicts with other floating windows
  • Tested visual selection search functionality

John Mutuma added 2 commits October 7, 2025 20:35
- Extract create_backdrop function in windows.lua for creating backdrop windows

- Add automatic highlight setup to create_backdrop function

- Refactor with_win_backdrop to use the new create_backdrop function

- Add backdrop support to scooter terminal with on_open/on_close lifecycle

- Update scooter terminal configuration (winblend: 12, width: 175)

- Adjust lazygit window scaling factor from 0.85 to 0.8

- Update scooter.config.toml preview settings

The create_backdrop function provides a reusable way to create semi-transparent

backdrop windows with automatic cleanup, making it easy to add visual depth to

any floating window in the editor.

Signed-off-by: John Mutuma <johnmutuma@microsoft.com>
@john-mutuma john-mutuma force-pushed the continous-development branch from 07f77cf to f4e2d75 Compare October 7, 2025 17:51
@john-mutuma john-mutuma merged commit 17d9a7e into develop Oct 7, 2025
@john-mutuma john-mutuma deleted the continous-development branch October 7, 2025 19:05
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