From c9d43714e9b66acd9a190b5cf21d866b4595c069 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Sun, 22 Jan 2023 22:07:47 +0900
Subject: [PATCH] Re-implement status detail
---
src/renderer/components/TimelineSpace.vue | 17 +--
.../components/TimelineSpace/Detail.vue | 89 ++++++++++++
.../TimelineSpace/Detail/Status.vue | 131 ++++++++++++++++++
src/renderer/components/organisms/Toot.vue | 4 +-
4 files changed, 230 insertions(+), 11 deletions(-)
create mode 100644 src/renderer/components/TimelineSpace/Detail.vue
create mode 100644 src/renderer/components/TimelineSpace/Detail/Status.vue
diff --git a/src/renderer/components/TimelineSpace.vue b/src/renderer/components/TimelineSpace.vue
index 1de1c10e..2883806c 100644
--- a/src/renderer/components/TimelineSpace.vue
+++ b/src/renderer/components/TimelineSpace.vue
@@ -14,7 +14,9 @@
- detail
+
+
+
@@ -29,7 +31,7 @@ import HeaderMenu from './TimelineSpace/HeaderMenu.vue'
import Contents from './TimelineSpace/Contents.vue'
import Compose from './TimelineSpace/Compose.vue'
import Modals from './TimelineSpace/Modals.vue'
-import SideBar from './TimelineSpace/Contents/SideBar.vue'
+import Detail from './TimelineSpace/Detail.vue'
import Mousetrap from 'mousetrap'
import ReceiveDrop from './TimelineSpace/ReceiveDrop.vue'
import { AccountLoadError } from '@/errors/load'
@@ -45,7 +47,7 @@ import { ACTION_TYPES as NEW_TOOT_ACTION } from '@/store/TimelineSpace/Modals/Ne
export default defineComponent({
name: 'timeline-space',
- components: { SideMenu, HeaderMenu, Modals, Contents, ReceiveDrop, Compose, SideBar },
+ components: { SideMenu, HeaderMenu, Modals, Contents, ReceiveDrop, Compose, Detail },
setup() {
const space = 'TimelineSpace'
const store = useStore()
@@ -57,9 +59,7 @@ export default defineComponent({
const contentsRef = ref(null)
const loading = computed(() => store.state.TimelineSpace.loading)
- const collapse = computed(() => store.state.TimelineSpace.SideMenu.collapse)
- // const modalOpened = computed(() => store.getters[`TimelineSpace/Modals/modalOpened`])
- // const shortcutEnabled = computed(() => !modalOpened.value)
+ const detail = computed(() => route.query.detail?.toString() === 'true')
onMounted(async () => {
store.dispatch(`TimelineSpace/Contents/SideBar/${SIDEBAR_ACTION.CLOSE}`)
@@ -167,10 +167,10 @@ export default defineComponent({
return {
loading,
- collapse,
droppableVisible,
composeResized,
- contentsRef
+ contentsRef,
+ detail
}
}
})
@@ -183,6 +183,7 @@ export default defineComponent({
.header {
padding: 0;
+ height: auto;
border-bottom: 1px solid var(--theme-border-color);
}
diff --git a/src/renderer/components/TimelineSpace/Detail.vue b/src/renderer/components/TimelineSpace/Detail.vue
new file mode 100644
index 00000000..31a94481
--- /dev/null
+++ b/src/renderer/components/TimelineSpace/Detail.vue
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/renderer/components/TimelineSpace/Detail/Status.vue b/src/renderer/components/TimelineSpace/Detail/Status.vue
new file mode 100644
index 00000000..87586da4
--- /dev/null
+++ b/src/renderer/components/TimelineSpace/Detail/Status.vue
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
diff --git a/src/renderer/components/organisms/Toot.vue b/src/renderer/components/organisms/Toot.vue
index e14c269d..cb3a038e 100644
--- a/src/renderer/components/organisms/Toot.vue
+++ b/src/renderer/components/organisms/Toot.vue
@@ -483,9 +483,7 @@ export default defineComponent({
})
}
const openDetail = (message: Entity.Status) => {
- store.dispatch(`TimelineSpace/Contents/SideBar/${SIDEBAR_ACTION.OPEN_TOOT_COMPONENT}`)
- store.dispatch(`TimelineSpace/Contents/SideBar/TootDetail/${DETAIL_ACTION.CHANGE_TOOT}`, message)
- store.commit(`TimelineSpace/Contents/SideBar/${SIDEBAR_MUTATION.CHANGE_OPEN_SIDEBAR}`, true)
+ router.push({ query: { detail: 'true', status_id: message.id } })
}
const openBrowser = (message: Entity.Status) => {
;(window as any).shell.openExternal(message.url)