From 6be10b2e097b200bb05a4fa54673fe837e003afb Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 29 Jan 2023 17:42:10 +0900 Subject: [PATCH] Re-implement user timeline in profile --- .eslintrc.js | 3 +- src/renderer/components/TimelineSpace.vue | 2 +- .../TimelineSpace/Contents/Home.vue | 6 -- .../TimelineSpace/Detail/Profile.vue | 36 +++++-- .../TimelineSpace/Detail/Profile/Posts.vue | 99 +++++++++++++++++++ src/renderer/components/organisms/Toot.vue | 10 +- 6 files changed, 134 insertions(+), 22 deletions(-) create mode 100644 src/renderer/components/TimelineSpace/Detail/Profile/Posts.vue diff --git a/.eslintrc.js b/.eslintrc.js index 8f559151..7f910044 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -36,6 +36,7 @@ module.exports = { 'space-before-function-paren': 'off', 'vue/multi-word-component-names': 'off', 'vue/attributes-order': 'off', - 'vue/attribute-hyphenation': 'off' + 'vue/attribute-hyphenation': 'off', + 'vue/no-v-html': 'off' } } diff --git a/src/renderer/components/TimelineSpace.vue b/src/renderer/components/TimelineSpace.vue index 2883806c..ab460542 100644 --- a/src/renderer/components/TimelineSpace.vue +++ b/src/renderer/components/TimelineSpace.vue @@ -198,7 +198,7 @@ export default defineComponent({ } .detail { - width: 340px; + width: 380px; height: 100%; border-left: 1px solid var(--theme-border-color); } diff --git a/src/renderer/components/TimelineSpace/Contents/Home.vue b/src/renderer/components/TimelineSpace/Contents/Home.vue index 5f9a0a8d..1e692163 100644 --- a/src/renderer/components/TimelineSpace/Contents/Home.vue +++ b/src/renderer/components/TimelineSpace/Contents/Home.vue @@ -19,7 +19,6 @@ :server="account.server" v-on:update="updateToot" v-on:delete="deleteToot" - @focusRight="focusSidebar" @selectToot="focusToot(item)" > @@ -41,7 +40,6 @@ import { useRoute } from 'vue-router' import { useStore } from '@/store' import Toot from '@/components/organisms/Toot.vue' import StatusLoading from '@/components/organisms/StatusLoading.vue' -import { EventEmitter } from '@/components/event' import { ACTION_TYPES, MUTATION_TYPES } from '@/store/TimelineSpace/Contents/Home' import { MUTATION_TYPES as SIDE_MENU_MUTATION } from '@/store/TimelineSpace/SideMenu' import { LocalAccount } from '~/src/types/localAccount' @@ -215,9 +213,6 @@ export default defineComponent({ const focusToot = (message: Entity.Status) => { focusedId.value = message.uri + message.id } - const focusSidebar = () => { - EventEmitter.emit('focus-sidebar') - } return { filteredTimeline, @@ -231,7 +226,6 @@ export default defineComponent({ deleteToot, focusNext, focusPrev, - focusSidebar, focusToot, openSideBar, heading, diff --git a/src/renderer/components/TimelineSpace/Detail/Profile.vue b/src/renderer/components/TimelineSpace/Detail/Profile.vue index 6ce5bf48..f411119c 100644 --- a/src/renderer/components/TimelineSpace/Detail/Profile.vue +++ b/src/renderer/components/TimelineSpace/Detail/Profile.vue @@ -1,6 +1,6 @@ + + diff --git a/src/renderer/components/organisms/Toot.vue b/src/renderer/components/organisms/Toot.vue index 14813647..75fb0e1a 100644 --- a/src/renderer/components/organisms/Toot.vue +++ b/src/renderer/components/organisms/Toot.vue @@ -305,7 +305,7 @@ export default defineComponent({ required: true } }, - emits: ['selectToot', 'focusRight', 'focusLeft', 'update', 'delete', 'sizeChanged'], + emits: ['selectToot', 'update', 'delete', 'sizeChanged'], setup(props, ctx) { const store = useStore() const route = useRoute() @@ -313,7 +313,7 @@ export default defineComponent({ const i18n = useI18next() const win = (window as any) as MyWindow const { focused, overlaid, message, filters, account, server } = toRefs(props) - const { l, h, r, b, f, o, p, i, x } = useMagicKeys() + const { r, b, f, o, p, i, x } = useMagicKeys() const statusRef = ref(null) const showContent = ref(store.state.App.ignoreCW) @@ -397,12 +397,6 @@ export default defineComponent({ client.value = generator(server.value.sns, server.value.baseURL, account.value.accessToken, userAgent.value) }) - whenever(logicAnd(l, shortcutEnabled), () => { - ctx.emit('focusRight') - }) - whenever(logicAnd(h, shortcutEnabled), () => { - ctx.emit('focusLeft') - }) whenever(logicAnd(r, shortcutEnabled), () => { openReply() })