Skip to content

make alt + up/down work on all screens#624

Draft
woeps wants to merge 10 commits intoxiphonics:masterfrom
woeps:generalize-jump-to-next-section
Draft

make alt + up/down work on all screens#624
woeps wants to merge 10 commits intoxiphonics:masterfrom
woeps:generalize-jump-to-next-section

Conversation

@woeps
Copy link
Copy Markdown
Contributor

@woeps woeps commented Jun 2, 2025

Fix #562.

Imlement jumpToNextSection in all sections.

Remarks

I'm not sure how to optimize the (somehow repetetive) code to reduce binary size. Using generics could at least reduce line of code in source code, but I'm not sure about the compiled binary. Any suggestions?

Since this is my very first attempt to modify the picoTracker code base, I'm thankfull for any advice.

Current State

Copy link
Copy Markdown
Collaborator

@maks maks left a comment

Choose a reason for hiding this comment

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

@woeps thanks for working on this!
I've left a few minor comments, but in general your code style and approach is fine, but I would suggest holding off doing any more work on this until we've had a chance to agree to the details of the functionality we want implemented in the related issue.

Comment thread sources/Application/Model/BuildNumber.h Outdated
@@ -1 +1 @@
#define BUILD_COUNT "003"
#define BUILD_COUNT "001"
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.

there is no need to change this as this is just a placeholder value that is replaced in GitHub CI (Actions)

#include "Foundation/Types/Types.h"
#define PHRASE_COUNT 0x80
#define NO_MORE_PHRASE 0x81
#define PHRASE_ROW_COUNT 16
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.

👍🏻

Comment thread sources/Application/Model/Project.h Outdated
#include "Song.h"

#define PROJECT_NUMBER "2.1-BETA1"
#define PROJECT_NUMBER "2.1-JumpSection"
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.

this is fine to change in your local test builds but please dont commit this into the PR branch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should I remove the commit changing this completely from the commit-history in the PR branch? Or is reverting it sufficient? (e.g. if PRs are being squashed anyways)

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.

just reverting or a new commit putting the old line back is fine since yes we do squash merge PRs so the commits in a PR branch arent kept anyways

This reverts commit 085d8e8.

Project number & build count are being set in GitHub Actions.
@woeps
Copy link
Copy Markdown
Contributor Author

woeps commented Jun 3, 2025

I encountered a strange rendering, when the cursor is in the Phrase View and on one of both params columns. After jumpToNextSection the cursor is rendered twice on screen (previous position and result of the jump) until the next cursor movement.
I'm trying to understand if I did something wrong or if this surfaced a potential bug. What is strange about this is, that it works fine in the other columns and only happens when the cursor is in one of the param columns.

In this part of jumpToNextSection the handling for param1 column is done, basically just calculating the correct value for the current variable:

// Param1 column
case 3: {
for (int i = 0; i < PHRASE_ROW_COUNT; i++) {
ushort param = phrase_->param1_[phraseStart + current];
if (foundGap && param != 0) {
break;
} else if (param == 0) {
foundGap = true;
}
current += direction;
if (current < 0)
current += PHRASE_ROW_COUNT;
if (current >= PHRASE_ROW_COUNT)
current -= PHRASE_ROW_COUNT;
}
break;
}

Finally PhraseView::row_ is set to current and PhraseView::isDirty_ is set to true:

// update view
row_ = current;
isDirty_ = true;

@maks
Copy link
Copy Markdown
Collaborator

maks commented Jun 3, 2025

I encountered a strange rendering, when the cursor is in the Phrase View and on one of both params columns. After jumpToNextSection the cursor is rendered twice on screen (previous position and result of the jump) until the next cursor movement. I'm trying to understand if I did something wrong or if this surfaced a potential bug. What is strange about this is, that it works fine in the other columns and only happens when the cursor is in one of the param columns.

In this part of jumpToNextSection the handling for param1 column is done, basically just calculating the correct value for the current variable:

// Param1 column
case 3: {
for (int i = 0; i < PHRASE_ROW_COUNT; i++) {
ushort param = phrase_->param1_[phraseStart + current];
if (foundGap && param != 0) {
break;
} else if (param == 0) {
foundGap = true;
}
current += direction;
if (current < 0)
current += PHRASE_ROW_COUNT;
if (current >= PHRASE_ROW_COUNT)
current -= PHRASE_ROW_COUNT;
}
break;
}

Finally PhraseView::row_ is set to current and PhraseView::isDirty_ is set to true:

// update view
row_ = current;
isDirty_ = true;

Hmm @woeps sorry dont have time to look into this in detail just now but this sounds vaguely like what I fixed in #595 for the Table screen

@woeps
Copy link
Copy Markdown
Contributor Author

woeps commented Jun 3, 2025

I'm not expecting anybody to solve my issues. I just hoped to get a hint if something looks familiar.

Thank you @maks .

woeps added 3 commits June 3, 2025 17:22
… col

This fixes the cursor being rendered twice after jumpToNextSection in
one of the param columns in the PhraseView.
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.

make alt + up/down work on all screens

2 participants