-
Notifications
You must be signed in to change notification settings - Fork 123
Project pages! #1028
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
Open
skyfallwastaken
wants to merge
9
commits into
main
Choose a base branch
from
projects-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Project pages! #1028
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
009a220
Add project pages
skyfallwastaken e223a9c
oops I forgor to add my unstaged files
skyfallwastaken a6b4cb6
Formatting and stats and things...
skyfallwastaken c54975b
Fix Brakeman false positive
skyfallwastaken 6a877c0
Some fixes?
skyfallwastaken b761938
Move to helper
skyfallwastaken 5608add
Merge branch 'main' into projects-page
skyfallwastaken b0993db
Some cleanup?
skyfallwastaken 608b553
Merge branch 'projects-page' of github.com:hackclub/hackatime into pr…
skyfallwastaken 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
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
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
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,73 @@ | ||
| <script lang="ts"> | ||
| import { secondsToDisplay } from "../Home/signedIn/utils"; | ||
|
|
||
| let { | ||
| entries, | ||
| initialVisible = 5, | ||
| totalFileCount = 0, | ||
| }: { | ||
| entries: [string, number][]; | ||
| initialVisible?: number; | ||
| totalFileCount?: number; | ||
| } = $props(); | ||
|
|
||
| let expanded = $state(false); | ||
|
|
||
| const visibleEntries = $derived( | ||
| expanded ? entries : entries.slice(0, initialVisible), | ||
| ); | ||
| const hasMore = $derived(entries.length > initialVisible); | ||
| const hiddenCount = $derived(entries.length - initialVisible); | ||
| const unlistedCount = $derived( | ||
| totalFileCount > entries.length ? totalFileCount - entries.length : 0, | ||
| ); | ||
| </script> | ||
|
|
||
| <div class="rounded-xl border border-surface-200 bg-dark/50 p-6"> | ||
| <div class="mb-4 flex items-baseline justify-between gap-2"> | ||
| <h3 class="text-lg font-semibold text-surface-content/90">Files</h3> | ||
| {#if totalFileCount > 0} | ||
| <span class="text-xs text-muted"> | ||
| {entries.length} shown · {totalFileCount} total | ||
| </span> | ||
| {/if} | ||
| </div> | ||
|
|
||
| {#if entries.length > 0} | ||
| <div class="divide-y divide-surface-200/30"> | ||
| {#each visibleEntries as [label, seconds]} | ||
| <div class="flex items-center justify-between gap-4 py-2.5"> | ||
| <span | ||
| class="min-w-0 flex-1 truncate font-mono text-sm text-surface-content/80" | ||
| title={label} | ||
| > | ||
| {label} | ||
| </span> | ||
| <span class="shrink-0 font-mono text-sm font-medium text-primary"> | ||
| {secondsToDisplay(seconds)} | ||
| </span> | ||
| </div> | ||
| {/each} | ||
| </div> | ||
|
|
||
| {#if hasMore} | ||
| <button | ||
| type="button" | ||
| class="mt-3 w-full rounded-lg border border-surface-200/40 py-2 text-center text-sm text-muted transition-colors hover:border-primary/40 hover:text-primary" | ||
| onclick={() => (expanded = !expanded)} | ||
| > | ||
| {expanded | ||
| ? "Show fewer" | ||
| : `Show ${hiddenCount} more file${hiddenCount === 1 ? "" : "s"}`} | ||
| </button> | ||
| {/if} | ||
|
|
||
| {#if unlistedCount > 0} | ||
| <p class="mt-2 text-center text-xs text-muted"> | ||
| + {unlistedCount} file{unlistedCount === 1 ? "" : "s"} under 1 min not shown | ||
| </p> | ||
| {/if} | ||
| {:else} | ||
| <p class="text-sm italic text-muted">No file data yet.</p> | ||
| {/if} | ||
| </div> |
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.