Skip to content

Conversation

@ssnjr2002
Copy link

Fixes #4919

Hides the column type icon in the header cell when an overflow is detected

Screenshots

image image

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
@seancolsen seancolsen self-assigned this Oct 31, 2025
@seancolsen seancolsen added the pr-status: review A PR awaiting review label Oct 31, 2025
Copy link
Contributor

@seancolsen seancolsen left a comment

Choose a reason for hiding this comment

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

I'm giving this a very quick review just to point out some issues I spotted immediately upon glancing at the diff. I'd like you to address these before I continue reviewing

  • Fix lint errors
  • Run Prettier

(See the Developer Guide for instructions on running the linter and code formatter.)

Additionally, I'll say: I was expecting this to be a much smaller change. I was not expecting a resize observer. I'm not sure that's actually necessary here. I think the icon is okay if the column name is truncated a bit. What I had in mind is a static column width, below which we would hide the icon. So I wouldn't imagine any changes being necessary inside Truncate. Can try simplifying this to behave like that?

border-radius: 0.2rem;
max-width: var(--tooltip-max-width, 22rem);
}
.dropdown.truncation-content > .name-with-icon > .icon {
Copy link
Contributor

Choose a reason for hiding this comment

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

This CSS couples this component to NameWithIcon and Icon. While this sort of tight coupling is possible, we generally only use it in much higher-level components, and only as a last resort for the sake of time when developing a complex feature. For this PR, each component should not have any CSS related to other components.

export let collapsibleIcon = false;
let isOverflowing = false;
let nwiEl: HTMLElement | undefined;
Copy link
Contributor

@seancolsen seancolsen Oct 31, 2025

Choose a reason for hiding this comment

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

The name nwiEl has very low readability. In general please use names with full words.

@seancolsen seancolsen assigned ssnjr2002 and unassigned seancolsen Oct 31, 2025
@seancolsen seancolsen added pr-status: revision A PR awaiting follow-up work from its author after review and removed pr-status: review A PR awaiting review labels Oct 31, 2025
@ssnjr2002
Copy link
Author

Ah, thanks for the feedback. I'm new to all this so it's very helpful.

I have a few doubts if you don't mind. How would I get the width of the header cell and update state without a resize observer? Also how much should the static width be? 50px sound good?

@ssnjr2002 ssnjr2002 closed this Nov 1, 2025
@ssnjr2002 ssnjr2002 force-pushed the header-cell-collapsible-icon branch from f5b61f4 to 953ec2e Compare November 1, 2025 15:46
@ssnjr2002 ssnjr2002 reopened this Nov 1, 2025
@ssnjr2002 ssnjr2002 requested a review from seancolsen November 1, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-status: revision A PR awaiting follow-up work from its author after review

2 participants