svelte: Preserve current revision in repo search input#62822
Conversation
camdencheek
left a comment
There was a problem hiding this comment.
Tried it out locally, LGTM!
| return '' | ||
| } | ||
|
|
||
| // If the (URL) revision is or starts with the commit ID, use the abbreviated commit ID |
There was a problem hiding this comment.
Oh, that's a smart way to do it.
There was a problem hiding this comment.
In the React app we only check whether the revision is 40 chars, assume its an commit SHA and abbreviate it. This produces incorrect behavior when there is a branch name with exactly 40 chars. We should fix that... at the same time I wish there was a way to abstract all these details from components. Maybe we should compute the human readable revision in the data loader and simply pass that around.
There was a problem hiding this comment.
I moved the computation to the data loader. We are already doing something similar for repo name. https://github.com/sourcegraph/sourcegraph/pull/62822/commits/7497104c39bd238e3160c2c8b1b7a6f57db5a4ca
|
@fkling I think this broke showing suggestions right away as soon as you reveal search via |
Closes #62713
Test plan
Manually tested with default revision, selected branch and selected revision.