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

fix: starter screen text alignment and missing model size #3968

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
)

if (manualRecommendModel.length === 2) {
return x.id === recommendModel[0] || x.id === recommendModel[1]

Check warning on line 69 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

69 line is not covered with tests
} else {
return (
x.metadata?.tags?.includes('Featured') && x.metadata?.size < 5000000000
Expand Down Expand Up @@ -94,7 +94,7 @@
const getRows = (array: string[], itemsPerRow: number) => {
const rows = []
for (let i = 0; i < array.length; i += itemsPerRow) {
rows.push(array.slice(i, i + itemsPerRow))

Check warning on line 97 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

97 line is not covered with tests
}
return rows
}
Expand All @@ -121,7 +121,7 @@
<div className="relative" ref={refDropdown}>
<Input
value={searchValue}
onFocus={() => setIsOpen(true)}

Check warning on line 124 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

124 line is not covered with tests
onChange={(e) => {
setSearchValue(e.target.value)
}}
Expand All @@ -142,10 +142,10 @@
</div>
) : (
filteredModels.map((model) => {
const isDownloading = downloadingModels.some(
(md) => md === model.id

Check warning on line 146 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

145-146 lines are not covered with tests
)
return (

Check warning on line 148 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

148 line is not covered with tests
<div
key={model.id}
className="flex items-center justify-between gap-4 px-3 py-2 hover:bg-[hsla(var(--dropdown-menu-hover-bg))]"
Expand All @@ -168,7 +168,7 @@
size={18}
className="cursor-pointer text-[hsla(var(--app-link))]"
onClick={() =>
downloadModel(

Check warning on line 171 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

171 line is not covered with tests
model.sources[0].url,
model.id,
model.name
Expand All @@ -177,9 +177,9 @@
/>
) : (
Object.values(downloadStates)
.filter((x) => x.modelId === model.id)

Check warning on line 180 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

180 line is not covered with tests
.map((item) => (
<ProgressCircle

Check warning on line 182 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

182 line is not covered with tests
key={item.modelId}
percentage={
formatDownloadPercentage(
Expand Down Expand Up @@ -207,7 +207,7 @@
<p
className="cursor-pointer text-sm text-[hsla(var(--text-secondary))]"
onClick={() => {
setMainViewState(MainViewState.Hub)

Check warning on line 210 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

210 line is not covered with tests
}}
>
See All
Expand All @@ -221,19 +221,19 @@
return (
<div
key={featModel.id}
className="my-2 flex items-center justify-between gap-2 border-b border-[hsla(var(--app-border))] pb-4 pt-1 last:border-none"
className="my-2 flex items-start justify-between gap-2 border-b border-[hsla(var(--app-border))] pb-4 pt-1 last:border-none"
>
<div className="w-full text-left">
<h6 className="font-medium">{featModel.name}</h6>
<h6 className="mt-1.5 font-medium">{featModel.name}</h6>
</div>

{isDownloading ? (
<div className="flex w-full items-center gap-2">
<div className="flex w-full flex-col items-end gap-2">
{Object.values(downloadStates)
.filter((x) => x.modelId === featModel.id)

Check warning on line 233 in web/screens/Thread/ThreadCenterPanel/ChatBody/OnDeviceStarterScreen/index.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

233 line is not covered with tests
.map((item, i) => (
<div
className="flex w-full items-center gap-2"
className="mt-1.5 flex w-full items-center gap-2"
key={i}
>
<Progress
Expand All @@ -253,6 +253,9 @@
</div>
</div>
))}
<span className="text-[hsla(var(--text-secondary))]">
{toGibibytes(featModel.metadata?.size)}
</span>
</div>
) : (
<div className="flex flex-col items-end justify-end gap-2">
Expand Down
Loading