-
-
Notifications
You must be signed in to change notification settings - Fork 2
Cleanup UI on primary pages #88
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
658f441
Add sidebar
FyreByrd 787d6a6
Port icon implementation from Scriptoria
FyreByrd b3e1841
Add icons to sidebar layout
FyreByrd ae1a2dc
Display record counts in sidebar
FyreByrd c0e72a2
Redo home page info display
FyreByrd ba62edd
Remove unused function
FyreByrd 958b7e6
Fix index display in lists
FyreByrd 425f450
Fix route highlight
FyreByrd 16e2988
Fix layout
FyreByrd ba83828
Display PENDING for null result
FyreByrd 9455a09
Improve client list display
FyreByrd 02cae13
Create unified application type definition
FyreByrd bd69073
Fix sort order
FyreByrd ec25a60
Add icons to homepage
FyreByrd 74b4167
Fix some root styling
FyreByrd 0618ced
Improve project list display
FyreByrd 831953c
Add hover style to links
FyreByrd 422a6f0
Improve job list display
FyreByrd 71264cc
Improve build list display
FyreByrd 3375be6
Improve release list display
FyreByrd cf546a8
Improve about page
FyreByrd 63c437d
Add search to projects and jobs
FyreByrd a8a4477
Add search to builds and releases
FyreByrd f558044
Resolve CR feedback
FyreByrd 49338d7
Fix pagination issue
FyreByrd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| <script lang="ts"> | ||
| import type { HTMLSelectAttributes } from 'svelte/elements'; | ||
| import Dropdown, { type DropdownClasses } from '$lib/components/Dropdown.svelte'; | ||
| import { getAppIcon } from '$lib/icons'; | ||
| import IconContainer from '$lib/icons/IconContainer.svelte'; | ||
| import { byString } from '$lib/utils/sorting'; | ||
| import { applicationTypes } from '$lib/valibot'; | ||
|
|
||
| interface Props { | ||
| class?: DropdownClasses; | ||
| value: string | null; | ||
| allowNull?: boolean; | ||
| attr?: HTMLSelectAttributes; | ||
| } | ||
|
|
||
| let { class: classes = {}, value = $bindable(), allowNull = false, attr = {} }: Props = $props(); | ||
|
|
||
| const current = $derived(applicationTypes.find((type) => type === value)); | ||
|
|
||
| let open = $state(false); | ||
|
|
||
| function onclick(val: string | null) { | ||
| open = false; | ||
| value = val; | ||
| } | ||
| </script> | ||
|
|
||
| {#if attr.name} | ||
| <input type="hidden" name={attr.name} {value} /> | ||
| {/if} | ||
|
|
||
| <Dropdown | ||
| class={{ | ||
| dropdown: ['w-full', classes.dropdown], | ||
| label: ['w-full input cursor-auto', classes.label], | ||
| content: ['overflow-y-auto w-auto', classes.content] | ||
| }} | ||
| bind:open | ||
| > | ||
| {#snippet label()} | ||
| <div class="flex flex-row items-center gap-1 w-full"> | ||
| {#if current} | ||
| <IconContainer icon={getAppIcon(current)} width={24} /> | ||
| <span class="grow text-left"> | ||
| {current} | ||
| </span> | ||
| {:else} | ||
| <span class="grow font-normal text-left min-w-48">All application types</span> | ||
| {/if} | ||
| <IconContainer icon="gridicons:dropdown" width={20} /> | ||
| </div> | ||
| {/snippet} | ||
| {#snippet content()} | ||
| <ul class="menu menu-sm gap-1 p-2"> | ||
| {#if allowNull} | ||
| <li class="w-full"> | ||
| <div | ||
| class={['btn btn-ghost flex-nowrap justify-start pl-2 pr-1']} | ||
| onclick={() => onclick(null)} | ||
| onkeydown={(e) => { | ||
| if (e.key === 'Enter' || e.key === ' ') { | ||
| e.preventDefault(); | ||
| onclick(null); | ||
| } | ||
| }} | ||
| role="button" | ||
| tabindex="0" | ||
| > | ||
| <span class="grow text-left">All application types</span> | ||
| </div> | ||
| </li> | ||
| {/if} | ||
| {#each applicationTypes.toSorted((a, b) => byString(a, b)) as type} | ||
| <li class="w-full"> | ||
| <div | ||
| class={[ | ||
| 'btn flex-nowrap justify-start pl-2 pr-1', | ||
| type === value ? 'btn-secondary' : 'btn-ghost' | ||
| ]} | ||
| onclick={() => onclick(type)} | ||
| onkeydown={(e) => { | ||
| if (e.key === 'Enter' || e.key === ' ') { | ||
| e.preventDefault(); | ||
| onclick(type); | ||
| } | ||
| }} | ||
| role="button" | ||
| tabindex="0" | ||
| > | ||
| <IconContainer icon={getAppIcon(type)} width={24} /> | ||
| <span class="grow text-left"> | ||
| {type} | ||
| </span> | ||
| </div> | ||
| </li> | ||
| {/each} | ||
| </ul> | ||
| {/snippet} | ||
| </Dropdown> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| <!-- | ||
| @component | ||
| A simple dropdown menu from DaisyUI. | ||
|
|
||
| --> | ||
| <script lang="ts" module> | ||
| export type DropdownClasses = { | ||
| /** class="dropdown ..." */ | ||
| dropdown?: ClassValue; | ||
| /** class="btn btn-ghost ..." */ | ||
| label?: ClassValue; | ||
| /** class="dropdown-content z-10 drop-shadow-lg rounded-md bg-base-200 ..." */ | ||
| content?: ClassValue; | ||
| }; | ||
| </script> | ||
|
|
||
| <script lang="ts"> | ||
| import type { Snippet } from 'svelte'; | ||
| import type { ClassValue } from 'svelte/elements'; | ||
| import { onNavigate } from '$app/navigation'; | ||
| interface Props { | ||
| class?: DropdownClasses; | ||
| label: Snippet; | ||
| content: Snippet; | ||
| onclick?: () => void; | ||
| open?: boolean; | ||
| } | ||
|
|
||
| let { class: classes, label, content, onclick, open = $bindable(false) }: Props = $props(); | ||
|
|
||
| onNavigate(() => { | ||
| // close opened dropdown when navigating (this is mostly important for the dropdowns in the navbar) | ||
| open = false; | ||
| }); | ||
|
|
||
| let dropEl: HTMLDetailsElement | undefined = $state(undefined); | ||
| </script> | ||
|
|
||
| <svelte:window | ||
| onclick={(e) => { | ||
| // Only close if click is outside this dropdown | ||
| if (open && dropEl && !dropEl.contains(e.target as Node)) { | ||
| open = false; | ||
| // stopPropagation prevents the click from registering on the dropdown again and reopening it | ||
| e.stopPropagation(); | ||
| } | ||
| }} | ||
| /> | ||
|
|
||
| <details class={['dropdown', classes?.dropdown]} bind:open bind:this={dropEl}> | ||
| <summary class={['btn btn-ghost', classes?.label]} onclick={() => onclick?.()}> | ||
| {@render label()} | ||
| </summary> | ||
| <div | ||
| class={[ | ||
| 'dropdown-content z-10 drop-shadow-lg rounded-md bg-base-200 dark:border dark:border-base-content', | ||
| classes?.content | ||
| ]} | ||
| > | ||
| {@render content()} | ||
| </div> | ||
| </details> |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <script module lang="ts"> | ||
| /** Make sure to call this in SuperForms onUpdate**d**() */ | ||
| export function focusSearchBar() { | ||
| (document.querySelector('input[type="search"]') as HTMLInputElement)?.focus?.(); | ||
| } | ||
| </script> | ||
|
|
||
| <script lang="ts"> | ||
| import { onDestroy } from 'svelte'; | ||
| import type { ClassValue } from 'svelte/elements'; | ||
| import { Icons } from '$lib/icons'; | ||
| import IconContainer from '$lib/icons/IconContainer.svelte'; | ||
|
|
||
| interface Props { | ||
| class?: ClassValue; | ||
| value: string; | ||
| requestSubmit?: () => void; | ||
| requestDelay?: number; | ||
| } | ||
|
|
||
| let { | ||
| class: classes, | ||
| value = $bindable(), | ||
| requestSubmit, | ||
| requestDelay = 1_000 | ||
| }: Props = $props(); | ||
|
|
||
| let timeout: ReturnType<typeof setTimeout> | null = $state(null); | ||
|
|
||
| onDestroy(() => { | ||
| if (timeout) { | ||
| clearTimeout(timeout); | ||
| } | ||
| }); | ||
| </script> | ||
|
|
||
| <div class={[classes]} data-html="true"> | ||
| <label class="input flex items-center gap-2 w-full"> | ||
| <input | ||
| type="search" | ||
| placeholder="Search" | ||
| aria-label="Search" | ||
| class="grow" | ||
| bind:value | ||
| oninput={(e) => { | ||
| if (requestSubmit) { | ||
| if (timeout) { | ||
| clearTimeout(timeout); | ||
| } | ||
| timeout = setTimeout(requestSubmit, requestDelay); | ||
| } | ||
| }} | ||
| onfocus={(e) => { | ||
| const target = e.currentTarget; | ||
| // https://stackoverflow.com/a/10576409 | ||
| setTimeout(() => target.setSelectionRange(value.length, value.length), 0); | ||
| }} | ||
| /> | ||
| <IconContainer icon={Icons.Search} class="ml-auto cursor-pointer" width={24} /> | ||
| </label> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <script lang="ts" generics="T extends string | null"> | ||
| import { Icons } from '$lib/icons'; | ||
| import IconContainer from '$lib/icons/IconContainer.svelte'; | ||
|
|
||
| interface Props { | ||
| value?: T; | ||
| } | ||
|
|
||
| let { value }: Props = $props(); | ||
|
|
||
| let visible = $state(false); | ||
|
|
||
| // 20 is default width according to HTML 5 spec | ||
| </script> | ||
|
|
||
| <span class="inline-flex flex-row gap-x-1 font-mono"> | ||
| <input | ||
| type={visible ? 'text' : 'password'} | ||
| {value} | ||
| readonly | ||
| size={value?.length || 20} | ||
| class="w-full" | ||
| /> | ||
| {#if value?.length} | ||
| <button type="button" class="flex flex-row items-center" onclick={() => (visible = !visible)}> | ||
| <IconContainer icon={visible ? Icons.Visible : Icons.Invisible} width={16} /> | ||
| </button> | ||
| {/if} | ||
| </span> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <script lang="ts"> | ||
| import type { Snippet } from 'svelte'; | ||
| import type { ClassValue } from 'svelte/elements'; | ||
|
|
||
| interface Props { | ||
| tip?: string | null | undefined; | ||
| class?: ClassValue; | ||
| // tooltip-content can also be handled in the children snippet | ||
| children?: Snippet; | ||
| } | ||
|
|
||
| let { tip, class: classes, children }: Props = $props(); | ||
| </script> | ||
|
|
||
| <span | ||
| class={['tooltip [--tt-bg:var(--color-white)] dark:tooltip-secondary', classes]} | ||
| data-tip={tip} | ||
| > | ||
| {@render children?.()} | ||
| </span> | ||
|
|
||
| <style> | ||
| .tooltip::before, | ||
| .tooltip :global(.tooltip-content) { | ||
| box-shadow: var(--shadow-md); | ||
| } | ||
| </style> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.