Skip to content
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

feat(console): Improve UX by preventing screen flickering #133

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

jingjing2222
Copy link
Contributor

@jingjing2222 jingjing2222 commented Feb 21, 2025

  1. Splash screen displayed only on initial application entry.
  2. Minimized data fetching frequency and eliminated visual flickering using @tanstack/solid-query's query key feature.
  • (Note: solid-router version 0.14.10 prevents the direct usage of query in route components. Data prefetching or alternative strategies may be needed).
2025-02-21.11.39.21.mov

Closed #131

solid-router version 0.14.10 prevents the direct usage of useQuery in route components. Data prefetching or alternative strategies may be needed
@jingjing2222 jingjing2222 changed the title Feat/improveux feat(console): Improve UX by preventing screen flicking Feb 21, 2025
@jingjing2222 jingjing2222 changed the title feat(console): Improve UX by preventing screen flicking feat(console): Improve UX by preventing screen flickering Feb 21, 2025
"@hot-updater/plugin-core": "0.11.0"
"@hot-updater/core": "0.10.1",
"@hot-updater/plugin-core": "0.10.1",
"@tanstack/solid-query": "^5.66.4"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to devDeps


onMount(() => {
setTimeout(() => {
setOnSuspense(true);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed that before install @TanStack-Query, but now doesn't.
I will modify that logic soon.

@jingjing2222 jingjing2222 force-pushed the feat/improveux branch 2 times, most recently from db8e8a1 to 4457c44 Compare February 21, 2025 05:09
Copy link
Contributor Author

@jingjing2222 jingjing2222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did you said, Check plz

import Home from "./routes";
export const queryClient = new QueryClient();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is being provided through a provider, direct access from other places must be prevented.

Suggested change
export const queryClient = new QueryClient();
const queryClient = new QueryClient();

const handleClose = () => {
start(() => {
setSelectedBundleId(null);
queryClient.invalidateQueries({ queryKey: ["getBundles"] });
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t it okay if invalidate doesn’t happen when closing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleClose function is only activated with Clicking save button.
I think improving invalidation is safer.. but I don't think that has to be.
How about you? You don't think that as me?

const [data, { refetch }] = createResource(() =>
api.getBundles.$get().then((res) => res.json()),
);
const data = createQuery(() => ({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a good idea to extract it into hooks:
• useBundles() → returns all bundles
• useBundle(id) → returns a specific bundle

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console already has that getBundelById(id) in EditBundleSheetContent Component
I think getBundles is better in index.tsx

1. Splash screen displayed only on initial application entry.
2. Minimized data fetching frequency and eliminated visual flickering using @tanstack/solid-query's query key feature.
@gronxb gronxb merged commit 94afd64 into gronxb:main Feb 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants