You've already forked AstralRinth
forked from didirus/AstralRinth
fix(theseus): Fixed multiple bugs (#1304)
* fix(theseus): Resolve log tab freezing entire app (#1127, #1237) Switched to `vue-typed-virtual-list` due to freezing issues in WebKit caused by `vue-virtual-scroller`, which were difficult to resolve with the previous library. * fix(theseus): Double opening of Socials Share link (#1136, #1074) * fix(theseus): Proper symlinks resolution (#1236) Ensures correct symlink resolution for specific mods, the mods directory, and the entire profile directory. * fix(theseus): Correctly recognize NeoForge mods (#1215) * fix(theseus): Corrected `Environments` and `Loaders` filters (#899) * fix(theseus): Remove `_JAVA_OPTIONS` when testing JRE (#1171) * fix(theseus): Fixed opening files using `show_in_folder` Previously, opening a mod would display the contents of the JAR file instead of its location. * fix(theseus): Hide `.DS_Store` files (#1274, #1002, #1174) * fix(theseus): Corrected tooltip color * fix(theseus): Fixed white mode issues (#1144, #1010) * fix: Corrected `Slider` min and max value handling (#1008) * fix: Fixed rebase problems * fix: Fixed `:deep` usage warning * chore: Updated eslint plugins to fix conflicts with Prettier
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
"vue": "^3.4.21",
|
||||
"vue-multiselect": "3.0.0-beta.3",
|
||||
"vue-router": "4.3.0",
|
||||
"vue-virtual-scroller": "2.0.0-beta.8"
|
||||
"vue-typed-virtual-list": "^1.0.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^1.5.11",
|
||||
|
||||
@@ -100,13 +100,13 @@ input {
|
||||
|
||||
* {
|
||||
scrollbar-width: auto;
|
||||
scrollbar-color: var(--color-button-bg) var(--color-bg);
|
||||
scrollbar-color: var(--color-scrollbar) var(--color-bg);
|
||||
}
|
||||
|
||||
/* Chrome, Edge, and Safari */
|
||||
*::-webkit-scrollbar {
|
||||
width: var(--gap-md);
|
||||
border: 3px solid var(--color-bg);
|
||||
border: 3px solid var(--color-scrollbar);
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track {
|
||||
@@ -115,7 +115,7 @@ input {
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb {
|
||||
background-color: var(--color-button-bg);
|
||||
background-color: var(--color-scrollbar);
|
||||
border-radius: var(--radius-lg);
|
||||
border: 3px solid var(--color-bg);
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ const initFiles = async () => {
|
||||
disabled:
|
||||
folder === 'profile.json' ||
|
||||
folder.startsWith('modrinth_logs') ||
|
||||
folder.startsWith('.fabric') ||
|
||||
folder.includes('.DS_Store'),
|
||||
folder.startsWith('.fabric'),
|
||||
}))
|
||||
.filter((pathData) => !pathData.path.includes('.DS_Store'))
|
||||
.forEach((pathData) => {
|
||||
const parent = pathData.path.split(sep).slice(0, -1).join(sep)
|
||||
if (parent !== '') {
|
||||
|
||||
@@ -318,9 +318,7 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
:deep {
|
||||
.checkbox {
|
||||
border: none;
|
||||
}
|
||||
:deep(.checkbox) {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,8 +4,8 @@ import App from '@/App.vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import '@modrinth/assets/omorphia.scss'
|
||||
import '@/assets/stylesheets/global.scss'
|
||||
import 'floating-vue/dist/style.css'
|
||||
import FloatingVue from 'floating-vue'
|
||||
import 'floating-vue/dist/style.css'
|
||||
import { get_opening_command, initialize_state } from '@/helpers/state'
|
||||
import loadCssMixin from './mixins/macCssFix.js'
|
||||
import { get } from '@/helpers/settings'
|
||||
|
||||
@@ -488,6 +488,14 @@ const [categories, loaders, availableGameVersions] = await Promise.all([
|
||||
refreshSearch(),
|
||||
])
|
||||
|
||||
const filteredLoaders = computed(() => {
|
||||
return loaders.value.filter((loader) => {
|
||||
return projectType.value === 'mod' || projectType.value === 'modpack'
|
||||
? loader.supported_project_types[0] === 'mod'
|
||||
: loader.supported_project_types[0] === projectType.value
|
||||
})
|
||||
})
|
||||
|
||||
const selectableProjectTypes = computed(() => {
|
||||
const values = [
|
||||
{ label: 'Shaders', href: `/browse/shader` },
|
||||
@@ -518,14 +526,8 @@ const selectableProjectTypes = computed(() => {
|
||||
const showVersions = computed(
|
||||
() => instanceContext.value === null || ignoreInstanceGameVersions.value,
|
||||
)
|
||||
const showLoaders = computed(
|
||||
() =>
|
||||
(projectType.value !== 'datapack' &&
|
||||
projectType.value !== 'resourcepack' &&
|
||||
projectType.value !== 'shader' &&
|
||||
instanceContext.value === null) ||
|
||||
ignoreInstanceLoaders.value,
|
||||
)
|
||||
|
||||
const isModProject = computed(() => ['modpack', 'mod'].includes(projectType.value))
|
||||
|
||||
onUnmounted(() => unlistenOffline())
|
||||
</script>
|
||||
@@ -596,17 +598,9 @@ onUnmounted(() => unlistenOffline())
|
||||
>
|
||||
<ClearIcon /> Clear filters
|
||||
</Button>
|
||||
<div v-if="showLoaders" class="loaders">
|
||||
<div v-if="isModProject || projectType === 'shader'" class="loaders">
|
||||
<h2>Loaders</h2>
|
||||
<div
|
||||
v-for="loader in loaders.filter(
|
||||
(l) =>
|
||||
(projectType !== 'mod' && l.supported_project_types?.includes(projectType)) ||
|
||||
(projectType === 'mod' &&
|
||||
['fabric', 'forge', 'quilt', 'neoforge'].includes(l.name)),
|
||||
)"
|
||||
:key="loader"
|
||||
>
|
||||
<div v-for="loader in filteredLoaders" :key="loader">
|
||||
<SearchFilter
|
||||
:active-filters="orFacets"
|
||||
:icon="loader.icon"
|
||||
@@ -656,7 +650,7 @@ onUnmounted(() => unlistenOffline())
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="projectType !== 'datapack'" class="environment">
|
||||
<div v-if="isModProject" class="environment">
|
||||
<h2>Environments</h2>
|
||||
<SearchFilter
|
||||
:active-filters="selectedEnvironments"
|
||||
|
||||
@@ -551,14 +551,12 @@ async function refreshDir() {
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
:deep {
|
||||
.login-screen-modal {
|
||||
.modal-container .modal-body {
|
||||
width: auto;
|
||||
:deep(.login-screen-modal) {
|
||||
.modal-container .modal-body {
|
||||
width: auto;
|
||||
|
||||
.content {
|
||||
background: none;
|
||||
}
|
||||
.content {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,28 +59,28 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="log-text">
|
||||
<RecycleScroller
|
||||
v-slot="{ item }"
|
||||
<VirtualScroller
|
||||
ref="logContainer"
|
||||
class="scroller"
|
||||
:default-size="20"
|
||||
:items="displayProcessedLogs"
|
||||
direction="vertical"
|
||||
:item-size="20"
|
||||
key-field="id"
|
||||
>
|
||||
<div class="user no-wrap">
|
||||
<span :style="{ color: item.prefixColor, 'font-weight': item.weight }">{{
|
||||
item.prefix
|
||||
}}</span>
|
||||
<span :style="{ color: item.textColor }">{{ item.text }}</span>
|
||||
</div>
|
||||
</RecycleScroller>
|
||||
<template #item="{ ref }">
|
||||
<div class="user no-wrap">
|
||||
<span :style="{ color: ref.prefixColor, 'font-weight': ref.weight }">{{
|
||||
ref.prefix
|
||||
}}</span>
|
||||
<span :style="{ color: ref.textColor }">{{ ref.text }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</VirtualScroller>
|
||||
</div>
|
||||
<ShareModal
|
||||
ref="shareModal"
|
||||
header="Share Log"
|
||||
share-title="Instance Log"
|
||||
share-text="Check out this log from an instance on the Modrinth App"
|
||||
:open-in-new-tab="false"
|
||||
link
|
||||
/>
|
||||
</Card>
|
||||
@@ -104,13 +104,13 @@ import { useRoute } from 'vue-router'
|
||||
import { process_listener } from '@/helpers/events.js'
|
||||
import { handleError } from '@/store/notifications.js'
|
||||
import { ofetch } from 'ofetch'
|
||||
|
||||
import { RecycleScroller } from 'vue-virtual-scroller'
|
||||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
||||
import { createVirtualScroller } from 'vue-typed-virtual-list'
|
||||
|
||||
dayjs.extend(isToday)
|
||||
dayjs.extend(isYesterday)
|
||||
|
||||
const VirtualScroller = createVirtualScroller()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const props = defineProps({
|
||||
@@ -412,15 +412,20 @@ function handleUserScroll() {
|
||||
interval.value = setInterval(async () => {
|
||||
if (logs.value.length > 0) {
|
||||
logs.value[0] = await getLiveStdLog()
|
||||
const logContainerElement = logContainer.value.$el
|
||||
const scroll =
|
||||
logContainerElement.scrollHeight -
|
||||
logContainerElement.scrollTop -
|
||||
logContainerElement.clientHeight
|
||||
// const scroll = logContainer.value.$el.scrollHeight - logContainer.value.$el.scrollTop - logContainer.value.$el.clientHeight
|
||||
|
||||
const scroll = logContainer.value.getScroll()
|
||||
// Allow resetting of userScrolled if the user scrolls to the bottom
|
||||
if (selectedLogIndex.value === 0) {
|
||||
if (scroll.end >= logContainer.value.$el.scrollHeight - 10) userScrolled.value = false
|
||||
if (scroll <= 10) userScrolled.value = false
|
||||
if (!userScrolled.value) {
|
||||
await nextTick()
|
||||
isAutoScrolling.value = true
|
||||
logContainer.value.scrollToItem(displayProcessedLogs.value.length - 1)
|
||||
logContainer.value.scrollTo(displayProcessedLogs.value.length - 1)
|
||||
setTimeout(() => (isAutoScrolling.value = false), 50)
|
||||
}
|
||||
}
|
||||
@@ -489,10 +494,6 @@ onUnmounted(() => {
|
||||
white-space: nowrap; /* Keeps content on a single line */
|
||||
white-space: normal;
|
||||
color-scheme: dark;
|
||||
|
||||
.no-wrap {
|
||||
white-space: pre;
|
||||
}
|
||||
}
|
||||
|
||||
.filter-checkbox {
|
||||
|
||||
@@ -322,6 +322,7 @@
|
||||
ref="shareModal"
|
||||
share-title="Sharing modpack content"
|
||||
share-text="Check out the projects I'm using in my modpack!"
|
||||
:open-in-new-tab="false"
|
||||
/>
|
||||
<ExportModal v-if="projects.length > 0" ref="exportModal" :instance="instance" />
|
||||
<ModpackVersionModal
|
||||
@@ -1110,6 +1111,7 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.updating-indicator {
|
||||
height: 2.25rem !important;
|
||||
@@ -1121,10 +1123,6 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.v-popper--theme-tooltip .v-popper__inner {
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
.select-checkbox {
|
||||
button.checkbox {
|
||||
border: none;
|
||||
|
||||
@@ -82,7 +82,7 @@ pub async fn should_disable_mouseover() -> bool {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn show_in_folder(path: PathBuf) -> Result<()> {
|
||||
pub fn show_in_folder(mut path: PathBuf) -> Result<()> {
|
||||
{
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
@@ -101,19 +101,26 @@ pub fn show_in_folder(path: PathBuf) -> Result<()> {
|
||||
{
|
||||
use std::fs::metadata;
|
||||
|
||||
if path.to_string_lossy().to_string().contains(',') {
|
||||
// see https://gitlab.freedesktop.org/dbus/dbus/-/issues/76
|
||||
let new_path = match metadata(&path)?.is_dir() {
|
||||
true => path,
|
||||
false => {
|
||||
let mut path2 = path.clone();
|
||||
path2.pop();
|
||||
path2
|
||||
}
|
||||
};
|
||||
Command::new("xdg-open").arg(&new_path).spawn()?;
|
||||
} else {
|
||||
let path_string = path.to_string_lossy().to_string();
|
||||
|
||||
if metadata(&path)?.is_dir() {
|
||||
Command::new("xdg-open").arg(&path).spawn()?;
|
||||
} else if path_string.contains(',') {
|
||||
// see https://gitlab.freedesktop.org/dbus/dbus/-/issues/76
|
||||
path.pop();
|
||||
Command::new("xdg-open").arg(&path).spawn()?;
|
||||
} else {
|
||||
Command::new("dbus-send")
|
||||
.args([
|
||||
"--session",
|
||||
"--dest=org.freedesktop.FileManager1",
|
||||
"--type=method_call",
|
||||
"/org/freedesktop/FileManager1",
|
||||
"org.freedesktop.FileManager1.ShowItems",
|
||||
format!("array:string:file://{}", path_string).as_str(),
|
||||
"string:\"\"",
|
||||
])
|
||||
.spawn()?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user