-
-
Notifications
You must be signed in to change notification settings - Fork 433
feat: add permalink to downloads modal #1299
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
ghostdevv
merged 16 commits into
npmx-dev:main
from
MatteoGabriele:feat/download-stats-modal-permalink
Feb 11, 2026
Merged
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
37b9f61
feat: add permalink to downloads modal
MatteoGabriele 112491c
Merge branch 'main' into feat/download-stats-modal-permalink
MatteoGabriele fdf8719
refactor: add new types
MatteoGabriele e70eaac
refactor: types
MatteoGabriele 687b62d
refactor: move sharable types
MatteoGabriele a1ffda0
feat: use useRouteQuery
MatteoGabriele 66291d9
refactor: create composable for permalinkValue handling
MatteoGabriele f8dca0e
feat: add permalink facet
MatteoGabriele c5ddec7
Merge branch 'main' into feat/download-stats-modal-permalink
MatteoGabriele 01591d9
chore: remove export from unused type
MatteoGabriele 31705e1
chore: remove unused code
MatteoGabriele 83b052f
chore: fix typo
MatteoGabriele 19bdf3e
refactor: change name of composable
MatteoGabriele fdf6cc8
refactor: handle only strings
MatteoGabriele 7fc1010
refactor: use permalink with default value
MatteoGabriele 989d4e9
Merge branch 'main' into feat/download-stats-modal-permalink
ghostdevv 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /** | ||
| * Creates a computed property that uses route query parameters by default, | ||
| * with an option to use local state instead. | ||
| */ | ||
| export function usePermalinkValue<T extends string | number = string>( | ||
| queryKey: string, | ||
| defaultValue: T = '' as T, | ||
| options: { permanent?: boolean } = {}, | ||
| ): WritableComputedRef<T> { | ||
|
MatteoGabriele marked this conversation as resolved.
Outdated
|
||
| const { permanent = true } = options | ||
| const localValue = shallowRef<T>(defaultValue) | ||
| const routeValue = useRouteQuery<T>(queryKey, defaultValue) | ||
|
|
||
| const parmalinkValue = computed({ | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| get: () => (permanent ? routeValue.value : localValue.value), | ||
| set: (value: T) => { | ||
| if (permanent) { | ||
| routeValue.value = value | ||
| } else { | ||
| localValue.value = value | ||
| } | ||
| }, | ||
| }) | ||
|
|
||
| return parmalinkValue | ||
| } | ||
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,52 @@ | ||
| export type ChartTimeGranularity = 'daily' | 'weekly' | 'monthly' | 'yearly' | ||
|
|
||
| export type DateRangeFields = { | ||
| startDate?: string | ||
| endDate?: string | ||
| } | ||
|
|
||
| export type DailyDataPoint = { value: number; day: string; timestamp: number } | ||
| export type WeeklyDataPoint = { | ||
| value: number | ||
| weekKey: string | ||
| weekStart: string | ||
| weekEnd: string | ||
| timestampStart: number | ||
| timestampEnd: number | ||
| } | ||
| export type MonthlyDataPoint = { value: number; month: string; timestamp: number } | ||
| export type YearlyDataPoint = { value: number; year: string; timestamp: number } | ||
|
|
||
| export type EvolutionData = | ||
| | DailyDataPoint[] | ||
| | WeeklyDataPoint[] | ||
| | MonthlyDataPoint[] | ||
| | YearlyDataPoint[] | ||
|
|
||
| type EvolutionOptionsBase = { | ||
| startDate?: string | ||
| endDate?: string | ||
| } | ||
|
|
||
| export type EvolutionOptionsDay = EvolutionOptionsBase & { | ||
| granularity: 'day' | ||
| } | ||
| export type EvolutionOptionsWeek = EvolutionOptionsBase & { | ||
| granularity: 'week' | ||
| weeks?: number | ||
| } | ||
| export type EvolutionOptionsMonth = EvolutionOptionsBase & { | ||
| granularity: 'month' | ||
| months?: number | ||
| } | ||
| export type EvolutionOptionsYear = EvolutionOptionsBase & { | ||
| granularity: 'year' | ||
| } | ||
|
|
||
| export type EvolutionOptions = | ||
| | EvolutionOptionsDay | ||
| | EvolutionOptionsWeek | ||
| | EvolutionOptionsMonth | ||
| | EvolutionOptionsYear | ||
|
|
||
| export type DailyRawPoint = { day: string; value: number } |
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.