Skip to content

refactor: fix the causes behind fixable suppressions - #257

Merged
Lemkinator merged 10 commits into
mainfrom
refactor/fixable-suppressions
Sep 30, 2026
Merged

Lemkinator merged 10 commits into
mainfrom
refactor/fixable-suppressions

Conversation

@Lemkinator

@Lemkinator Lemkinator commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes the causes behind suppressions that had a real fix, and removes those suppressions.

  • 3c02c45 TabIconsFragment passes swipe callbacks as lambdas with underscore parameters, so UNUSED_PARAMETER goes away.
  • dcf660b QSTileService drops the super-only onCreate and onStopListening overrides, so redundantOverride and EmptyMethod go away.
  • 54cacd2 Decorative images (about-screen app icon, settings dialog separators) use importantForAccessibility="no" instead of suppressing ContentDescription.
  • 2cd99f4 The SearchView separator label moves to a non-translatable string. The icon list image becomes decorative instead of announcing a hardcoded "Icon". Both HardcodedText suppressions go away.
  • 4e65cfd openAppLocaleSettings declares @RequiresApi(TIRAMISU) instead of suppressing InlinedApi.
  • 6d29118 FakeSharedPreferences reads string sets with filterIsInstance, so UNCHECKED_CAST goes away.
  • 7e38259 The release DebugTools drops a stale UnusedParameter suppression. detektReleaseSourceSet passes without it. The commit message wrongly says detekt does not analyze the release source set.
  • 113cfa7 narrowed the openURL catch to SecurityException. e5157fb reverts that and keeps the broad catch with the error toast.

Behavior changes

  • TalkBack skips 4 decorative images and no longer announces "Icon" on list items.
  • openURL keeps its broad catch: every failure shows the error toast. Net behavior matches main.
  • QSTileService super-only overrides are deleted. The lifecycle stays identical.

Coverage

  • COVERAGE 100/100, floors 100/100.

Verification

  • spotlessCheck detekt lintDebug testDebugUnitTest koverVerifyDebug verifyRoborazziDebug pass at head e5157fb.
  • assembleRelease and GMD pixel9Api35DebugAndroidTest pass on an earlier commit of this branch.
  • No golden is re-recorded.

Notes

Kept suppressions, each with a reason:

  • sesl RestrictedApi / PrivateResource.
  • Menu AppCompatResource / AlwaysShowAction.
  • QSTileService unused and sem* SameReturnValue: Samsung calls these by reflection.
  • SDK-gated DEPRECATION.
  • Manifest QueryAllPackages (app picker) and ExportedReceiver (Samsung facewidget).
  • leak_canary UnusedResources.
  • Hilt runner / test application and KSP unused.
  • IconAdapter IncorrectFormatting.
  • openURL TooGenericExceptionCaught: the broad catch stays by design.
  • strings.xml "Ok" ButtonCase / Typos: the text is intended.
  • TabPickerFragment UsePropertyAccessSyntax: IDE-only, setIs24HourView/is24HourView form no Kotlin property.

🤖 Generated with Claude Code

https://claude.ai/code/session_016XZN5ZKzGWBCHZwRwfNFtb

Summary

  • Added lifecycle logging for QSTileService and a test for the logged messages.
  • Replaced the locale API suppression with @RequiresApi(TIRAMISU).
  • Updated accessibility settings and added a non-translatable SearchView label.
  • Replaced swipe callback methods with function-valued properties.
  • Removed the unchecked cast in FakeSharedPreferences.getStringSet and a stale release suppression.

startActivity documents ActivityNotFoundException and SecurityException as its
failure modes; catching every Exception also hid programming errors. Other
exceptions now propagate, which the new test pins.
…ters

configureItemSwipeAnimator hands the view holder and action state to its
callbacks although the icon tab needs neither; lambdas with an underscore
parameter express that without suppressing UNUSED_PARAMETER.
onCreate and onStopListening only called super, so they needed
redundantOverride and EmptyMethod suppressions without changing behavior.
The about-screen app icon sits next to the app name, and the settings dialog
separators carry no information, so TalkBack skips them instead of the layouts
suppressing ContentDescription.
The SearchView separator label moves to a non-translatable string like the
other widget-name labels. The icon list image repeats the name shown beside it,
so it is decorative instead of announcing a hardcoded "Icon".
ACTION_APP_LOCALE_SETTINGS exists from API 33 and the only caller is gated on
TIRAMISU; @RequiresApi states that contract for lint instead of suppressing
InlinedApi.
…cast

filterIsInstance yields the typed set directly, so the UNCHECKED_CAST
suppression goes away.
…ools

detekt does not analyze the release source set, so the suppression never
applied.
Starting an external activity throws an open-ended set of exceptions; a narrowed catch turns a failed link into a crash instead of the error toast.
@mergestorm-vortex

mergestorm-vortex Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Plan limit reached

You've used all Starter plan credits for this billing period (70 limit), so this pull request was not reviewed (c67b15c).

Upgrade to a higher plan or wait until your next billing period: See plans on the billing page

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 3936b0e7-9050-480c-a0be-23683256c74b

📥 Commits

Reviewing files that changed from the base of the PR and between e5157fb and c67b15c.

📒 Files selected for processing (2)
  • app/src/main/java/de/lemke/oneuisample/ui/QSTileService.kt
  • app/src/test/java/de/lemke/oneuisample/ui/QSTileServiceTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The changes add lifecycle logging to QSTileService and a test for log order. They also update swipe callback declarations, layout accessibility attributes, a string resource, and test-fixture set handling.

Changes

UI and Kotlin updates

Layer / File(s) Summary
Tile lifecycle logging and API declaration
app/src/main/java/de/lemke/oneuisample/ui/QSTileService.kt, app/src/test/java/de/lemke/oneuisample/ui/QSTileServiceTest.kt, app/src/main/java/de/lemke/oneuisample/ui/SettingsActivity.kt
QSTileService logs onCreate and onStopListening. Its test checks that the log messages appear in that order. SettingsActivity replaces a lint suppression with @RequiresApi(TIRAMISU) on the locale-settings method.
Swipe callback properties
app/src/main/java/de/lemke/oneuisample/ui/fragments/TabIconsFragment.kt
SwipeHandler exposes swipe enablement and callback behavior as properties. The animator uses those properties; swipe behavior remains unchanged.
Layout accessibility and label resource
app/src/main/res/layout/activity_custom_about.xml, app/src/main/res/layout/dialog_settings.xml, app/src/main/res/layout/fragment_tab_design_subtab_widgets.xml, app/src/main/res/layout/icon_listview_item.xml, app/src/main/res/values/strings.xml
Layouts mark specified images as unimportant for accessibility. The SearchView label now uses the search_view_label string resource.
Helper warning and type handling
app/src/release/java/de/lemke/oneuisample/DebugTools.kt, app/src/testFixtures/java/de/lemke/oneuisample/data/FakeSharedPreferences.kt
DebugTools removes an unused-parameter suppression. FakeSharedPreferences filters stored set elements to strings before returning a mutable set.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to c67b1

No material merge-blocking behavior change was established; the locale-settings action remains unavailable below API 33.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing fixable suppression causes through refactoring.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit logs the tile’s next call,
Then checks the message order, all.
A swipe callback hops along,
Labels find their string, not song.
Quiet icons rest from sight,
String sets keep their types just right.

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Removes compiler warnings from UI and test code.

The PR appears safe to merge, though the tile lifecycle logging is unnecessary.

Fix All in Claude CodeFindings

  1. P2 Unnecessary lifecycle logging ▶
Fix with agent prompt
### Issue 1
app/src/main/java/de/lemke/oneuisample/ui/QSTileService.kt:34
The restored `onCreate` and `onStopListening` overrides only call `super` and write debug logs. Because these methods run in the production tile lifecycle, they add log output and maintenance without doing any service work. Removing the overrides would avoid the suppressions without adding those side effects.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary

The PR replaces several suppressions with accessibility attributes, a string resource, an API annotation, and a checked string-set conversion. Since the previous review, it also restores two tile lifecycle overrides with debug logging and adds a test for those logs.

Reviews (2) · Last reviewed commit: "feat: log QSTileService onCreate and onS..."

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

The sample demos the TileService lifecycle, so both callbacks are
overridden again with a Log.d line. The log call gives each override
a body beyond super, so neither needs a redundantOverride or
EmptyMethod suppression. A Robolectric test pins the logged messages.
override fun onCreate() {
// Called by the system when the service is first created.
super.onCreate()
Log.d(TAG, "onCreate")

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 Unnecessary lifecycle logging The restored onCreate and onStopListening overrides only call super and write debug logs. Because these methods run in the production tile lifecycle, they add log output and maintenance without doing any service work. Removing the overrides would avoid the suppressions without adding those side effects.

Prompt To Fix With AI
This is a comment left during a code review.
Path: app/src/main/java/de/lemke/oneuisample/ui/QSTileService.kt
Line: 34

Comment:
**Unnecessary lifecycle logging** The restored `onCreate` and `onStopListening` overrides only call `super` and write debug logs. Because these methods run in the production tile lifecycle, they add log output and maintenance without doing any service work. Removing the overrides would avoid the suppressions without adding those side effects.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@Lemkinator
Lemkinator merged commit 4db4a18 into main Sep 30, 2026
10 checks passed
@Lemkinator
Lemkinator deleted the refactor/fixable-suppressions branch September 30, 2026 19:27
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.

1 participant