commit
Add a repository picker to the lookup form
Co-Authored-By: Sandrone <[email protected]>
diff --git a/src/app.css b/src/app.css
index 0101c07..0adac43 100644
--- a/src/app.css
+++ b/src/app.css
@@ -148,6 +148,7 @@ button:disabled {
cursor: wait;
}
+select,
input[type='text'],
input[type='search'],
input[type='password'] {
@@ -161,6 +162,10 @@ input[type='password'] {
color: var(--text-primary);
}
+select {
+ width: auto;
+}
+
.formRow {
display: flex;
flex-wrap: wrap;
diff --git a/src/routes/lookup/+page.svelte b/src/routes/lookup/+page.svelte
index 6dca0fb..e74ddc3 100644
--- a/src/routes/lookup/+page.svelte
+++ b/src/routes/lookup/+page.svelte
@@ -24,9 +24,12 @@
placeholder="PR number or GitHub pull request URL"
aria-label="Pull request"
/>
- {#if data.repoFilter}
- <input type="hidden" name="repo" value={data.repoFilter} />
- {/if}
+ <!-- A pasted PR URL names its own repository and wins over this choice -->
+ <select name="repo" aria-label="Repository" value={data.repoFilter ?? data.repos[0]}>
+ {#each data.repos as repo (repo)}
+ <option value={repo}>{repoLabel(repo)}</option>
+ {/each}
+ </select>
<button class="primary">Check</button>
</form>