Skip to content

Commit e9ec41f

Browse files
author
n3kosempai
committed
[release] fixed the category install process
1 parent 6cfbacb commit e9ec41f

4 files changed

Lines changed: 89 additions & 34 deletions

File tree

io.github.N3kosempai.klia-store.metainfo.xml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,13 @@
3737
<binary>klia-store</binary>
3838
</provides>
3939
<releases>
40-
<release version="2.0.1" date="2025-11-24">
40+
<release version="2.0.2" date="2025-11-27">
4141
<description>
42-
<p>🎉 Major redesign! Experience Klia Store like never before with a stunning visual overhaul and powerful new features:</p>
42+
<p>Navigation and scroll restoration improvements:</p>
4343
<ul>
44-
<li>✨ Complete UI redesign with modern, sleek interface and smooth animations</li>
45-
<li>🎨 Beautiful card-based layouts with enhanced visual hierarchy</li>
46-
<li>🔍 Lightning-fast search with instant results and improved relevance</li>
47-
<li>🌟 Redesigned home page featuring spotlight apps and curated collections</li>
48-
<li>📱 Smart notification system to keep you updated on the latest news</li>
49-
<li>🎯 Enhanced app details with richer information and better presentation</li>
50-
<li>🚀 Improved performance and faster app loading times</li>
51-
<li>🆕 Fresh new logo reflecting our modern identity</li>
52-
<li>💬 Join our new Telegram community for support and updates</li>
53-
<li>🔧 Numerous bug fixes and stability improvements</li>
44+
<li>Fixed category apps navigation to properly redirect to app details page</li>
45+
<li>Implemented scroll position restoration when navigating back from app details</li>
46+
<li>Improved navigation stack system to prevent view overlapping issues</li>
5447
</ul>
5548
</description>
5649
</release>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "klia-store",
33
"private": true,
4-
"version": "2.0.1",
4+
"version": "2.0.2",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "klia-store",
4-
"version": "2.0.1",
4+
"version": "2.0.2",
55
"identifier": "io.github.N3kosempai.klia-store",
66
"build": {
77
"beforeDevCommand": "npm run dev",

src/App.tsx

Lines changed: 82 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Box } from "@mui/material";
2-
import { useState } from "react";
2+
import { useRef, useState } from "react";
33
import TitleBar from "./components/TitleBar";
44
import { useAppInitialization } from "./hooks/useAppInitialization";
55
import { useInstalledApps } from "./hooks/useInstalledApps";
@@ -11,12 +11,22 @@ import { Welcome } from "./pages/welcome/Welcome";
1111
import type { AppStream } from "./types";
1212
import "./App.css";
1313

14+
type ViewType = "home" | "appDetails" | "category" | "myApps";
15+
16+
interface NavigationState {
17+
view: ViewType;
18+
app?: AppStream;
19+
category?: string;
20+
scrollPosition?: number;
21+
}
22+
1423
function App() {
15-
const [selectedApp, setSelectedApp] = useState<AppStream | null>(null);
16-
const [selectedCategory, setSelectedCategory] = useState<string | null>(null);
17-
const [showMyApps, setShowMyApps] = useState(false);
24+
const [navigationStack, setNavigationStack] = useState<NavigationState[]>([
25+
{ view: "home" },
26+
]);
1827
const [showWelcome, setShowWelcome] = useState(true);
1928
const { isFirstLaunch, isInitializing, error } = useAppInitialization();
29+
const scrollContainerRef = useRef<HTMLDivElement>(null);
2030

2131
// Load installed apps on startup (non-blocking)
2232
// This also loads available updates after installed apps are loaded
@@ -26,6 +36,62 @@ function App() {
2636
setShowWelcome(false);
2737
};
2838

39+
const currentState = navigationStack[navigationStack.length - 1];
40+
41+
const saveScrollPosition = () => {
42+
if (scrollContainerRef.current) {
43+
const scrollPosition = scrollContainerRef.current.scrollTop;
44+
setNavigationStack((prev) => {
45+
const newStack = [...prev];
46+
newStack[newStack.length - 1] = {
47+
...newStack[newStack.length - 1],
48+
scrollPosition,
49+
};
50+
return newStack;
51+
});
52+
}
53+
};
54+
55+
const restoreScrollPosition = (position?: number) => {
56+
if (scrollContainerRef.current && position !== undefined) {
57+
scrollContainerRef.current.scrollTop = position;
58+
}
59+
};
60+
61+
const navigateTo = (state: NavigationState) => {
62+
saveScrollPosition();
63+
setNavigationStack((prev) => [...prev, state]);
64+
// Reset scroll to top for new views
65+
if (scrollContainerRef.current) {
66+
scrollContainerRef.current.scrollTop = 0;
67+
}
68+
};
69+
70+
const navigateBack = () => {
71+
if (navigationStack.length > 1) {
72+
setNavigationStack((prev) => {
73+
const newStack = prev.slice(0, -1);
74+
// Restore scroll position after state update
75+
setTimeout(() => {
76+
restoreScrollPosition(newStack[newStack.length - 1].scrollPosition);
77+
}, 0);
78+
return newStack;
79+
});
80+
}
81+
};
82+
83+
const handleAppSelect = (app: AppStream) => {
84+
navigateTo({ view: "appDetails", app });
85+
};
86+
87+
const handleCategorySelect = (categoryId: string) => {
88+
navigateTo({ view: "category", category: categoryId });
89+
};
90+
91+
const handleMyAppsClick = () => {
92+
navigateTo({ view: "myApps" });
93+
};
94+
2995
// Show loading state while initializing
3096
if (isInitializing) {
3197
return (
@@ -97,6 +163,7 @@ function App() {
97163
<>
98164
<TitleBar />
99165
<Box
166+
ref={scrollContainerRef}
100167
sx={{
101168
marginTop: "40px",
102169
height: "calc(100vh - 40px)",
@@ -105,30 +172,25 @@ function App() {
105172
borderTop: "none",
106173
}}
107174
>
108-
{selectedApp && (
109-
<AppDetails
110-
app={selectedApp}
111-
onBack={() => {
112-
setSelectedApp(null);
113-
}}
114-
/>
175+
{currentState.view === "appDetails" && currentState.app && (
176+
<AppDetails app={currentState.app} onBack={navigateBack} />
115177
)}
116178

117-
{selectedCategory && (
179+
{currentState.view === "category" && currentState.category && (
118180
<CategoryApps
119-
categoryId={selectedCategory}
120-
onBack={() => setSelectedCategory(null)}
121-
onAppSelect={setSelectedApp}
181+
categoryId={currentState.category}
182+
onBack={navigateBack}
183+
onAppSelect={handleAppSelect}
122184
/>
123185
)}
124186

125-
{showMyApps && <MyApps onBack={() => setShowMyApps(false)} />}
187+
{currentState.view === "myApps" && <MyApps onBack={navigateBack} />}
126188

127-
{!selectedApp && !selectedCategory && !showMyApps && (
189+
{currentState.view === "home" && (
128190
<Home
129-
onAppSelect={setSelectedApp}
130-
onCategorySelect={setSelectedCategory}
131-
onMyAppsClick={() => setShowMyApps(true)}
191+
onAppSelect={handleAppSelect}
192+
onCategorySelect={handleCategorySelect}
193+
onMyAppsClick={handleMyAppsClick}
132194
/>
133195
)}
134196
</Box>

0 commit comments

Comments
 (0)