Skip to content

Commit bca77a8

Browse files
authored
[release] Merge pull request #14 from N3koSempai/minorChange
Minor change
2 parents fcd2278 + e6ce07f commit bca77a8

11 files changed

Lines changed: 688 additions & 597 deletions

File tree

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,14 @@
4747
<binary>klia-store</binary>
4848
</provides>
4949
<releases>
50-
<release version="2.5.42" date="2026-01-15">
50+
<release version="2.5.5" date="2026-01-21">
5151
<description>
52-
<p>🚨 Critical Hotfix:</p>
52+
<p>✨ Improvements:</p>
5353
<ul>
54-
<li>Fixed network connectivity issues caused by upstream dependency bug in tauri-plugin-http v2.5.5</li>
55-
<li>Pinned plugin versions to stable releases to prevent automatic updates breaking functionality</li>
56-
<li>Restored full functionality for fetching app metadata, images, and repository information</li>
57-
</ul>
58-
</description>
59-
</release>
60-
<release version="2.5.41" date="2025-01-15">
61-
<description>
62-
<p>🔧 Technical Update:</p>
63-
<ul>
64-
<li>Added donation metadata for upcoming feature development</li>
54+
<li>My Apps section now prioritizes apps with available updates at the top of the list</li>
55+
<li>Search results are now preserved when navigating to app details and back</li>
56+
<li>Added clear button (X) to search bar for quick search reset</li>
57+
<li>Improved navigation flow: returning from categories and My Apps now shows clean home screen</li>
6558
</ul>
6659
</description>
6760
</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.5.42",
4+
"version": "2.5.5",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "klia-store"
3-
version = "2.5.42"
3+
version = "2.5.5"
44
description = "A Tauri App"
55
authors = ["you"]
66
edition = "2021"

src/App.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ interface NavigationState {
2323
developerName?: string;
2424
developerAppId?: string;
2525
scrollPosition?: number;
26+
searchQuery?: string;
27+
searchResults?: CategoryApp[];
2628
}
2729

2830
function App() {
@@ -76,7 +78,19 @@ function App() {
7678
const navigateBack = () => {
7779
if (navigationStack.length > 1) {
7880
setNavigationStack((prev) => {
81+
const currentView = prev[prev.length - 1].view;
7982
const newStack = prev.slice(0, -1);
83+
const targetState = newStack[newStack.length - 1];
84+
85+
// Clear search state when going back to home from views other than appDetails
86+
if (targetState.view === "home" && currentView !== "appDetails") {
87+
newStack[newStack.length - 1] = {
88+
...targetState,
89+
searchQuery: undefined,
90+
searchResults: undefined,
91+
};
92+
}
93+
8094
// Restore scroll position after state update
8195
setTimeout(() => {
8296
restoreScrollPosition(newStack[newStack.length - 1].scrollPosition);
@@ -86,7 +100,19 @@ function App() {
86100
}
87101
};
88102

89-
const handleAppSelect = (app: CategoryApp) => {
103+
const handleAppSelect = (app: CategoryApp, searchQuery?: string, searchResults?: CategoryApp[]) => {
104+
// Save search state in current navigation state before navigating
105+
if (searchQuery && searchResults) {
106+
setNavigationStack((prev) => {
107+
const newStack = [...prev];
108+
newStack[newStack.length - 1] = {
109+
...newStack[newStack.length - 1],
110+
searchQuery,
111+
searchResults,
112+
};
113+
return newStack;
114+
});
115+
}
90116
navigateTo({ view: "appDetails", app });
91117
};
92118

@@ -227,6 +253,8 @@ function App() {
227253
onAppSelect={handleAppSelect}
228254
onCategorySelect={handleCategorySelect}
229255
onMyAppsClick={handleMyAppsClick}
256+
initialSearchQuery={currentState.searchQuery}
257+
initialSearchResults={currentState.searchResults}
230258
/>
231259
)}
232260
</Box>
828 KB
Loading
554 KB
Loading

src/components/AppSearchBar.tsx

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import CloseIcon from "@mui/icons-material/Close";
12
import SearchIcon from "@mui/icons-material/Search";
2-
import { CircularProgress, InputAdornment, TextField } from "@mui/material";
3-
import { useState } from "react";
3+
import { CircularProgress, IconButton, InputAdornment, TextField } from "@mui/material";
4+
import { useEffect, useState } from "react";
45
import { useTranslation } from "react-i18next";
56
import { useDebouncedCallback } from "use-debounce";
67
import { apiService } from "../services/api";
@@ -9,13 +10,19 @@ import type { CategoryApp } from "../types";
910
interface AppSearchBarProps {
1011
onSearch: (query: string, results: CategoryApp[]) => void;
1112
onLoading: (isLoading: boolean) => void;
13+
initialValue?: string;
1214
}
1315

14-
export const AppSearchBar = ({ onSearch, onLoading }: AppSearchBarProps) => {
16+
export const AppSearchBar = ({ onSearch, onLoading, initialValue = "" }: AppSearchBarProps) => {
1517
const { t } = useTranslation();
16-
const [inputValue, setInputValue] = useState("");
18+
const [inputValue, setInputValue] = useState(initialValue);
1719
const [isSearching, setIsSearching] = useState(false);
1820

21+
// Update input value when initialValue changes (e.g., navigating back)
22+
useEffect(() => {
23+
setInputValue(initialValue);
24+
}, [initialValue]);
25+
1926
const performSearch = useDebouncedCallback(async (query: string) => {
2027
if (!query.trim()) {
2128
onLoading(false);
@@ -49,6 +56,12 @@ export const AppSearchBar = ({ onSearch, onLoading }: AppSearchBarProps) => {
4956
performSearch(value);
5057
};
5158

59+
const handleClear = () => {
60+
setInputValue("");
61+
onSearch("", []);
62+
onLoading(false);
63+
};
64+
5265
return (
5366
<TextField
5467
fullWidth
@@ -84,11 +97,26 @@ export const AppSearchBar = ({ onSearch, onLoading }: AppSearchBarProps) => {
8497
<SearchIcon sx={{ color: "text.secondary" }} />
8598
</InputAdornment>
8699
),
87-
endAdornment: isSearching ? (
100+
endAdornment: (
88101
<InputAdornment position="end">
89-
<CircularProgress size={20} sx={{ color: "primary.main" }} />
102+
{isSearching ? (
103+
<CircularProgress size={20} sx={{ color: "primary.main" }} />
104+
) : inputValue ? (
105+
<IconButton
106+
onClick={handleClear}
107+
sx={{
108+
color: "text.secondary",
109+
padding: "8px",
110+
"&:hover": {
111+
color: "primary.main",
112+
},
113+
}}
114+
>
115+
<CloseIcon />
116+
</IconButton>
117+
) : null}
90118
</InputAdornment>
91-
) : null,
119+
),
92120
}}
93121
/>
94122
);

src/pages/home/Home.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,26 @@ import { CategoriesSection } from "./components/CategoriesSection";
2727
import { FeaturedSection } from "./components/FeaturedSection";
2828

2929
interface HomeProps {
30-
onAppSelect: (app: CategoryApp) => void;
30+
onAppSelect: (app: CategoryApp, searchQuery?: string, searchResults?: CategoryApp[]) => void;
3131
onCategorySelect: (categoryId: string) => void;
3232
onMyAppsClick: () => void;
33+
initialSearchQuery?: string;
34+
initialSearchResults?: CategoryApp[];
3335
}
3436

3537
export const Home = ({
3638
onAppSelect,
3739
onCategorySelect,
3840
onMyAppsClick,
41+
initialSearchQuery = "",
42+
initialSearchResults = [],
3943
}: HomeProps) => {
4044
const { t } = useTranslation();
4145
const { getUpdateCount } = useInstalledAppsStore();
4246
const updateCount = getUpdateCount();
43-
const [searchResults, setSearchResults] = useState<CategoryApp[]>([]);
47+
const [searchResults, setSearchResults] = useState<CategoryApp[]>(initialSearchResults);
4448
const [isSearching, setIsSearching] = useState(false);
45-
const [searchQuery, setSearchQuery] = useState("");
49+
const [searchQuery, setSearchQuery] = useState(initialSearchQuery);
4650
const [aboutModalOpen, setAboutModalOpen] = useState(false);
4751

4852
const {
@@ -59,7 +63,7 @@ export const Home = ({
5963
};
6064

6165
const handleAppClick = (categoryApp: CategoryApp) => {
62-
onAppSelect(categoryApp);
66+
onAppSelect(categoryApp, searchQuery, searchResults);
6367
};
6468

6569
const showSearchResults = searchQuery.trim().length > 0;
@@ -122,7 +126,11 @@ export const Home = ({
122126
</Paper>
123127

124128
{/* Barra de Búsqueda con componente integrado */}
125-
<AppSearchBar onSearch={handleSearch} onLoading={setIsSearching} />
129+
<AppSearchBar
130+
onSearch={handleSearch}
131+
onLoading={setIsSearching}
132+
initialValue={initialSearchQuery}
133+
/>
126134

127135
<NotificationMenu
128136
notifications={notifications}

src/pages/home/components/FeaturedSection.tsx

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
44
import { CachedImage } from "../../../components/CachedImage";
55
import { useAppOfTheDay } from "../../../hooks/useAppOfTheDay";
66
import type { AppStream, CategoryApp } from "../../../types";
7+
import hetairosLogo from "../../../assets/internalPromo/hentairos_logo.png";
78

89
interface FeaturedSectionProps {
910
onAppSelect: (app: CategoryApp) => void;
@@ -51,7 +52,17 @@ interface PromotedAppCardData {
5152
}
5253

5354
// Set to null to disable promoted app
54-
const PROMOTED_APP: PromotedAppCardData | null = null;
55+
const PROMOTED_APP: PromotedAppCardData | null = {
56+
appId: "io.github.N3kosempai.hetairos-ai",
57+
name: "Hetairos AI",
58+
summary: "Your AI Companion. Loyal. Intelligent. Personal.",
59+
icon: hetairosLogo,
60+
appStream: {
61+
id: "io.github.N3kosempai.hetairos-ai",
62+
name: "Hetairos AI",
63+
summary: "Your AI Companion. Loyal. Intelligent. Personal.",
64+
} as AppStream,
65+
};
5566

5667
export const FeaturedSection = ({ onAppSelect }: FeaturedSectionProps) => {
5768
const { t } = useTranslation();
@@ -66,8 +77,8 @@ export const FeaturedSection = ({ onAppSelect }: FeaturedSectionProps) => {
6677
type Slide = BackendSlide | PromotedSlide;
6778

6879
const slides: Slide[] = [];
69-
if (appOfTheDay) slides.push({ type: "backend", data: appOfTheDay });
7080
if (PROMOTED_APP) slides.push({ type: "promoted", data: PROMOTED_APP });
81+
if (appOfTheDay) slides.push({ type: "backend", data: appOfTheDay });
7182

7283
const totalSlides = slides.length;
7384

@@ -211,30 +222,32 @@ export const FeaturedSection = ({ onAppSelect }: FeaturedSectionProps) => {
211222
overflow: "hidden",
212223
}}
213224
>
214-
<CachedImage
215-
appId={
216-
currentSlide.type === "backend"
217-
? currentSlide.data?.app_id || ""
218-
: currentSlide.data.appId
219-
}
220-
imageUrl={
221-
currentSlide.type === "backend"
222-
? currentSlide.data?.icon || ""
223-
: currentSlide.data.icon
224-
}
225-
alt={
226-
currentSlide.type === "backend"
227-
? currentSlide.data?.name ||
228-
currentSlide.data?.app_id ||
229-
""
230-
: currentSlide.data.name
231-
}
232-
style={{
233-
width: "100%",
234-
height: "100%",
235-
objectFit: "contain",
236-
}}
237-
/>
225+
{currentSlide.type === "promoted" ? (
226+
<img
227+
src={currentSlide.data.icon}
228+
alt={currentSlide.data.name}
229+
style={{
230+
width: "100%",
231+
height: "100%",
232+
objectFit: "contain",
233+
}}
234+
/>
235+
) : (
236+
<CachedImage
237+
appId={currentSlide.data?.app_id || ""}
238+
imageUrl={currentSlide.data?.icon || ""}
239+
alt={
240+
currentSlide.data?.name ||
241+
currentSlide.data?.app_id ||
242+
""
243+
}
244+
style={{
245+
width: "100%",
246+
height: "100%",
247+
objectFit: "contain",
248+
}}
249+
/>
250+
)}
238251
</Box>
239252
</Box>
240253

0 commit comments

Comments
 (0)