Skip to content

Commit 4f818e3

Browse files
committed
feat: 文件操作也支持全部收起/展开; 常用配置默认改为展开
1 parent c1f2b0e commit 4f818e3

8 files changed

Lines changed: 19 additions & 16 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store-front-end",
3-
"version": "2.26.7",
3+
"version": "2.26.8",
44
"private": true,
55
"packageManager": "pnpm@11.0.9",
66
"scripts": {

src/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ export default {
571571
// },
572572
actions: {
573573
label: "Node Actions",
574+
fileLabel: "File Actions",
574575
addAction: {
575576
title: "Add action",
576577
cancel: "Cancel",

src/locales/ru.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ export default {
540540
},
541541
"actions": {
542542
"label": "Действия над узлами",
543+
"fileLabel": "Действия с файлами",
543544
"addAction": {
544545
"title": "Добавить действие",
545546
"cancel": "Отмена",

src/locales/zh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ export default {
559559
// },
560560
actions: {
561561
label: '节点操作',
562+
fileLabel: '文件操作',
562563
addAction: {
563564
title: '添加操作',
564565
cancel: '取消',

src/store/settings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const normalizeEditorCommonDisplayMode = (
155155
return appearanceSetting.isEditorCommon ? "expanded" : "hidden";
156156
}
157157

158-
return "collapsed";
158+
return "expanded";
159159
};
160160

161161
const normalizeManualSubscriptionsDisplayMode = (
@@ -216,7 +216,7 @@ export const useSettingsStore = defineStore("settingsStore", {
216216
isShowIcon: true,
217217
isSimpleShowRemark: false,
218218
isEditorCommon: true,
219-
editorCommonDisplayMode: "collapsed",
219+
editorCommonDisplayMode: "expanded",
220220
manualSubscriptionsDisplayMode: "collapsed",
221221
editorGroupingMode: getCachedEditorGroupingMode() ?? "edit-only",
222222
isSimpleReicon: false,
@@ -413,7 +413,7 @@ export const useSettingsStore = defineStore("settingsStore", {
413413
const cachedHideShareTab = getCachedAppearanceBoolean(TAB_BAR3_CACHE_STORAGE_KEY, "istabBar3");
414414
const editorCommonDisplayMode = hasLocalEditorCommonSetting
415415
? (isEditorCommon ? "expanded" : "hidden")
416-
: "collapsed";
416+
: "expanded";
417417
const editorGroupingMode = this.appearanceSetting.editorGroupingMode || "edit-only";
418418
const hasLocalLegacyAppearanceSetting = hasLocalAppearanceSetting();
419419
const shouldSyncEditorGroupingMode = this.hasCachedEditorGroupingMode

src/views/FileEditor.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@
450450
class="editor-tab-content editor-actions-content"
451451
:class="{
452452
'editor-tab-fixed-offset': editorTabsEnabled,
453-
'file-actions-tab-offset': editorTabsEnabled,
454453
}"
455454
>
456455
<ActionBlock
@@ -1421,10 +1420,6 @@ const handleEditGlobalClick = () => {
14211420
}
14221421
}
14231422
1424-
.file-actions-tab-offset {
1425-
padding-top: 45px;
1426-
}
1427-
14281423
.bottom-btn-wrapper {
14291424
position: fixed;
14301425
display: flex;

src/views/editor/ActionBlock.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="form-block-wrapper">
3-
<div v-if="sourceType !== 'file'" class="sticky-title-wrapper actions-title-wrapper">
4-
<p>{{ $t(`editorPage.subConfig.actions.label`) }}</p>
3+
<div class="sticky-title-wrapper actions-title-wrapper">
4+
<p>{{ $t(actionsTitleKey) }}</p>
55
<font-awesome-icon
66
v-if="isCollapsed"
77
@click.stop="setCollapsed(false)"
@@ -14,7 +14,7 @@
1414
class="toggle fa-toggle"
1515
icon="fa-solid fa-toggle-off"
1616
/>
17-
<button @click="popActionsHelp">
17+
<button v-if="sourceType !== 'file'" @click="popActionsHelp">
1818
<font-awesome-icon icon="fa-solid fa-circle-question" />
1919
{{ $t(`editorPage.subConfig.basic.nodeActionsHelp`) }}
2020
</button>
@@ -287,6 +287,11 @@ const FILE_ACTION_TYPES = [
287287
const isMihomoConfigFile = computed(
288288
() => sourceType === 'file' && isMihomoConfigFileType(form?.type),
289289
);
290+
const actionsTitleKey = computed(() =>
291+
sourceType === 'file'
292+
? 'editorPage.subConfig.actions.fileLabel'
293+
: 'editorPage.subConfig.actions.label',
294+
);
290295
291296
const allItems = computed(() => Object.keys(i18nFile.editorPage.subConfig.nodeActions).map(type => {
292297
return {

src/views/settings/moreSetting.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
// const isEditing = ref(false);
238238
const isInit = ref(false);
239239
const subProgressStyleValue = ref(['hidden']);
240-
const editorCommonDisplayModeValue = ref<EditorCommonDisplayMode[]>(['collapsed']);
240+
const editorCommonDisplayModeValue = ref<EditorCommonDisplayMode[]>(['expanded']);
241241
const manualSubscriptionsDisplayModeValue = ref<EditorSectionFoldMode[]>(['collapsed']);
242242
const editorGroupingModeValue = ref<EditorGroupingMode[]>(['edit-only']);
243243
@@ -275,10 +275,10 @@
275275
changeAppearanceSetting({ appearanceSetting: data });
276276
};
277277
const editorCommonDisplayModeName = computed(() => {
278-
return t(`moreSettingPage.editorDisplayMode.${editorCommonDisplayModeValue.value[0] || 'collapsed'}`);
278+
return t(`moreSettingPage.editorDisplayMode.${editorCommonDisplayModeValue.value[0] || 'expanded'}`);
279279
});
280280
const editorCommonDisplayModeConfirm = ({ selectedValue }) => {
281-
const editorCommonDisplayMode = selectedValue[0] || 'collapsed';
281+
const editorCommonDisplayMode = selectedValue[0] || 'expanded';
282282
const data = {
283283
...appearanceSetting.value,
284284
editorCommonDisplayMode,
@@ -627,7 +627,7 @@
627627
awtabBar3.value = appearanceSetting.value.istabBar3 ?? false;
628628
hidePublicLinkActionButton.value = appearanceSetting.value.hidePublicLinkActionButton ?? false;
629629
subProgressStyleValue.value = [appearanceSetting.value.subProgressStyle];
630-
editorCommonDisplayModeValue.value = [appearanceSetting.value.editorCommonDisplayMode || 'collapsed'];
630+
editorCommonDisplayModeValue.value = [appearanceSetting.value.editorCommonDisplayMode || 'expanded'];
631631
manualSubscriptionsDisplayModeValue.value = [appearanceSetting.value.manualSubscriptionsDisplayMode || 'collapsed'];
632632
editorGroupingModeValue.value = [appearanceSetting.value.editorGroupingMode || 'edit-only'];
633633
// SimpleSwitch.value = isSimpleMode.value;

0 commit comments

Comments
 (0)