kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Use `iconName` in return value of `getPicturePasswordIcons`

Open bjester opened this issue 7 months ago • 1 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Context

PR https://github.com/learningequality/kolibri/pull/14573 added ambiguous iconName to the objects returned by getPicturePasswordIcons to eliminate the need for consumers to switch on whether to use iconColorful or iconStandard in the response. Since getPicturePasswordIcons switches on that already, it's simplest to have it return a single property iconName.

Task

  • [ ] Eliminate iconStandard and iconColorful from getPicturePasswordIcons
  • [ ] Update any usages of iconStandard and iconColorful to use iconName instead
  • [ ] Update the tests for getPicturePasswordIcons
  • [ ] Update any other consumer tests for the change

Reference

Thanks for updating this function to use constants instead. I wonder if this function should be updated to return only the label and iconName?

Right now this function is only used in two places, the AllPasswordsPage.vue and now the UserEditPage.vue, and updating it now won't affect the changes in AllPasswordsPage.vue, only the tests.

Doesn't have to be done in this PR though, it can also be done when the All Passwords Page is updated to display the actual icons, just wondering about your thoughts?

Originally posted by @LianaHarris360 in https://github.com/learningequality/kolibri/pull/14573#discussion_r3066603652

bjester avatar Apr 10 '26 23:04 bjester

Plan: getPicturePasswordIcons returns only label and iconName; the style-specific iconColorful / iconStandard keys are gone.

  • [ ] Narrow the descriptor to {label, iconName}
  • [ ] Self-review the produced code

Assumptions — the issue did not settle these; say so if one is wrong.

  • iconName stays absent when iconStyle is omitted, rather than defaulting to colorful. If wrong, UserPicturePassword on a facility with no picture_password_settings keeps rendering KIcon with an undefined icon.
  • The iconStyle parameter stays. If wrong, callers resolve the style themselves and the function loses its second argument, which changes all three call sites.
  • No consumer exists outside develop — the AC's "update any other consumer tests" implies some did. If wrong, an in-flight branch reads a key that is now silently undefined, with no runtime error to flag it.

Open questions

  • None.

@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar Sep 18 '26 21:09 rtibblesbot