Conversation
📝 WalkthroughWalkthroughThis PR replaces the enum-based TextSize system with a Float-based TextSizeSp and new FloatPreference types, splits the single text-size preference into separate note-editor and overview preferences, adds a seekbar preview UI for live text-size previews, updates UI bindings and view holders to use float sizes, adjusts layouts for Flow/ConstraintLayout, and updates string resources and TRANSLATIONS.md counts. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Slider_UI as Slider (Seekbar)
participant Preview as PreviewTextView
participant Pref as FloatPreference
participant Model as ViewModel
User->>Slider_UI: touch start
Slider_UI->>Preview: setVisible(true)
User->>Slider_UI: drag / change value
Slider_UI->>Preview: updateTextSize(value → TextSizeSp)
Preview-->>User: show preview with new size
User->>Slider_UI: release
Slider_UI->>Preview: setVisible(false)
Slider_UI->>Pref: apply value (onStop -> persist)
Pref-->>Model: preference updated (onChange callback)
Model-->>UI: observe -> update dependent UI sizes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt (1)
71-71: Avoid snapshotting a mutable preference in the ViewModel.Line 71 freezes the editor text size at
NotallyModelcreation time, so any later settings change can leave editor-side consumers on a stale size until the ViewModel is recreated. Expose this as a getter instead.♻️ Suggested change
- val textSize = preferences.textSizeNoteEditor.value + val textSize: Int + get() = preferences.textSizeNoteEditor.value🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt` at line 71, The ViewModel currently snapshots the mutable preference by declaring val textSize = preferences.textSizeNoteEditor.value in NotallyModel, which freezes the size at construction; change textSize to a computed property (e.g., a getter that returns preferences.textSizeNoteEditor.value) so consumers always read the latest value from preferences.textSizeNoteEditor, and update any usages to read the property instead of relying on a captured value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@app/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/PreferenceBindingExtensions.kt`:
- Around line 520-549: The helper is registering duplicate listeners: remove the
extra Slider listeners here (the addOnChangeListener { ... } and the
addOnSliderTouchListener { ... onStopTrackingTouch { onChange(...) } }) so you
don't write the preference twice or accumulate change listeners; rely on the
existing setup(...) save-on-stop behavior and only keep the PreviewText
initialization (setTextSize and isVisible) or, if you still need live preview
updates, add a single non-duplicating listener pattern (store the listener
reference and remove it before re-adding) instead of registering anonymous
listeners each bind; update the code around setup(), PreviewText, Slider,
addOnChangeListener, addOnSliderTouchListener, and onStopTrackingTouch
accordingly.
In `@app/src/main/java/com/philkes/notallyx/presentation/view/main/BaseNoteVH.kt`:
- Line 162: The list-card preview TextViews in bindList() (the
HighlightableTextView instances populated for list items) are not applying the
overview text-size; update bindList() to pass
preferences.textSize.displayBodySize when setting text on those
HighlightableTextView(s) (similar to how Title, Date, Note and
binding.ReminderChip.setupReminderChip already use displayBodySize) and ensure
the HighlightableTextView population logic uses that value to set text size (or
calls the same resizing helper used for Title/Date/Note) so list-note cards
respect textSizeOverview.
In
`@app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.kt`:
- Around line 33-36: NotallyXPreferences currently declares IntPreference
instances textSizeNoteEditor and textSizeOverview but doesn't migrate the legacy
textSize enum/string, so existing users lose their size; add a one-time
migration in NotallyXPreferences (run before instantiating/reading
IntPreference) that checks the legacy "textSize" key, maps its enum/string
values to the corresponding integer sizes, writes that mapped int into both
"textSizeNoteEditor" and "textSizeOverview" in the same preferences backend, and
then remove or mark the legacy key as migrated; ensure this runs early (e.g., in
NotallyXPreferences init or a migrateLegacyTextSize() called before creating
textSizeNoteEditor/textSizeOverview) and reference these property names when
setting the new values.
In `@app/src/main/res/values-it/strings.xml`:
- Line 291: The Italian strings file only includes text_size_note_editor; add
the missing Italian translations for the new text-size keys introduced by the PR
(match the exact resource names from the default strings.xml such as the
overview/preview keys, e.g., text_size_overview and text_size_preview or
whatever keys exist) into values-it/strings.xml so the settings are fully
translated; locate the new keys by checking the base/default strings.xml and add
corresponding Italian entries alongside the existing text_size_note_editor.
---
Nitpick comments:
In
`@app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt`:
- Line 71: The ViewModel currently snapshots the mutable preference by declaring
val textSize = preferences.textSizeNoteEditor.value in NotallyModel, which
freezes the size at construction; change textSize to a computed property (e.g.,
a getter that returns preferences.textSizeNoteEditor.value) so consumers always
read the latest value from preferences.textSizeNoteEditor, and update any usages
to read the property instead of relying on a captured value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 81bd1f26-2c9c-4d98-9e8c-0e1cc9d8339d
⛔ Files ignored due to path filters (1)
app/translations.xlsxis excluded by!**/*.xlsx
📒 Files selected for processing (39)
TRANSLATIONS.mdapp/src/main/java/com/philkes/notallyx/presentation/UiExtensions.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/NotallyFragment.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/PreferenceBindingExtensions.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/SettingsFragment.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/note/EditActivity.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/note/PickNoteActivity.ktapp/src/main/java/com/philkes/notallyx/presentation/view/main/BaseNoteVH.ktapp/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/CheckedListItemAdapter.ktapp/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapter.ktapp/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapterBase.ktapp/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemVH.ktapp/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.ktapp/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.ktapp/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.ktapp/src/main/java/com/philkes/notallyx/presentation/widget/WidgetFactory.ktapp/src/main/res/layout/activity_edit.xmlapp/src/main/res/layout/fragment_settings.xmlapp/src/main/res/layout/preference_seekbar.xmlapp/src/main/res/layout/recycler_base_note.xmlapp/src/main/res/values-cs/strings.xmlapp/src/main/res/values-de/strings.xmlapp/src/main/res/values-es/strings.xmlapp/src/main/res/values-fr/strings.xmlapp/src/main/res/values-it/strings.xmlapp/src/main/res/values-my/strings.xmlapp/src/main/res/values-nb/strings.xmlapp/src/main/res/values-nl/strings.xmlapp/src/main/res/values-nn/strings.xmlapp/src/main/res/values-pl/strings.xmlapp/src/main/res/values-pt-rBR/strings.xmlapp/src/main/res/values-ro/strings.xmlapp/src/main/res/values-ru/strings.xmlapp/src/main/res/values-sl/strings.xmlapp/src/main/res/values-uk/strings.xmlapp/src/main/res/values-vi/strings.xmlapp/src/main/res/values-zh-rCN/strings.xmlapp/src/main/res/values-zh-rTW/strings.xmlapp/src/main/res/values/strings.xml
| setup( | ||
| value, | ||
| preference.titleResId!!, | ||
| preference.min, | ||
| preference.max, | ||
| context, | ||
| tooltipResId = tooltipResId, | ||
| ) { newValue -> | ||
| onChange(newValue) | ||
| } | ||
| PreviewText.apply { | ||
| isVisible = false | ||
| setTextSize(TypedValue.COMPLEX_UNIT_SP, value.toFloat()) | ||
| } | ||
| Slider.apply { | ||
| addOnChangeListener { _, newValue, _ -> | ||
| PreviewText.setTextSize(TypedValue.COMPLEX_UNIT_SP, newValue) | ||
| } | ||
| addOnSliderTouchListener( | ||
| object : Slider.OnSliderTouchListener { | ||
| override fun onStartTrackingTouch(slider: Slider) { | ||
| PreviewText.isVisible = true | ||
| } | ||
|
|
||
| override fun onStopTrackingTouch(slider: Slider) { | ||
| PreviewText.isVisible = false | ||
| onChange(slider.value.toInt()) | ||
| } | ||
| } | ||
| ) |
There was a problem hiding this comment.
Avoid registering a second save path in this helper.
setup() already saves on onStopTrackingTouch, and this method adds another stop listener that calls onChange() again. Each release now writes the preference twice, and the extra addOnChangeListener also piles up when the binding is rebuilt from observers.
Proposed fix
fun PreferenceSeekbarBinding.setupTextSizePreference(
preference: IntPreference,
context: Context,
value: Int = preference.value,
tooltipResId: Int? = null,
onChange: (newValue: Int) -> Unit,
) {
setup(
value,
preference.titleResId!!,
preference.min,
preference.max,
context,
tooltipResId = tooltipResId,
- ) { newValue ->
- onChange(newValue)
- }
+ ) { }
PreviewText.apply {
isVisible = false
setTextSize(TypedValue.COMPLEX_UNIT_SP, value.toFloat())
}
Slider.apply {
+ clearOnChangeListeners()
addOnChangeListener { _, newValue, _ ->
PreviewText.setTextSize(TypedValue.COMPLEX_UNIT_SP, newValue)
}
+ clearOnSliderTouchListeners()
addOnSliderTouchListener(
object : Slider.OnSliderTouchListener {
override fun onStartTrackingTouch(slider: Slider) {
PreviewText.isVisible = true
}
override fun onStopTrackingTouch(slider: Slider) {
PreviewText.isVisible = false
onChange(slider.value.toInt())
}
}
)
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| setup( | |
| value, | |
| preference.titleResId!!, | |
| preference.min, | |
| preference.max, | |
| context, | |
| tooltipResId = tooltipResId, | |
| ) { newValue -> | |
| onChange(newValue) | |
| } | |
| PreviewText.apply { | |
| isVisible = false | |
| setTextSize(TypedValue.COMPLEX_UNIT_SP, value.toFloat()) | |
| } | |
| Slider.apply { | |
| addOnChangeListener { _, newValue, _ -> | |
| PreviewText.setTextSize(TypedValue.COMPLEX_UNIT_SP, newValue) | |
| } | |
| addOnSliderTouchListener( | |
| object : Slider.OnSliderTouchListener { | |
| override fun onStartTrackingTouch(slider: Slider) { | |
| PreviewText.isVisible = true | |
| } | |
| override fun onStopTrackingTouch(slider: Slider) { | |
| PreviewText.isVisible = false | |
| onChange(slider.value.toInt()) | |
| } | |
| } | |
| ) | |
| setup( | |
| value, | |
| preference.titleResId!!, | |
| preference.min, | |
| preference.max, | |
| context, | |
| tooltipResId = tooltipResId, | |
| ) { } | |
| PreviewText.apply { | |
| isVisible = false | |
| setTextSize(TypedValue.COMPLEX_UNIT_SP, value.toFloat()) | |
| } | |
| Slider.apply { | |
| clearOnChangeListeners() | |
| addOnChangeListener { _, newValue, _ -> | |
| PreviewText.setTextSize(TypedValue.COMPLEX_UNIT_SP, newValue) | |
| } | |
| clearOnSliderTouchListeners() | |
| addOnSliderTouchListener( | |
| object : Slider.OnSliderTouchListener { | |
| override fun onStartTrackingTouch(slider: Slider) { | |
| PreviewText.isVisible = true | |
| } | |
| override fun onStopTrackingTouch(slider: Slider) { | |
| PreviewText.isVisible = false | |
| onChange(slider.value.toInt()) | |
| } | |
| } | |
| ) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@app/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/PreferenceBindingExtensions.kt`
around lines 520 - 549, The helper is registering duplicate listeners: remove
the extra Slider listeners here (the addOnChangeListener { ... } and the
addOnSliderTouchListener { ... onStopTrackingTouch { onChange(...) } }) so you
don't write the preference twice or accumulate change listeners; rely on the
existing setup(...) save-on-stop behavior and only keep the PreviewText
initialization (setTextSize and isVisible) or, if you still need live preview
updates, add a single non-duplicating listener pattern (store the listener
reference and remove it before re-adding) instead of registering anonymous
listeners each bind; update the code around setup(), PreviewText, Slider,
addOnChangeListener, addOnSliderTouchListener, and onStopTrackingTouch
accordingly.
app/src/main/java/com/philkes/notallyx/presentation/view/main/BaseNoteVH.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.kt
Outdated
Show resolved
Hide resolved
| <string name="tap_to_set_up">Tocca per impostare</string> | ||
| <string name="text_default">Predefinito</string> | ||
| <string name="text_size">Dimensione testo</string> | ||
| <string name="text_size_note_editor">Dimensione testo</string> |
There was a problem hiding this comment.
Italian locale update looks incomplete for the new settings.
This rename covers the editor label, but the new overview/preview text-size strings introduced by the PR are still missing here. That will leave the new settings partially untranslated for values-it.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/src/main/res/values-it/strings.xml` at line 291, The Italian strings file
only includes text_size_note_editor; add the missing Italian translations for
the new text-size keys introduced by the PR (match the exact resource names from
the default strings.xml such as the overview/preview keys, e.g.,
text_size_overview and text_size_preview or whatever keys exist) into
values-it/strings.xml so the settings are fully translated; locate the new keys
by checking the base/default strings.xml and add corresponding Italian entries
alongside the existing text_size_note_editor.
There was a problem hiding this comment.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemVH.kt (1)
43-52:⚠️ Potential issue | 🔴 CriticalKeep
textSizeasFloaton this path.Line 50 does not compile:
editBodySizeis defined only onTextSizeSp(Float), not onInt. The adapters (ListItemAdapter,CheckedListItemAdapter) receivenotallyModel.textSizewhich isFloat, but are declared withtextSize: Int. This type mismatch must be resolved by keeping the adapter/view-holder chain onFloat.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemVH.kt` around lines 43 - 52, The adapters and view holder are using Int for textSize but editBodySize is defined on Float (TextSizeSp), so change the type of textSize throughout the chain (ListItemAdapter, CheckedListItemAdapter, and ListItemVH constructor/property) from Int to Float; ensure any usages that compute body via textSize.editBodySize and calls like binding.EditText.setTextSizeSp(body) accept Float, and update any related variables/parameters to Float to remove the type mismatch.
♻️ Duplicate comments (2)
app/src/main/java/com/philkes/notallyx/presentation/view/main/BaseNoteVH.kt (1)
199-229:⚠️ Potential issue | 🟡 MinorSearch-result rows still miss the overview size.
The normal list path now applies
displayBodySize, but the keyword-hit branch inbindListSearch()never callssetTextSizeSp(...)on theHighlightableTextViews. In search mode those rows can still render at a default/stale size instead of the configured overview size.Suggested fix
(startItemIdx..endItemIdx).forEachIndexed { viewIdx, itemIdx -> listItemViews[viewIdx].apply { val item = initializedItems[itemIdx] text = item.body + setTextSizeSp(preferences.textSize.displayBodySize) if (itemIdx == keywordItemIdx) { highlight(keyword) } handleChecked(this, item.checked)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/philkes/notallyx/presentation/view/main/BaseNoteVH.kt` around lines 199 - 229, In bindListSearch(), the search-branch never applies the overview text size so HighlightableTextView rows can keep a stale size; update each visible HighlightableTextView inside the (startItemIdx..endItemIdx).forEachIndexed loop to call setTextSizeSp(preferences.textSize.displayBodySize) (or equivalent) when you set text for the item (e.g., in the block that sets text = item.body / highlight(keyword) / handleChecked), ensuring you also apply this size before making the view VISIBLE so search results match the normal list sizing.app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.kt (1)
33-43:⚠️ Potential issue | 🟠 MajorMigrate the legacy
textSizekey before reading these new prefs.Existing installs—and imported settings from older builds—still only have
textSize, so this change silently resets both sizes to their defaults on first read. Please map the old value intotextSizeNoteEditorandtextSizeOverviewonce during migration/import.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.kt` around lines 33 - 43, The new FloatPreference keys textSizeNoteEditor and textSizeOverview must preserve legacy installs that used the single "textSize" key; in NotallyXPreferences (where FloatPreference instances are created) add a one-time migration during initialization: check preferences for the legacy "textSize" key (e.g., preferences.contains("textSize") or read with a sentinel), if present read its float value, write that value into both "textSizeNoteEditor" and "textSizeOverview" via the same preference API used by FloatPreference, then remove/clear the legacy "textSize" key so migration only runs once; this ensures FloatPreference("textSizeNoteEditor", ...) and FloatPreference("textSizeOverview", ...) start from the migrated value rather than defaults.
🧹 Nitpick comments (1)
app/src/main/java/com/philkes/notallyx/presentation/UiExtensions.kt (1)
1157-1165: Consider consistency with label sizing approach.In
bindLabels, the text size is transformed viadisplayBodySizebefore applying, but here thetextSizeis applied directly. Additionally, the+ 4offset forchipIconSizeis a magic number.If this difference is intentional (reminder chips vs labels have different sizing semantics), a brief comment would help clarify. Otherwise, consider whether
displayBodySizeshould be applied here as well for consistency.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/philkes/notallyx/presentation/UiExtensions.kt` around lines 1157 - 1165, The textSize here is applied directly (setTextSizeSp) while elsewhere (bindLabels) you transform sizes via displayBodySize; to be consistent, pass textSize through displayBodySize before setTextSizeSp and when computing chipIconSize use a named constant (e.g., CHIP_ICON_SP_OFFSET) instead of the magic "+ 4" so the offset is explicit; update references in this block to use displayBodySize(textSize) and CHIP_ICON_SP_OFFSET and add a one-line comment explaining if the difference in sizing semantics between reminder chips and labels is intentional.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@app/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/SettingsFragment.kt`:
- Around line 310-327: The observers are re-calling setupTextSizePreference and
stacking listeners; stop rebuilding the seekbars inside the LiveData observers —
initialize each control once (call binding.TextSize.setupTextSizePreference(...)
and binding.TextSizeOverview.setupTextSizePreference(...) during view setup or
onViewCreated) and have the observers only update the UI value (e.g., set the
seekbar progress/state) without re-registering listeners, or alternatively make
setupTextSizePreference idempotent by detecting existing listener (remove
existing listener or guard with an "initialized" flag) before registering a new
one; update references to textSizeNoteEditor, textSizeOverview,
setupTextSizePreference and model.savePreference accordingly.
In
`@app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/CheckedListItemAdapter.kt`:
- Line 16: The constructor parameter textSize in CheckedListItemAdapter is
declared as Int but receives a Float (notallyModel.textSize from
EditListActivity / preferences.textSizeNoteEditor.value); update the signature
to textSize: Float (and any internal uses that assume Int should be adapted to
Float) or alternatively convert the value at the call site with .toInt(); prefer
changing CheckedListItemAdapter's textSize type to Float so sizing uses the new
float-based system consistently (update any methods/properties inside
CheckedListItemAdapter that read or apply textSize accordingly).
In
`@app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapterBase.kt`:
- Line 27: The constructor parameter textSize in ListItemAdapterBase should be
changed from Int to Float so it matches notallyModel.textSize and the Float-only
extension property editBodySize used in ListItemVH; update the parameter type
declaration (textSize) in ListItemAdapterBase and any call sites that pass an
Int to pass a Float (or cast where appropriate) so ListItemVH receives a Float
for .editBodySize to compile and behave consistently.
In
`@app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt`:
- Around line 369-384: Add brief KDoc comments above the TextSizeSp typealias
and each extension property (editBodySize, editTitleSize, displayBodySize,
displaySmallerSize, displayTitleSize) explaining the purpose and rationale of
the hardcoded offsets (editTitleSize = +4, displayBodySize = -2,
displaySmallerSize = -3) and note that editBodySize and displayTitleSize
intentionally return the base value to clarify their semantic roles in editing
vs display contexts.
In `@app/src/main/res/layout/recycler_base_note.xml`:
- Around line 101-109: Flow is already providing a 12dp horizontal gap between
Date and ReminderChip, so remove the chip's extra start margin to avoid doubling
the spacing: locate the ReminderChip view(s) referenced by the
androidx.constraintlayout.helper.widget.Flow (symbols: Flow, Date, ReminderChip)
and remove or set android:layout_marginStart="0dp" (or delete the margin
attribute) on the ReminderChip(s); do the same for the other chip instance that
also has an extra start margin so the visible gap equals the Flow's
app:flow_horizontalGap.
In `@app/src/main/res/values-nb/strings.xml`:
- Line 101: Add the two new localized string resources so the app doesn't fall
back to English: create string entries named "text_size_overview" and
"text_size_preview" alongside the existing "text_size_note_editor" and provide
Norwegian Bokmål translations (e.g., "Skriftstørrelse for oversikten" for
text_size_overview and "Skriftstørrelse for forhåndsvisning" for
text_size_preview) in the same values-nb/strings.xml file.
In `@app/src/main/res/values-nl/strings.xml`:
- Line 218: Update the Dutch translations to cover the new split settings:
replace the generic text for the note-editor row by changing the value for
string name="text_size_note_editor" to a more specific Dutch phrase (e.g.,
"Tekstgrootte in notitiebewerker"), and add localized entries for string
name="text_size_overview" and string name="text_size_preview" with appropriate
Dutch translations (e.g., "Tekstgrootte overzicht" and "Tekstgroottevoorbeeld"
or similar), ensuring the three resource names text_size_note_editor,
text_size_overview, and text_size_preview are present and properly localized.
In `@app/src/main/res/values-zh-rTW/strings.xml`:
- Line 293: The current locale only has a generic text_size_note_editor entry;
add localized string resources for the new split labels named text_size_overview
and text_size_preview (and adjust text_size_note_editor to a more specific
editor label if needed) so the note-editor, overview/preview size controls have
proper Traditional Chinese translations; update the strings.xml to include
<string name="text_size_overview">…</string> and <string
name="text_size_preview">…</string> (and change text_size_note_editor value to
explicitly indicate "editor") to prevent fallback to English.
---
Outside diff comments:
In
`@app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemVH.kt`:
- Around line 43-52: The adapters and view holder are using Int for textSize but
editBodySize is defined on Float (TextSizeSp), so change the type of textSize
throughout the chain (ListItemAdapter, CheckedListItemAdapter, and ListItemVH
constructor/property) from Int to Float; ensure any usages that compute body via
textSize.editBodySize and calls like binding.EditText.setTextSizeSp(body) accept
Float, and update any related variables/parameters to Float to remove the type
mismatch.
---
Duplicate comments:
In `@app/src/main/java/com/philkes/notallyx/presentation/view/main/BaseNoteVH.kt`:
- Around line 199-229: In bindListSearch(), the search-branch never applies the
overview text size so HighlightableTextView rows can keep a stale size; update
each visible HighlightableTextView inside the
(startItemIdx..endItemIdx).forEachIndexed loop to call
setTextSizeSp(preferences.textSize.displayBodySize) (or equivalent) when you set
text for the item (e.g., in the block that sets text = item.body /
highlight(keyword) / handleChecked), ensuring you also apply this size before
making the view VISIBLE so search results match the normal list sizing.
In
`@app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.kt`:
- Around line 33-43: The new FloatPreference keys textSizeNoteEditor and
textSizeOverview must preserve legacy installs that used the single "textSize"
key; in NotallyXPreferences (where FloatPreference instances are created) add a
one-time migration during initialization: check preferences for the legacy
"textSize" key (e.g., preferences.contains("textSize") or read with a sentinel),
if present read its float value, write that value into both "textSizeNoteEditor"
and "textSizeOverview" via the same preference API used by FloatPreference, then
remove/clear the legacy "textSize" key so migration only runs once; this ensures
FloatPreference("textSizeNoteEditor", ...) and
FloatPreference("textSizeOverview", ...) start from the migrated value rather
than defaults.
---
Nitpick comments:
In `@app/src/main/java/com/philkes/notallyx/presentation/UiExtensions.kt`:
- Around line 1157-1165: The textSize here is applied directly (setTextSizeSp)
while elsewhere (bindLabels) you transform sizes via displayBodySize; to be
consistent, pass textSize through displayBodySize before setTextSizeSp and when
computing chipIconSize use a named constant (e.g., CHIP_ICON_SP_OFFSET) instead
of the magic "+ 4" so the offset is explicit; update references in this block to
use displayBodySize(textSize) and CHIP_ICON_SP_OFFSET and add a one-line comment
explaining if the difference in sizing semantics between reminder chips and
labels is intentional.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c21b5269-f2f0-46b6-8407-6b2b916343e9
⛔ Files ignored due to path filters (1)
app/translations.xlsxis excluded by!**/*.xlsx
📒 Files selected for processing (39)
TRANSLATIONS.mdapp/src/main/java/com/philkes/notallyx/presentation/UiExtensions.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/NotallyFragment.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/PreferenceBindingExtensions.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/SettingsFragment.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/note/EditActivity.ktapp/src/main/java/com/philkes/notallyx/presentation/activity/note/PickNoteActivity.ktapp/src/main/java/com/philkes/notallyx/presentation/view/main/BaseNoteVH.ktapp/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/CheckedListItemAdapter.ktapp/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapter.ktapp/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapterBase.ktapp/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemVH.ktapp/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.ktapp/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.ktapp/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.ktapp/src/main/java/com/philkes/notallyx/presentation/widget/WidgetFactory.ktapp/src/main/res/layout/activity_edit.xmlapp/src/main/res/layout/fragment_settings.xmlapp/src/main/res/layout/preference_seekbar.xmlapp/src/main/res/layout/recycler_base_note.xmlapp/src/main/res/values-cs/strings.xmlapp/src/main/res/values-de/strings.xmlapp/src/main/res/values-es/strings.xmlapp/src/main/res/values-fr/strings.xmlapp/src/main/res/values-it/strings.xmlapp/src/main/res/values-my/strings.xmlapp/src/main/res/values-nb/strings.xmlapp/src/main/res/values-nl/strings.xmlapp/src/main/res/values-nn/strings.xmlapp/src/main/res/values-pl/strings.xmlapp/src/main/res/values-pt-rBR/strings.xmlapp/src/main/res/values-ro/strings.xmlapp/src/main/res/values-ru/strings.xmlapp/src/main/res/values-sl/strings.xmlapp/src/main/res/values-uk/strings.xmlapp/src/main/res/values-vi/strings.xmlapp/src/main/res/values-zh-rCN/strings.xmlapp/src/main/res/values-zh-rTW/strings.xmlapp/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (13)
- app/src/main/res/layout/preference_seekbar.xml
- app/src/main/res/values-de/strings.xml
- app/src/main/res/values-my/strings.xml
- app/src/main/res/values-zh-rCN/strings.xml
- app/src/main/res/values-nn/strings.xml
- TRANSLATIONS.md
- app/src/main/res/values-cs/strings.xml
- app/src/main/res/values-fr/strings.xml
- app/src/main/res/values-es/strings.xml
- app/src/main/res/values-pt-rBR/strings.xml
- app/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/PreferenceBindingExtensions.kt
- app/src/main/res/values-ro/strings.xml
- app/src/main/res/values-sl/strings.xml
| textSizeNoteEditor.observe(viewLifecycleOwner) { value -> | ||
| binding.TextSize.setupTextSizePreference( | ||
| textSizeNoteEditor, | ||
| requireContext(), | ||
| value = value, | ||
| ) { newValue -> | ||
| model.savePreference(textSizeNoteEditor, newValue) | ||
| } | ||
| } | ||
| textSizeOverview.observe(viewLifecycleOwner) { value -> | ||
| binding.TextSizeOverview.setupTextSizePreference( | ||
| textSizeOverview, | ||
| requireContext(), | ||
| value = value, | ||
| ) { newValue -> | ||
| model.savePreference(textSizeOverview, newValue) | ||
| } | ||
| } |
There was a problem hiding this comment.
Don’t rebuild these seekbars on every preference emission.
setupTextSizePreference() registers listeners on the bound control. Calling it again from these observe blocks stacks more listeners, so after a few adjustments one drag can invoke savePreference() multiple times. Please initialize each seekbar once, or make the helper idempotent before wiring it to LiveData.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@app/src/main/java/com/philkes/notallyx/presentation/activity/main/fragment/settings/SettingsFragment.kt`
around lines 310 - 327, The observers are re-calling setupTextSizePreference and
stacking listeners; stop rebuilding the seekbars inside the LiveData observers —
initialize each control once (call binding.TextSize.setupTextSizePreference(...)
and binding.TextSizeOverview.setupTextSizePreference(...) during view setup or
onViewCreated) and have the observers only update the UI value (e.g., set the
seekbar progress/state) without re-registering listeners, or alternatively make
setupTextSizePreference idempotent by detecting existing listener (remove
existing listener or guard with an "initialized" flag) before registering a new
one; update references to textSizeNoteEditor, textSizeOverview,
setupTextSizePreference and model.savePreference accordingly.
| class CheckedListItemAdapter( | ||
| @ColorInt var backgroundColor: Int, | ||
| private val textSize: TextSize, | ||
| private val textSize: Int, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify CheckedListItemAdapter instantiation and textSize type at call sites
rg -n "CheckedListItemAdapter\(" --type=kotlin -A 8
# Check if there's any toInt() conversion being applied
rg -n "textSize\.toInt\(\)" --type=kotlinRepository: Crustack/NotallyX
Length of output: 2524
🏁 Script executed:
# Find the definition of notallyModel and its textSize property
rg -n "class.*Model|var textSize|val textSize" app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ --type=kotlin -B 2 -A 2
# Check ListItemAdapterBase constructor for comparison
rg -n "class ListItemAdapterBase" --type=kotlin -A 10
# Find where notallyModel is defined and its textSize property type
rg -n "var textSize|val textSize" --type=kotlin | head -20Repository: Crustack/NotallyX
Length of output: 4725
🏁 Script executed:
# Check the type of preferences.textSizeNoteEditor
rg -n "textSizeNoteEditor\s*=" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.kt -A 1
# Check the NotallyModel.textSize definition in detail
rg -n "val textSize" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt -B 1 -A 1
# Look for the actual type of the preference
rg -n "class.*Preference|FloatPreference|IntPreference" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/ --type=kotlin | head -20Repository: Crustack/NotallyX
Length of output: 2953
🏁 Script executed:
# Check the FloatPreference.value type
rg -n "class FloatPreference" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt -A 5
# Check if there's any .toInt() conversion being applied in the actual call site
cat -n app/src/main/java/com/philkes/notallyx/presentation/activity/note/EditListActivity.kt | sed -n '253,261p'
# Check if this code actually compiles by looking for build errors or gradle files
find . -name "build.gradle*" -o -name "build.gradle.kts" | head -5Repository: Crustack/NotallyX
Length of output: 667
🏁 Script executed:
# Get the full FloatPreference class definition including the value property
rg -n "class FloatPreference" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt -A 20
# Also check if there's any implicit conversion happening in Kotlin by looking at the actual compilation
# Let's verify what type notallyModel.textSize actually is
cat -n app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt | sed -n '65,75p'Repository: Crustack/NotallyX
Length of output: 1229
🏁 Script executed:
# Check the BasePreference class to see the value property type
rg -n "class BasePreference" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt -A 30 | head -40
# Verify if the code compiles by checking if there are any type issues reported
# Let's also check if there's any extension function that converts Float to Int
rg -n "fun.*Float.*toInt|Float.*Int" --type=kotlin app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/ app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/Repository: Crustack/NotallyX
Length of output: 993
🏁 Script executed:
# Let's verify the exact type flow - check if there's any .toInt() or explicit conversion
rg -n "notallyModel.textSize" app/src/main/java/com/philkes/notallyx/presentation/activity/note/EditListActivity.kt -B 2 -A 2
# Also check if there's a conversion method on the textSize value
rg -n "\.toInt\(\)|\.toFloat\(\)" app/src/main/java/com/philkes/notallyx/presentation/activity/note/EditListActivity.kt | grep -i "textsize"
# Let's look at the complete CheckedListItemAdapter usage in EditListActivity to see if conversion happens
cat -n app/src/main/java/com/philkes/notallyx/presentation/activity/note/EditListActivity.kt | sed -n '250,265p'Repository: Crustack/NotallyX
Length of output: 1301
🏁 Script executed:
# Let's verify if this is actually a compilation error by checking if there's a conversion somewhere
# or if the parameter type might actually be Float despite what the snippet shows
# Check the actual full constructor of CheckedListItemAdapter
cat -n app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/CheckedListItemAdapter.kt | head -25
# Also verify ListItemAdapter for comparison
cat -n app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapter.kt | head -25Repository: Crustack/NotallyX
Length of output: 2468
🏁 Script executed:
# Final verification: check if there's any way this compiles (e.g., extension function or implicit conversion)
rg -n "fun Int\(|infix fun" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/ --type=kotlin | grep -i "float"
# Check if the project has any custom type conversions defined
fd -e "kt" -x rg -l "operator fun|infix fun" {} \; | head -10Repository: Crustack/NotallyX
Length of output: 225
🏁 Script executed:
# Let's check if there's a gradle build file that might show build errors or warnings
cat app/build.gradle.kts 2>/dev/null | head -50
# Double-check by looking at all usages of textSize in the adapters
rg -n "textSize" app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapterBase.kt -B 2 -A 2 | head -30Repository: Crustack/NotallyX
Length of output: 2450
🏁 Script executed:
# Check the git history of CheckedListItemAdapter to see if textSize type was recently changed
git log -p --follow -- app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/CheckedListItemAdapter.kt | grep -A 5 -B 5 "textSize.*Int\|textSize.*Float" | head -40
# Also check if there's a companion object or extension function that might handle conversion
rg -n "companion object|fun textSize" app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/CheckedListItemAdapter.ktRepository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Let's look at how textSize is used inside ListItemAdapterBase and CheckedListItemAdapter
# to understand if it's supposed to be Int or Float
rg -n "textSize" app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapterBase.kt -A 1 | head -20
# Check how it's used in ListItemVH constructor
rg -n "ListItemVH.*textSize|textSize.*setTextSize" app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ --type=kotlin -B 1 -A 1Repository: Crustack/NotallyX
Length of output: 693
🏁 Script executed:
# Check the ListItemVH constructor to see what type it expects for textSize
rg -n "class ListItemVH|constructor.*textSize" app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemVH.kt -A 5 | head -30Repository: Crustack/NotallyX
Length of output: 265
🏁 Script executed:
# Final check - let's see if there's any recent change that might have introduced this
# Let's check the actual git status and recent commits for these files
git log --oneline app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/CheckedListItemAdapter.kt 2>/dev/null | head -5
# Also verify one more time the exact type flow
echo "=== notallyModel.textSize type ==="
rg -n "val textSize = preferences.textSizeNoteEditor.value" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt
echo "=== preferences.textSizeNoteEditor type ==="
rg -n "val textSizeNoteEditor = FloatPreference" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.ktRepository: Crustack/NotallyX
Length of output: 215
Type inconsistency: textSize declared as Int but receives a Float value.
The textSize parameter receives notallyModel.textSize (line 255 in EditListActivity.kt), which is a Float value from preferences.textSizeNoteEditor.value. The parameter type declaration should match. Either change textSize: Int to textSize: Float to align with the new sizing system, or apply explicit .toInt() conversion at the call site.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/CheckedListItemAdapter.kt`
at line 16, The constructor parameter textSize in CheckedListItemAdapter is
declared as Int but receives a Float (notallyModel.textSize from
EditListActivity / preferences.textSizeNoteEditor.value); update the signature
to textSize: Float (and any internal uses that assume Int should be adapted to
Float) or alternatively convert the value at the call site with .toInt(); prefer
changing CheckedListItemAdapter's textSize type to Float so sizing uses the new
float-based system consistently (update any methods/properties inside
CheckedListItemAdapter that read or apply textSize accordingly).
| private val adapter: RecyclerView.Adapter<*>, | ||
| @ColorInt var backgroundColor: Int, | ||
| private val textSize: TextSize, | ||
| private val textSize: Int, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check how ListItemAdapterBase is instantiated and what type textSize has at call sites
ast-grep --pattern $'ListItemAdapterBase(
$$$
)'
# Also check ListItemAdapter which extends this pattern
rg -n "ListItemAdapter\(" --type=kotlin -A 5Repository: Crustack/NotallyX
Length of output: 3281
🏁 Script executed:
fd -e kt NotallyModelRepository: Crustack/NotallyX
Length of output: 138
🏁 Script executed:
rg -n "notallyModel\.textSize|class NotallyModel" --type=kotlin -B 2 -A 2Repository: Crustack/NotallyX
Length of output: 5440
🏁 Script executed:
# Also check the actual type of textSize in NotallyModel
ast-grep --pattern $'class NotallyModel {
$$$
textSize
$$$
}'Repository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
cat -n app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt | head -150Repository: Crustack/NotallyX
Length of output: 6789
🏁 Script executed:
# Search for the textSize property definition in NotallyModel
rg -n "textSize\s*[:=]" app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt -B 2 -A 2Repository: Crustack/NotallyX
Length of output: 217
🏁 Script executed:
# Find NotallyXPreferences class and look for textSizeNoteEditor definition
rg -n "textSizeNoteEditor" --type=kotlin -B 2 -A 2Repository: Crustack/NotallyX
Length of output: 5743
🏁 Script executed:
# Also look for the Preference class to understand what .value returns
rg -n "class.*Preference|textSizeNoteEditor\s*[:=]" --type=kotlin -B 1 -A 1Repository: Crustack/NotallyX
Length of output: 5811
🏁 Script executed:
# Check the FloatPreference class to understand what type .value returns
cat -n app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt | sed -n '226,242p'Repository: Crustack/NotallyX
Length of output: 673
🏁 Script executed:
# Check BasePreference to see the value property
cat -n app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt | sed -n '34,80p'Repository: Crustack/NotallyX
Length of output: 1790
🏁 Script executed:
# Look for extension properties on the text size type
rg -n "\.displayTitleSize|\.editTitleSize|\.editBodySize|\.displaySmallerSize" --type=kotlin -B 2Repository: Crustack/NotallyX
Length of output: 7675
🏁 Script executed:
# Find where these extension properties are defined
rg -n "fun.*displayTitleSize|fun.*editTitleSize|fun.*editBodySize|fun.*displaySmallerSize" --type=kotlin -B 2 -A 1Repository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Get the full context of TextSizeSp extension properties
cat -n app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt | sed -n '369,386p'Repository: Crustack/NotallyX
Length of output: 589
🏁 Script executed:
# Check ListItemVH to see how it uses textSize parameter
cat -n app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemVH.kt | head -60Repository: Crustack/NotallyX
Length of output: 3172
🏁 Script executed:
# Check if there's any .toInt() conversion at call sites
rg -n "notallyModel\.textSize\.toInt|textSize\.toInt" --type=kotlinRepository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Check the full ListItemAdapterBase class
cat -n app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapterBase.ktRepository: Crustack/NotallyX
Length of output: 4444
🏁 Script executed:
# Check if there's an editBodySize extension on Int
rg -n "val Int\.editBodySize|fun Int\.editBodySize" --type=kotlinRepository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Also check what the error would be - search for any Int extensions related to size
rg -n "val Int\." --type=kotlin | grep -i "size\|body\|title"Repository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Let's check the git history to see if this is a recent change
git log --oneline -n 20 -- app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapterBase.kt 2>/dev/null | head -5Repository: Crustack/NotallyX
Length of output: 77
🏁 Script executed:
# Check if the project has build configuration files to understand if this would compile
find . -name "build.gradle*" -o -name "pom.xml" | head -5Repository: Crustack/NotallyX
Length of output: 102
🏁 Script executed:
# Double-check that TextSizeSp extensions are only on Float
cat -n app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt | sed -n '369,395p'Repository: Crustack/NotallyX
Length of output: 977
🏁 Script executed:
# Verify the exact error by checking what would happen
# Search for any implicit conversion or casting
rg -n "as Int|\.toInt\(\)|Int\(" app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ --type=kotlinRepository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Check if there are any implicit conversions from Float to Int in Kotlin stdlib or custom code
rg -n "operator fun Float.toInt|fun Float.toInt" --type=kotlinRepository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Final verification: Look at what the compiler would see
# Check if there's any override or different version of editBodySize that takes Int
rg -n "\.editBodySize" app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ -B 3 -A 1Repository: Crustack/NotallyX
Length of output: 1523
🏁 Script executed:
# Check if there's a .toInt() call anywhere in the constructor chain or call site
rg -n "toInt()" app/src/main/java/com/philkes/notallyx/presentation/activity/note/EditListActivity.kt -B 2 -A 2Repository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Final check: Does the code actually compile? Look for any Kotlin internals that might allow this
rg -n "fun Int\.editBodySize|val Int\.editBodySize" --type=kotlinRepository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# Check if editBodySize might be defined elsewhere for Int
find . -name "*.kt" -exec grep -l "Int\.editBodySize\|fun Int\.edit" {} \; 2>/dev/nullRepository: Crustack/NotallyX
Length of output: 43
🏁 Script executed:
# One more check - see if there's a possibility that textSize could be something other than what we think
# Look at the actual assignment again with more context
cat -n app/src/main/java/com/philkes/notallyx/presentation/viewmodel/NotallyModel.kt | sed -n '65,75p'Repository: Crustack/NotallyX
Length of output: 491
Change textSize parameter from Int to Float.
notallyModel.textSize is a Float (from FloatPreference), but this adapter declares textSize as Int. This causes a type mismatch when passed to ListItemVH, which then attempts to call .editBodySize on it—an extension property that only exists on Float. Update the parameter type to Float for consistency with the rest of the codebase.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@app/src/main/java/com/philkes/notallyx/presentation/view/note/listitem/adapter/ListItemAdapterBase.kt`
at line 27, The constructor parameter textSize in ListItemAdapterBase should be
changed from Int to Float so it matches notallyModel.textSize and the Float-only
extension property editBodySize used in ListItemVH; update the parameter type
declaration (textSize) in ListItemAdapterBase and any call sites that pass an
Int to pass a Float (or cast where appropriate) so ListItemVH receives a Float
for .editBodySize to compile and behave consistently.
| typealias TextSizeSp = Float | ||
|
|
||
| val editBodySize: Float | ||
| get() { | ||
| return when (this) { | ||
| SMALL -> 14f | ||
| MEDIUM -> 16f | ||
| LARGE -> 18f | ||
| } | ||
| } | ||
| val TextSizeSp.editBodySize: Float | ||
| get() = this | ||
|
|
||
| val editTitleSize: Float | ||
| get() { | ||
| return when (this) { | ||
| SMALL -> 18f | ||
| MEDIUM -> 20f | ||
| LARGE -> 22f | ||
| } | ||
| } | ||
| val TextSizeSp.editTitleSize: Float | ||
| get() = (this + 4) | ||
|
|
||
| val displayBodySize: Float | ||
| get() { | ||
| return when (this) { | ||
| SMALL -> 12f | ||
| MEDIUM -> 14f | ||
| LARGE -> 16f | ||
| } | ||
| } | ||
| val TextSizeSp.displayBodySize: Float | ||
| get() = (this - 2) | ||
|
|
||
| val displayTitleSize: Float | ||
| get() { | ||
| return when (this) { | ||
| SMALL -> 14f | ||
| MEDIUM -> 16f | ||
| LARGE -> 18f | ||
| } | ||
| } | ||
| } | ||
| val TextSizeSp.displaySmallerSize: Float | ||
| get() = (this - 3) | ||
|
|
||
| val TextSizeSp.displayTitleSize: Float | ||
| get() = this |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check the min/max values defined for text size FloatPreferences
rg -n "FloatPreference\(" --type=kotlin -A 5 | grep -E "(textSize|min|max)"Repository: Crustack/NotallyX
Length of output: 615
🏁 Script executed:
rg -n "textSizeNoteEditor" --type=kotlin -B 1 -A 5 app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/NotallyXPreferences.ktRepository: Crustack/NotallyX
Length of output: 624
🏁 Script executed:
rg -n -B 3 "editBodySize|editTitleSize|displayBodySize|displayTitleSize|displaySmallerSize" --type=kotlin app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt | head -40Repository: Crustack/NotallyX
Length of output: 434
🏁 Script executed:
rg -n "\.editBodySize|\.editTitleSize|\.displayBodySize|\.displayTitleSize|\.displaySmallerSize" --type=kotlin | head -20Repository: Crustack/NotallyX
Length of output: 3021
Add documentation for text size offset values.
The extension properties lack documentation for the hardcoded offsets:
editTitleSizeadds 4 spdisplayBodySizesubtracts 2 spdisplaySmallerSizesubtracts 3 sp
Consider adding a comment explaining the design rationale for these offsets.
Additionally, editBodySize and displayTitleSize both return the base value unchanged. If this semantic distinction is intentional (to clarify whether the size applies in an editing or display context), a brief comment would clarify the purpose.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@app/src/main/java/com/philkes/notallyx/presentation/viewmodel/preference/Preference.kt`
around lines 369 - 384, Add brief KDoc comments above the TextSizeSp typealias
and each extension property (editBodySize, editTitleSize, displayBodySize,
displaySmallerSize, displayTitleSize) explaining the purpose and rationale of
the hardcoded offsets (editTitleSize = +4, displayBodySize = -2,
displaySmallerSize = -3) and note that editBodySize and displayTitleSize
intentionally return the base value to clarify their semantic roles in editing
vs display contexts.
| <androidx.constraintlayout.helper.widget.Flow | ||
| android:layout_width="0dp" | ||
| android:layout_height="wrap_content" | ||
| app:constraint_referenced_ids="Date,ReminderChip" | ||
| app:flow_wrapMode="chain" | ||
| app:flow_horizontalStyle="spread_inside" | ||
| app:flow_horizontalBias="0" | ||
| app:flow_horizontalGap="12dp" | ||
| app:flow_verticalGap="4dp" |
There was a problem hiding this comment.
Reminder chip gets double horizontal spacing.
Flow already inserts a 12dp gap between Date and ReminderChip, so the extra start margin on the chip makes the visible spacing 24dp in overview cards.
Proposed fix
<com.google.android.material.chip.Chip
android:id="@+id/ReminderChip"
style="@style/ReminderChip"
- android:layout_marginStart="12dp"
tools:closeIconVisible="true"
tools:text="00/00/0000 00:00"
tools:visibility="visible"
tools:ignore="MissingConstraints" />Also applies to: 125-129
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/src/main/res/layout/recycler_base_note.xml` around lines 101 - 109, Flow
is already providing a 12dp horizontal gap between Date and ReminderChip, so
remove the chip's extra start margin to avoid doubling the spacing: locate the
ReminderChip view(s) referenced by the
androidx.constraintlayout.helper.widget.Flow (symbols: Flow, Date, ReminderChip)
and remove or set android:layout_marginStart="0dp" (or delete the margin
attribute) on the ReminderChip(s); do the same for the other chip instance that
also has an extra start margin so the visible gap equals the Flow's
app:flow_horizontalGap.
| <string name="take_note">Ta et notat</string> | ||
| <string name="tap_to_set_up">Trykk for å konfigurere</string> | ||
| <string name="text_size">Skriftstørrelse</string> | ||
| <string name="text_size_note_editor">Skriftstørrelse</string> |
There was a problem hiding this comment.
This locale still needs the new split text-size strings.
Skriftstørrelse was fine when there was only one setting, but it is ambiguous once note-editor and overview sizes are shown separately. Please also add localized text_size_overview and text_size_preview entries here to avoid English fallback.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/src/main/res/values-nb/strings.xml` at line 101, Add the two new
localized string resources so the app doesn't fall back to English: create
string entries named "text_size_overview" and "text_size_preview" alongside the
existing "text_size_note_editor" and provide Norwegian Bokmål translations
(e.g., "Skriftstørrelse for oversikten" for text_size_overview and
"Skriftstørrelse for forhåndsvisning" for text_size_preview) in the same
values-nb/strings.xml file.
| <string name="tap_for_more_options">Tik voor meer opties</string> | ||
| <string name="tap_to_set_up">Tik om in te stellen</string> | ||
| <string name="text_size">Tekstgrootte</string> | ||
| <string name="text_size_note_editor">Tekstgrootte</string> |
There was a problem hiding this comment.
Dutch translation is incomplete for the new split settings.
Tekstgrootte is now too generic for the note-editor row, and this file still misses localized text_size_overview / text_size_preview strings, so the new settings block will be partly untranslated.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/src/main/res/values-nl/strings.xml` at line 218, Update the Dutch
translations to cover the new split settings: replace the generic text for the
note-editor row by changing the value for string name="text_size_note_editor" to
a more specific Dutch phrase (e.g., "Tekstgrootte in notitiebewerker"), and add
localized entries for string name="text_size_overview" and string
name="text_size_preview" with appropriate Dutch translations (e.g.,
"Tekstgrootte overzicht" and "Tekstgroottevoorbeeld" or similar), ensuring the
three resource names text_size_note_editor, text_size_overview, and
text_size_preview are present and properly localized.
| <string name="tap_to_set_up">點擊以進行設定</string> | ||
| <string name="text_default">預設</string> | ||
| <string name="text_size">文字大小</string> | ||
| <string name="text_size_note_editor">文字大小</string> |
There was a problem hiding this comment.
Localize the split text-size settings here too.
Keeping the old generic label makes this row ambiguous now that the settings screen has separate note-editor and overview sizes, and this locale file still lacks localized text_size_overview / text_size_preview entries, so part of the new UI will fall back to English.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/src/main/res/values-zh-rTW/strings.xml` at line 293, The current locale
only has a generic text_size_note_editor entry; add localized string resources
for the new split labels named text_size_overview and text_size_preview (and
adjust text_size_note_editor to a more specific editor label if needed) so the
note-editor, overview/preview size controls have proper Traditional Chinese
translations; update the strings.xml to include <string
name="text_size_overview">…</string> and <string
name="text_size_preview">…</string> (and change text_size_note_editor value to
explicitly indicate "editor") to prevent fallback to English.
|
Very good |
Closes #855
notallyx_issues_855.webm
Summary by CodeRabbit
Release Notes
New Features
UI/Layout Improvements
Documentation