App fixes 0.9.0 (#3034)

* push fixes to test on windows

* Fix searching mods

* Fix search not saving, fix scrolling issues, etc
This commit is contained in:
Geometrically
2024-12-17 23:23:30 -07:00
committed by GitHub
parent 7e8ceadfd4
commit 6ceed4b226
19 changed files with 280 additions and 178 deletions

View File

@@ -118,7 +118,7 @@ pub async fn profile_create(
&state.file_watcher,
&state.directories,
)
.await?;
.await;
profile.upsert(&state.pool).await?;

View File

@@ -87,7 +87,7 @@ pub async fn init_watcher() -> crate::Result<FileWatcher> {
pub(crate) async fn watch_profiles_init(
watcher: &FileWatcher,
dirs: &DirectoryInfo,
) -> crate::Result<()> {
) {
if let Ok(profiles_dir) = std::fs::read_dir(dirs.profiles_dir()) {
for profile_dir in profiles_dir {
if let Ok(file_name) = profile_dir.map(|x| x.file_name()) {
@@ -96,20 +96,18 @@ pub(crate) async fn watch_profiles_init(
continue;
};
watch_profile(file_name, watcher, dirs).await?;
watch_profile(file_name, watcher, dirs).await;
}
}
}
}
Ok(())
}
pub(crate) async fn watch_profile(
profile_path: &str,
watcher: &FileWatcher,
dirs: &DirectoryInfo,
) -> crate::Result<()> {
) {
let profile_path = dirs.profiles_dir().join(profile_path);
if profile_path.exists() && profile_path.is_dir() {
@@ -120,15 +118,25 @@ pub(crate) async fn watch_profile(
let path = profile_path.join(folder);
if !path.exists() && !path.is_symlink() {
crate::util::io::create_dir_all(&path).await?;
if let Err(e) = crate::util::io::create_dir_all(&path).await {
tracing::error!(
"Failed to create directory for watcher {path:?}: {e}"
);
return;
}
}
let mut watcher = watcher.write().await;
watcher.watcher().watch(&path, RecursiveMode::Recursive)?;
if let Err(e) =
watcher.watcher().watch(&path, RecursiveMode::Recursive)
{
tracing::error!(
"Failed to watch directory for watcher {path:?}: {e}"
);
return;
}
}
}
Ok(())
}
fn crash_task(path: String) {

View File

@@ -146,7 +146,7 @@ impl State {
let discord_rpc = DiscordGuard::init()?;
let file_watcher = fs_watcher::init_watcher().await?;
fs_watcher::watch_profiles_init(&file_watcher, &directories).await?;
fs_watcher::watch_profiles_init(&file_watcher, &directories).await;
let process_manager = ProcessManager::new();

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="10" x2="14" y1="2" y2="2"/><line x1="12" x2="15" y1="14" y2="11"/><circle cx="12" cy="14" r="8"/></svg>

After

Width:  |  Height:  |  Size: 295 B

View File

@@ -180,6 +180,7 @@ import _CPUIcon from './icons/cpu.svg?component'
import _DBIcon from './icons/db.svg?component'
import _LoaderIcon from './icons/loader.svg?component'
import _ImportIcon from './icons/import.svg?component'
import _TimerIcon from './icons/timer.svg?component'
// Editor Icons
import _BoldIcon from './icons/bold.svg?component'
@@ -381,3 +382,4 @@ export const DBIcon = _DBIcon
export const LoaderIcon = _LoaderIcon
export const ImportIcon = _ImportIcon
export const CardIcon = _CardIcon
export const TimerIcon = _TimerIcon

View File

@@ -3,7 +3,7 @@
ref="dropdown"
no-auto-focus
:aria-id="dropdownId || null"
@hide="focusTrigger"
@apply-hide="focusTrigger"
@apply-show="focusMenuChild"
>
<button ref="trigger" v-bind="$attrs" v-tooltip="tooltip">

View File

@@ -83,7 +83,7 @@ function setSelected(value: boolean) {
<ContentListItem
v-model="selectionStates[ref.filename]"
:item="ref"
:last="false"
:last="ref === items.length - 1"
class="mb-2"
@update:model-value="updateSelection"
>

View File

@@ -534,6 +534,10 @@ export function useSearch(
currentPage.value = Number(page)
readParams.add('page')
})
loadQueryParam(['q'], (queryVal) => {
query.value = String(queryVal)
readParams.add('q')
})
for (const key of Object.keys(route.query).filter((key) => !readParams.has(key))) {
const type = filters.value.find((type) => type.query_param === key)