Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/clipboard icons alignment #4923

Draft
wants to merge 12 commits into
base: unstable
Choose a base branch
from

Conversation

GautamBytes
Copy link
Contributor

Summary

  • Fixed checkbox alignment issues in the UI that were causing misalignment between checkbox icons and their corresponding text labels. The checkboxes were appearing slightly misaligned with channel names and folder items in different views.

  • Modified checkbox.vue to improve alignment using a flexbox-based approach

  • Added a slight vertical offset to properly align checkbox icons with text

  • Standardized checkbox icon dimensions to ensure consistency

  • Manually verified on both channel and folder item views to ensure proper alignment

  • The fix addresses the inconsistent vertical positioning that was affecting UI appearance

#Before -->
image

#After -->
WhatsApp Image 2025-02-27 at 01 00 08_d9b637a7

References

Addresses #4771

Reviewer guidance

  • Check that checkbox alignment appears consistent in:
  • Channel listings (specifically Alpha channel view)
    • Folder and file listings
  • Content item selections
  • Verify that the changes don't affect checkbox functionality - selection behavior should remain the same
  • Test in different viewport sizes to ensure responsive behavior is maintained

@GautamBytes
Copy link
Contributor Author

Hey @pcenov and @bjester , I have fixed the issue . You can have a look at the pr and suggest me wherever improvements can be made. Thanks!





Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a mistake to add so many extra new lines?





Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And more new lines here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes noticed this after pushing will work on this soon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the extra new lines in the other files. The new lines are still present here though.

@@ -148,12 +148,61 @@

</script>

<!-- Remove "scoped" so that our override rules apply globally to KCheckbox internals -->
<style lang="less">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're no longer supporting LESS. SCSS or plain CSS only please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay sure . Also , Any guidance on how to make sure code passes javascript cl tests , i am troubling with that a bit also?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error I saw in the tests in failing checks here on the PR seems related to this issue. Presumably, switching back to SCSS should help?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay sure , will do the suggested changes. Thanks!

@GautamBytes GautamBytes force-pushed the fix/clipboard-icons-alignment branch from 9698f49 to ac56318 Compare March 2, 2025 15:25
Copy link
Member

@bjester bjester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I think this PR alters too much about the checkbox itself. The checkbox is used in places all over Studio, which don't all have the same issue. A more localized fix in the Clipboard code is more appropriate.

simulateClick() {
// Provide a dummy event object with a stopPropagation method
this.handleChange(!this.isChecked, { stopPropagation() {} });
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What prompted you to add this simulated click event?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The js frontend test was failing so tried to fix it . The tests click the entire container instead of the actual checkbox, so the change event wasn’t firing. The simulateClick method makes sure clicking the container toggles the checkbox and emits the expected event, which fixes the test failures.





Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the extra new lines in the other files. The new lines are still present here though.

>
<slot></slot>
</KCheckbox>
<div class="checkbox-container" :data-test="'checkbox-' + value" @click="simulateClick">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Within the Clipboard specifically, the checkbox is already in a flex container
image

top: 1.7px !important; /* Added downward shift */
flex-shrink: 0;
width: 28px !important;
height: 28px !important;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be modifying the checkbox itself, just the alignment, which is most important with regards to where the checkbox is used.

}

/* Fix for specific hardcoded selector if needed */
::v-deep [data-v-4219cdf2] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't appropriate to style elements based off this dynamic attribute data-v-4219cdf2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay @bjester , will do the suggested changes and then revert back , I might be not able to do in next 1-2 days so i will convert the pr to draft till then . Thanks!

@GautamBytes GautamBytes marked this pull request as draft March 3, 2025 18:30
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