Skip to content

♻️ Refactor rendering functions#280

Open
friedow wants to merge 1 commit into
mainfrom
refactor-rendering
Open

♻️ Refactor rendering functions#280
friedow wants to merge 1 commit into
mainfrom
refactor-rendering

Conversation

@friedow

@friedow friedow commented Apr 28, 2026

Copy link
Copy Markdown
Owner

This changes how centerpiece tracks the selection of entries. The selection state was previously implemented using an active_entry_index as a plain integer. This was problematic if plugins in front of the cursor changed the number of entries they provide, effectively moving the cursor. This PR fixes this by changing the selection state to an active_plugin_id and an active_entry_id instead of using an index.

Furthermore, this PR sets a fixed height for all entries and plugin headers. This fixes rendering issues with inconsistent window heights.

@friedow friedow requested a review from a-kenji April 28, 2026 18:28
@friedow friedow self-assigned this Apr 28, 2026
@friedow friedow changed the title Refactor rendering functions ♻️ Refactor rendering functions Apr 28, 2026
@friedow friedow force-pushed the refactor-rendering branch from 0e31b29 to d211903 Compare April 28, 2026 18:32
Comment thread client/src/main.rs
for plugin_channel in &self.plugin_channels {
let message_result = plugin_channel.try_recv();
if message_result.is_err() {
continue;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

@friedow

friedow commented Apr 28, 2026

Copy link
Copy Markdown
Owner Author

Hey @Ciantic, I just noticed that wayapp is appearently missing functionality to press-and-HOLD keys. When I type something and hold backspace to delete what I typed, it just deletes one character.

@Ciantic

Ciantic commented Apr 28, 2026

Copy link
Copy Markdown

@friedow interesting, I have to investigate, to me holding backspace works like I expect it to. It repeats normally.

Note that current wayapp git repo has IME functionality builtin, this affect with the keyboard somehow.

@friedow

friedow commented Apr 28, 2026

Copy link
Copy Markdown
Owner Author

@friedow interesting, I have to investigate, to me holding backspace works like I expect it to. It repeats normally.

Note that current wayapp git repo has IME functionality builtin, this affect with the keyboard somehow.

Oh interesting, I don't know how IME works but I imagine that either your keyboard or you compositor / window manager does the repeating for you. What desktop stack are you running?

I'm running a pretty barebones niri & NixOS setup setup.

@Ciantic

Ciantic commented Apr 28, 2026

Copy link
Copy Markdown

@friedow I have KDE, but I have found one bug at least, when alt tabbing to the window, backspace and arrows stop working, but inputting letters work. Arrows start working again if I re-activate text input with mouse. So there is some weirdness here.

@Ciantic

Ciantic commented Apr 28, 2026

Copy link
Copy Markdown

@friedow Did you use git version of wayapp? I pushed git change to disable IME, it was causing the issue I was just experiencing.

Comment thread client/src/main.rs
match active_entry {
Some(entry) => Some(&entry.id),
None => None,
fn active_plugin(&self) -> Option<&model::Plugin> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What if Plugin implemented into Iter? They seem to be made for it. We wouldn't have next_plugin, but plugin.next() and also plugin.last().
We can do that in a follow up.

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.

3 participants