Skip to content

refactor: split TextButton.kt into multiple focused files for better organization#1293

Open
aneepal55 wants to merge 1 commit into
Greenstand:masterfrom
aneepal55:Refactor-TextButton.kt
Open

refactor: split TextButton.kt into multiple focused files for better organization#1293
aneepal55 wants to merge 1 commit into
Greenstand:masterfrom
aneepal55:Refactor-TextButton.kt

Conversation

@aneepal55

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request!

Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests are added/updated (if necessary)
  • Ensure the linter passes (./codeAnalysis to automatically apply formatting/linting)
  • Appropriate docs were updated (if necessary)

Fixes #1237 🦕

@Tarek-Bohdima

Copy link
Copy Markdown
Member

Thanks for picking this up @aneepal55 ! The code analysis check failed on some ktlint style violations — running ./codeAnalysis.sh before each commit will auto-fix those and keep CI green.

@cynthiabondi

Copy link
Copy Markdown
Contributor

Good work on the refactor @aneepal55! Please make the corrections as suggested by @Tarek-Bohdima in order to merge.

@cynthiabondi cynthiabondi moved this to Ready for Review in Android Treetracker Jun 1, 2026
@cynthiabondi cynthiabondi added this to the 2.3 milestone Jun 1, 2026

@Tarek-Bohdima Tarek-Bohdima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @aneepal55 — nice work on this, the split itself is clean and test/screenshot CI is green. It's gone stale (~3 weeks) and master has moved, so it needs a rebase before it can land. Three steps:

1. Renumber the task folder. task_18 was taken by #1295/#1296, and task_22 is in-flight on #1303 — please move docs/tasks/task_18/docs/tasks/task_23/.

2. Carry over the #1274 fix (important). While this was open, #1274 merged a global navigation throttle and changed LanguageButton from navigate() to throttledNavigate(). Your new LanguageButton.kt still has the old call, so when you rebase:

  • resolve the TextButton.kt conflict by keeping the deletion (LanguageButton moved out), and
  • in LanguageButton.kt, change navController.navigate(LanguageRoute())navController.throttledNavigate(LanguageRoute()) and add import org.greenstand.android.TreeTracker.utilities.throttledNavigate.

Otherwise the rebase silently drops the crash fix and the white-screen-on-rapid-tap bug comes back — the conflict shows up in TextButton.kt, but the line that matters is in your new file.

3. Run ./codeAnalysis.sh to clear the code analysis (ktlint) failure, then push.

Could you do this in the next couple of days? If you can't get back to it, no worries — say the word and we'll finish the rebase so it makes 2.3. Thanks again!

@cynthiabondi

Copy link
Copy Markdown
Contributor

@Tarek-Bohdima , I will find someone else to work on this task as @aneepal55 is no longer available.

@github-actions

Copy link
Copy Markdown

👋 Hi @aneepal55, thanks for the contribution!

Before this PR can be reviewed and merged, please add:

  • a 🎥 screen recording / video demonstrating the change — a video is required even when there are no UI changes, to show that the parts of the app affected by this change still work
  • a 🖼️ screenshot of the UI change (or mark the PR as non-ui if there is no UI change)

Just drag-and-drop the file(s) into the PR description and GitHub will upload them. This check re-runs automatically when you edit the description.

If this change has no user-visible effect, tick the "no user-visible / UI effect" box in the description (or ask a maintainer to add the non-ui label) to skip the screenshot requirement. A video is still required even with no UI changes, to show that the affected parts of the app still work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

Refactor TextButton.kt — extract sub-composables (512 lines)

4 participants