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: show as many node links as height allows #238

Merged
merged 3 commits into from
Jun 3, 2020
Merged

Conversation

jessicaschilling
Copy link
Contributor

Not sure if this is too hacky a suggestion, but enables full-height link tables by way of nesting math:

tableHeight is the greater of either 370px or (the lesser of either "window height less page header height" or "the number of rows x row height plus table header height")

Note that 370px is the current max height.

Closes ipld/explore.ipld.io#53.

@jessicaschilling jessicaschilling requested review from hacdias and lidel May 22, 2020 22:37
@jessicaschilling
Copy link
Contributor Author

jessicaschilling commented May 22, 2020

Hi @lidel, @rafaelramalho19, @hacdias - you were the last folks to commit against this repo, so hoping one of you might be able to take a quick look.

This solves ipld/explore.ipld.io#53, but not sure if it's a legit approach.

Thanks!

@rafaelramalho19
Copy link
Contributor

@jessicaschilling jessicaschilling removed the request for review from hacdias June 1, 2020 18:15
@jessicaschilling
Copy link
Contributor Author

This is a bit odd. The way this component is set up, it's already using AutoSizer, but disabling auto height, instead opting for a declared height based on the original math with a max height of 370px:
Math.min(370, (links.length * rowHeight) + headerHeight)

I'm not sure about the reasons behind the original decision to do this ... but the extra math in this PR does allow for a larger table height for taller windows without refactoring how the component works as a whole. I did try digging into this, but wasn't able to successfully rework it without hitting the limit of my expertise. Someone else might be able to pull it apart with no problem, though -- so at this point choices may be:

  • accept this (somewhat hacky) approach for the sake of getting taller windows faster
  • request help from @rafaelramalho19 and/or @lidel for refactoring the component (not sure if this is a good use of their time at present)
  • Kill off this PR, leave the issue open and deal with in greater detail at some unspecified time

@lidel @rafaelramalho19 thoughts?

@rafaelramalho19
Copy link
Contributor

I would advise just merging this as it is and refactoring in the future. I guess we have lots of stuff to perfect and iterate on ipld-explorer in the months after the pinning work is done 🤔

@jessicaschilling
Copy link
Contributor Author

jessicaschilling commented Jun 2, 2020

@lidel -- thanks for having a look. Getting this plus translations (#242) in on a single release would be awesome 😊

@lidel lidel self-assigned this Jun 2, 2020
babel output made connect-deps connect to fail,
this fixes it, enabling us to tests the component locally, in a real webui

License: MIT
Signed-off-by: Marcin Rataj <[email protected]>
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

  • Just to be sure, I tested this in real, local versions of both explore.ipld.io website and ipfs-webui.
    • Looks 👌 in both, thank you @jessicaschilling!
    • Made a small fix that made it work with connect-deps tool, which prooved to be more reliable than built-in link in npm and yarn
  • I agree we should ship this – I'm merging this PR, and will do the translations + NPM release tomorrow.

@lidel lidel changed the title Nested math for tableHeight fix: show as many node links as height allows Jun 3, 2020
@lidel lidel merged commit 06612e2 into master Jun 3, 2020
@lidel lidel deleted the feat/full-height-table branch June 3, 2020 00:16
@jessicaschilling
Copy link
Contributor Author

@lidel thank you!!! 🌞🌞

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.

Expand links to bottom
3 participants