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

Add storybook for HierarchicalLocationsView, remove hardcoded theme colors #14818

Merged
merged 1 commit into from Oct 22, 2020

Conversation

sqs
Copy link
Member

@sqs sqs commented Oct 18, 2020

No description provided.

@sqs sqs added the team/web label Oct 18, 2020
@codecov
Copy link

codecov bot commented Oct 18, 2020

Codecov Report

Merging #14818 into main will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main   #14818      +/-   ##
==========================================
+ Coverage   52.19%   52.32%   +0.12%     
==========================================
  Files        1556     1558       +2     
  Lines       79527    79655     +128     
  Branches     7089     7127      +38     
==========================================
+ Hits        41509    41677     +168     
+ Misses      34268    34226      -42     
- Partials     3750     3752       +2     
Flag Coverage Δ
#go 52.38% <ø> (-0.01%) ⬇️
#integration 30.42% <0.00%> (+0.06%) ⬆️
#storybook 25.79% <100.00%> (+3.60%) ⬆️
#typescript 52.18% <100.00%> (+0.45%) ⬆️
#unit 33.92% <ø> (ø)
Impacted Files Coverage Δ
...mponents/panel/views/HierarchicalLocationsView.tsx 76.31% <100.00%> (ø)
...randed/src/components/panel/views/contributions.ts 100.00% <100.00%> (+100.00%) ⬆️
.../internal/codeintel/resolvers/graphql/locations.go 81.44% <0.00%> (-4.13%) ⬇️
...eb/src/enterprise/codeintel/CodeIntelIndexPage.tsx 57.62% <0.00%> (-1.70%) ⬇️
...anded/src/components/panel/views/FileLocations.tsx 82.69% <0.00%> (ø)
client/shared/src/util/url.ts 90.13% <0.00%> (+0.89%) ⬆️
client/web/src/repo/RepoContainer.tsx 78.70% <0.00%> (+0.92%) ⬆️
...ent/shared/src/api/client/services/contribution.ts 84.15% <0.00%> (+3.96%) ⬆️
client/shared/src/components/Resizable.tsx 50.98% <0.00%> (+50.98%) ⬆️
... and 2 more

@felixfbecker
Copy link
Contributor

Sorry approved the wrong PR

@@ -169,7 +169,7 @@ const parsePosition = (string: string): Position => {
*/
export function parseRepoURI(uri: RepoURI): ParsedRepoURI {
const parsed = new URL(uri)
const repoName = parsed.hostname + parsed.pathname
const repoName = parsed.hostname + parsed.pathname.replace(/^\/\//, '')
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Why is this needed? Where do those double slashes come from?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I forgot to extract this and deal with it separately. I will remove it from this PR.

In storybooks, there is no URL polyfill, so it treats git:// URIs as having a pathname of //example.com/foo and no hostname. In the main app, our URL polyfill (incorrectly per the spec) treats URIs of all schemes the same, so this is not needed. The reason I included this change here is that the storybook for this component would show the repo name as //github.com/foo/bar, which was weird. But this is a bigger change and should not be in this PR.

BTW, I think it would be good to completely remove these git:// URIs from this part of our app if possible (and probably even everywhere). What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should just include all polyfills in Storybook - we already include e.g. focus-visible. Iirc we have a shared polyfill.ts file that we could just properly share with the webapp.

URL polyfill comes from babel-preset-env/core-js, which we share in Storybook too, so that should work.

BTW, I think it would be good to completely remove these git:// URIs from this part of our app if possible (and probably even everywhere). What do you think?

I totally agree, these URIs are a pain everywhere they exist. I just never had the time to really rip them out. I think we're also gonna add alternative APIs to extensions next iteration so URI parsing is no longer needed, but even just not relying on them outside of the extension host would be great.

@sqs sqs merged commit 95fee8b into main Oct 22, 2020
@sqs sqs deleted the sqs/scss/hlv branch October 22, 2020 03:46
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.

None yet

2 participants