Skip to content

Conversation

@wchargin
Copy link
Contributor

@wchargin wchargin commented Feb 14, 2019

Summary:
We have a <tf-downloader> element that provides CSV and JSON download
links alongside a run selector, but this element is actually unused.
This commit replaces the scalar plugin’s reimplementation, updating the
styling of <tf-downloader> to stay mostly consistent with the existing
UI. This will enable us to fix #1845 in a way that can work for other
download links, too.

Test Plan:
Observe that the UI is virtually identical (the only visible change is
that the vertical position of the dropdown menu has shifted slightly):

“Before” and “after” screenshot.

Check that the download links download identical files before and after
the change, with the same filenames except that the run_ prefix has
been changed to run- for internal consistency.

wchargin-branch: scalars-tf-downloader

Summary:
We have a `<tf-downloader>` element that provides CSV and JSON download
links alongside a run selector, but this element is actually unused.
This commit replaces the scalar plugin’s reimplementation, updating the
styling of `<tf-downloader>` to stay mostly consistent with the existing
UI. This will enable us to fix #1845 in a way that can work for other
download links, too.

Test Plan:
Observe that the UI is virtually identical (the only visible change is
that the vertical position of the dropdown menu has shifted slightly):

![“Before” and “after” screenshot.](https://user-images.githubusercontent.com/4317806/52752587-38795e00-2fa8-11e9-8b7c-1d8b9a540e49.png)

Check that the download links download identical files before and after
the change, with the same filenames.

wchargin-branch: scalars-tf-downloader
Copy link
Contributor

@nfelt nfelt left a comment

Choose a reason for hiding this comment

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

I always wondered why <tf-downloader> existed but wasn't actually used. Hopefully not because it has some fatal flaw.

},
_csvName(tag, run) {
return `run_${run},tag_${tag}.csv`;
return `run_${run}-tag-${tag}.csv`;
Copy link
Contributor

Choose a reason for hiding this comment

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

this uses an underscore for run but dashes for the rest - make it consistent? ditto below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was for consistency with the original scalar-card code

download="run_[[_runToDownload]]-tag-[[tag]].csv"

but I’m fine with disregarding that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay. I think we can just disregard that; I doubt anyone is depending on the exact format of that downloaded file name.

runs: Array,
tag: String,
urlFn: Function,
urlFn: Function, // (tag: string, run: string) => string (JSON URL)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move this comment up one line and just slightly expand to state that the user should provide this to generate URLs for the selected run/tag combos.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

wchargin-branch: scalars-tf-downloader
wchargin-branch: scalars-tf-downloader
@wchargin wchargin merged commit f5ef2ad into master Feb 14, 2019
@wchargin wchargin deleted the wchargin-scalars-tf-downloader branch March 4, 2019 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scalar plugin download links should work in Colab

2 participants