Skip to content

Change HomeScreen.kt topbar behaviour#1903

Merged
theovilardo merged 1 commit into
masterfrom
impr/homescreen-topbar
May 5, 2026
Merged

Change HomeScreen.kt topbar behaviour#1903
theovilardo merged 1 commit into
masterfrom
impr/homescreen-topbar

Conversation

@theovilardo

Copy link
Copy Markdown
Collaborator

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b34884622c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 235 to +236
val isScrolledPastThreshold = remember {
derivedStateOf { listState.firstVisibleItemIndex > 0 || listState.firstVisibleItemScrollOffset > 180 }
derivedStateOf { listState.firstVisibleItemIndex > 0 || listState.firstVisibleItemScrollOffset > scrollThresholdPx }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recreate derived scroll state when density changes

isScrolledPastThreshold is created with remember { ... } but reads scrollThresholdPx, so when LocalDensity changes at runtime (for example after display-size/font-scale changes in a live composition), the derived state keeps using the old captured threshold and the top bar transition triggers at the wrong offset until recreation. Key the remember with scrollThresholdPx (or compute threshold inside the derived block) so the threshold actually updates with density.

Useful? React with 👍 / 👎.

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.

This is correct.

@daedaevibin

daedaevibin commented May 5, 2026

Copy link
Copy Markdown
Contributor

@theovilardo

Spotted by Gemini:


Caution

Compilation Error: Duplicate Parameter
You are passing animationSpec twice to animateFloatAsState. This will likely prevent the code from compiling. You should choose either the spring() or the tween() spec.

@theovilardo theovilardo merged commit ae3367a into master May 5, 2026
5 checks passed
@theovilardo

Copy link
Copy Markdown
Collaborator Author

Hi! This is weird, seems like a git error, my build worked fine with this changes

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