Skip to content

Enable maxLength on credential entry rows for Adw >= 1.6#75

Merged
zugaldia merged 1 commit intomainfrom
az-maxlength
Mar 14, 2026
Merged

Enable maxLength on credential entry rows for Adw >= 1.6#75
zugaldia merged 1 commit intomainfrom
az-maxlength

Conversation

@zugaldia
Copy link
Owner

Summary

  • Adds isAdwVersionAtLeast(major, minor, micro) utility to AppUtils.kt for runtime libadwaita version checks
  • Adds ADW_MAX_LENGTH_MIN_MAJOR_VERSION / ADW_MAX_LENGTH_MIN_MINOR_VERSION constants (1.6) to AppConstants.kt
  • Conditionally sets maxLength on EntryRow / PasswordEntryRow in AddCredentialDialog only when Adw ≥ 1.6, working around a java-gi crash in earlier versions
  • Refactors the existing startup Adw version check in App.kt to use the new helper

Software-side validation in validateInput() continues to enforce length limits on runtimes older than 1.6.

Test plan

  • Run on Adw ≥ 1.6: verify credential name and API key fields enforce the character limit visually
  • Run on Adw < 1.6: verify no crash, fields accept input freely, and overlong submissions are still rejected by validation
  • Confirm ./gradlew detekt passes cleanly

Add isAdwVersionAtLeast() utility and use it to conditionally set
maxLength on EntryRow/PasswordEntryRow, working around a java-gi crash
present in earlier libadwaita versions. Software-side validation
continues to enforce limits on older runtimes.
@zugaldia
Copy link
Owner Author

Refs: jwharm/java-gi#335.

@zugaldia zugaldia merged commit 62db7ee into main Mar 14, 2026
4 checks passed
@zugaldia zugaldia deleted the az-maxlength branch March 14, 2026 17:59
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