Skip to content

Conversation

@7se7en72025
Copy link
Contributor

@7se7en72025 7se7en72025 commented Nov 16, 2025

This commit makes template editing operations undoable by wrapping the save operation in undoableOp. This ensures that template changes are properly tracked in the undo history, allowing users to undo template edits.

Changes:

  • Updated CardTemplateNotetype.saveToDatabase() to be a suspend function that wraps the save operation in undoableOp
  • Changed saveNoteType() to be a Collection extension function that uses the Collection receiver instead of a parameter
  • Updated CardTemplateEditor.kt to call saveToDatabase() without passing the Collection parameter
  • Added import for undoableOp in CardTemplateNotetype.kt

Purpose / Description

Describe the problem or feature and motivation

Fixes

Approach

How does this change address the problem?

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration (SDK version(s), emulator or physical, etc)

Learning (optional, can help others)

Describe the research stage

Links to blog posts, patterns, libraries or addons used to solve this problem

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

raiyyan added 2 commits November 16, 2025 11:10
This commit makes template editing operations undoable by wrapping
the save operation in undoableOp. This ensures that template changes
are properly tracked in the undo history, allowing users to undo
template edits.

Changes:
- Updated CardTemplateNotetype.saveToDatabase() to be a suspend function
  that wraps the save operation in undoableOp
- Changed saveNoteType() to be a Collection extension function that uses
  the Collection receiver instead of a parameter
- Updated CardTemplateEditor.kt to call saveToDatabase() without passing
  the Collection parameter
- Added import for undoableOp in CardTemplateNotetype.kt

Fixes ankidroid#19488
- Fixed scrollbar stuttering when card names/tags have different lengths
- Set fixed row height (56dp) in card browser to maintain consistent item sizes
- Added text truncation with ellipsis for long content in browser columns
- Improved UX with tooltips and long-press to view full text
- Applied fixes to multiple layout components:
  * card_item_browser.xml: Fixed height layout
  * browser_column_cell.xml: Text ellipsize and maxLines for truncation
  * item_notetype_field.xml: Ellipsize for sort field names
  * item_require_exclude_tag.xml: Single-line ellipsize for tags
  * tags_item_list_dialog.xml: Text ellipsize in tag dialogs
- BrowserMultiColumnAdapter:
  * Set 56dp fixed height for items to prevent layout thrashing
  * Added long-press handler to show full text in toast
  * Added tooltip for text longer than 30 chars
  * Set content description for accessibility

Fixes scrollbar jitter during scrolling when items have variable content sizes
@david-allison
Copy link
Member

Hi @7se7en72025

Please force push rather than closing and creating new PRs for the same issue:

  • Review history is hidden
  • We get extra notifications unnecessary

Cheers

@david-allison
Copy link
Member

david-allison commented Nov 27, 2025

I'm closing this as I expect the underlying issue is resolved.


The changes here don't look relevant. The original changes in this PR didn't appear to fix undoable operations.

The "Fixes" link is incorrect.

Lint/CI fails, if checks are red, could you draft the PR until they pass.

./gradlew lintPlayDebug :api:lintDebug :libanki:lintDebug ktLintCheck lintVitalFullRelease lint-rules:test --daemon

The underlying issue appears to be fixed already:

Right now, these rapid updates to PRs are adding to our workload. Please, can you spend more time before pushing code:

  • Checking the diff to ensure that it's reviewable
  • Checking the code, to be sure it fixes the problem
  • Writing the PR summary, so we can understand what code does
  • Draft the PR if it's not in a reviewable state

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