-
Notifications
You must be signed in to change notification settings - Fork 191
Fix: usage shifts #2345
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
ItzNotABug
wants to merge
6
commits into
main
Choose a base branch
from
fix-usage-layout-shifts
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
Fix: usage shifts #2345
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
60d6ead
update: bye, bye usage layout shift 👋
ItzNotABug c4b925c
Merge branch 'main' into fix-usage-layout-shifts
ItzNotABug cc02dab
Merge branch 'main' into 'fix-usage-layout-shifts'.
ItzNotABug 7e4e4c0
Merge branch 'main' into fix-usage-layout-shifts
ItzNotABug df7f405
update: fixes to designs.
ItzNotABug 7cb4a5a
address comments from coderabbit.
ItzNotABug 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
69 changes: 69 additions & 0 deletions
69
...utes/(console)/project-[region]-[project]/overview/(components)/skeletons/extended.svelte
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,69 @@ | ||
<script lang="ts"> | ||
import { fade } from 'svelte/transition'; | ||
import { Layout, Skeleton, Typography } from '@appwrite.io/pink-svelte'; | ||
|
||
let { | ||
loading = false, | ||
metricName, | ||
resourceMetric = null | ||
}: { | ||
loading: boolean; | ||
metricName: string; | ||
resourceMetric?: | ||
| string | ||
| { | ||
value: string; | ||
unit: string; | ||
} | ||
| null; | ||
} = $props(); | ||
|
||
function isMetricObject( | ||
metric: typeof resourceMetric | ||
): metric is { value: string; unit: string } { | ||
return metric !== null && typeof metric === 'object'; | ||
} | ||
</script> | ||
|
||
<Layout.Stack gap="xxxs"> | ||
<Typography.Title> | ||
<div class="overlay-container"> | ||
{#if loading} | ||
<div class="overlay-item skeleton" transition:fade={{ duration: 300 }}> | ||
<Skeleton height="100%" width="7.5rem" variant="line" style="opacity: 0.35" /> | ||
</div> | ||
{:else if resourceMetric !== null} | ||
<div class="overlay-item" transition:fade={{ duration: 300 }}> | ||
{#if isMetricObject(resourceMetric)} | ||
{resourceMetric.value} | ||
<span style:line-height="0%" style:font-size="var(--font-size-0)"> | ||
{resourceMetric.unit} | ||
</span> | ||
{:else} | ||
{resourceMetric} | ||
{/if} | ||
</div> | ||
{/if} | ||
</div> | ||
</Typography.Title> | ||
|
||
<Typography.Text>{metricName}</Typography.Text> | ||
</Layout.Stack> | ||
|
||
<style lang="scss"> | ||
.overlay-container { | ||
display: grid; | ||
min-height: 1lh; | ||
align-items: stretch; | ||
grid-template-areas: 'content'; | ||
} | ||
|
||
.overlay-item { | ||
grid-area: content; | ||
|
||
&.skeleton { | ||
display: flex; | ||
align-items: center; | ||
} | ||
} | ||
</style> |
61 changes: 61 additions & 0 deletions
61
...routes/(console)/project-[region]-[project]/overview/(components)/skeletons/simple.svelte
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 lang="ts"> | ||
import { fade } from 'svelte/transition'; | ||
import { Skeleton, Typography } from '@appwrite.io/pink-svelte'; | ||
|
||
let { | ||
value, | ||
resource, | ||
unit = null, | ||
loading = false | ||
}: { | ||
loading: boolean; | ||
resource: string; | ||
unit?: string; | ||
value: string | number | boolean; | ||
} = $props(); | ||
</script> | ||
|
||
<Typography.Title> | ||
<div class="overlay-container"> | ||
{#if loading} | ||
<div class="overlay-item skeleton" transition:fade={{ duration: 300 }}> | ||
<Skeleton | ||
height="100%" | ||
width="5rem" | ||
variant="line" | ||
style="opacity: 0.35; margin-bottom: 1rem; margin-inline-start: -2px" /> | ||
</div> | ||
{:else} | ||
<div class="overlay-item" transition:fade={{ duration: 300, delay: 150 }}> | ||
{value} | ||
{#if unit} | ||
<span style:line-height="0%" style:font-size="var(--font-size-0)"> | ||
{unit} | ||
</span> | ||
{/if} | ||
</div> | ||
{/if} | ||
</div> | ||
</Typography.Title> | ||
|
||
<Typography.Text> | ||
{resource} | ||
</Typography.Text> | ||
|
||
<style lang="scss"> | ||
.overlay-container { | ||
display: grid; | ||
min-height: 1lh; | ||
align-items: stretch; | ||
grid-template-areas: 'content'; | ||
} | ||
|
||
.overlay-item { | ||
grid-area: content; | ||
|
||
&.skeleton { | ||
display: flex; | ||
align-items: center; | ||
} | ||
} | ||
</style> |
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.