From 98cb9abac773e8fbce94eafea1025919b6f26360 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 22 Feb 2021 16:24:04 +0200 Subject: [PATCH 1/7] Add timeline menu toggle to nav panel --- CHANGELOG.md | 2 + src/components/nav_panel/nav_panel.js | 36 ++++++---- src/components/nav_panel/nav_panel.vue | 70 +++++++++++++++---- src/components/timeline_menu/timeline_menu.js | 31 ++------ .../timeline_menu/timeline_menu.vue | 48 +------------ .../timeline_menu/timeline_menu_content.js | 29 ++++++++ .../timeline_menu/timeline_menu_content.vue | 66 +++++++++++++++++ src/i18n/en.json | 1 + 8 files changed, 183 insertions(+), 100 deletions(-) create mode 100644 src/components/timeline_menu/timeline_menu_content.js create mode 100644 src/components/timeline_menu/timeline_menu_content.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index cf4be7da..15e63d00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Display 'people voted' instead of 'votes' for multi-choice polls +- Changed the "Timelines" link in side panel to toggle show all timeline options inside the panel +- Renamed "Timeline" to "Home Timeline" to be more clear ## [2.2.3] - 2021-01-18 ### Added diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js index 81d49cc2..37bcb409 100644 --- a/src/components/nav_panel/nav_panel.js +++ b/src/components/nav_panel/nav_panel.js @@ -1,4 +1,4 @@ -import { timelineNames } from '../timeline_menu/timeline_menu.js' +import TimelineMenuContent from '../timeline_menu/timeline_menu_content.vue' import { mapState, mapGetters } from 'vuex' import { library } from '@fortawesome/fontawesome-svg-core' @@ -7,10 +7,12 @@ import { faGlobe, faBookmark, faEnvelope, - faHome, + faChevronDown, + faChevronUp, faComments, faBell, - faInfoCircle + faInfoCircle, + faStream } from '@fortawesome/free-solid-svg-icons' library.add( @@ -18,10 +20,12 @@ library.add( faGlobe, faBookmark, faEnvelope, - faHome, + faChevronDown, + faChevronUp, faComments, faBell, - faInfoCircle + faInfoCircle, + faStream ) const NavPanel = { @@ -30,16 +34,20 @@ const NavPanel = { this.$store.dispatch('startFetchingFollowRequests') } }, + components: { + TimelineMenuContent + }, + data () { + return { + showTimelines: false + } + }, + methods: { + toggleTimelines () { + this.showTimelines = !this.showTimelines + } + }, computed: { - onTimelineRoute () { - return !!timelineNames()[this.$route.name] - }, - timelinesRoute () { - if (this.$store.state.interface.lastTimeline) { - return this.$store.state.interface.lastTimeline - } - return this.currentUser ? 'friends' : 'public-timeline' - }, ...mapState({ currentUser: state => state.users.currentUser, followRequestCount: state => state.api.followRequests.length, diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index 0c83d0fe..7ae7b1d6 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -3,19 +3,33 @@
state.users.currentUser, + privateMode: state => state.instance.private, + federating: state => state.instance.federating + }) + } +} + +export default TimelineMenuContent diff --git a/src/components/timeline_menu/timeline_menu_content.vue b/src/components/timeline_menu/timeline_menu_content.vue new file mode 100644 index 00000000..bed1b679 --- /dev/null +++ b/src/components/timeline_menu/timeline_menu_content.vue @@ -0,0 +1,66 @@ + + + diff --git a/src/i18n/en.json b/src/i18n/en.json index 4cc2af0e..45280eff 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -124,6 +124,7 @@ "dms": "Direct Messages", "public_tl": "Public Timeline", "timeline": "Timeline", + "home_timeline": "Home Timeline", "twkn": "Known Network", "bookmarks": "Bookmarks", "user_search": "User Search", From 92a9ce67c595bf54a95cca917ba07772bec0f041 Mon Sep 17 00:00:00 2001 From: Shpuld Shpludson Date: Sat, 27 Feb 2021 18:23:11 +0000 Subject: [PATCH 2/7] Update CHANGELOG.md --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a599ddb..a294c106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Added reason field for registration when approval is required ->>>>>>> develop ## [2.2.3] - 2021-01-18 ### Added From d1ab424ebcd0a41fca9b848de02d03a2015ed9c7 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 2 Mar 2021 09:53:17 +0200 Subject: [PATCH 3/7] update changelog with 2.3.0 --- CHANGELOG.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d2b48b9..eb6a4599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added +- Added a quick settings to timeline header for easier access +- Added option to mark posts as sensitive by default + +## [2.3.0] - 2021-03-01 ### Fixed - Button to remove uploaded media in post status form is now properly placed and sized. - Fixed shoutbox not working in mobile layout @@ -17,11 +22,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Display 'people voted' instead of 'votes' for multi-choice polls - Optimized chat to not get horrible performance after keeping the same chat open for a long time - When opening emoji picker or react picker, it automatically focuses the search field +- Language picker now uses native language names ### Added - Added reason field for registration when approval is required -- Added a quick settings to timeline header for easier access -- Added option to mark posts as sensitive by default +- Group staff members by role in the About page ## [2.2.3] - 2021-01-18 ### Added @@ -33,7 +38,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Don't filter own posts when they hit your wordfilter -- Language picker now uses native language names ## [2.2.2] - 2020-12-22 @@ -43,7 +47,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Added some missing unicode emoji - Added the upload limit to the Features panel in the About page - Support for solid color wallpaper, instance doesn't have to define a wallpaper anymore -- Group staff members by role in the About page ### Fixed - Fixed the occasional bug where screen would scroll 1px when typing into a reply form From 0673511fc246d67356dd656ad81ba401e3179108 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 3 Mar 2021 16:46:53 +0200 Subject: [PATCH 4/7] fix shoutbox header, use custom scroll-to-bottom system, remove vue-chat-scroll, temporarily add chat test hack --- package.json | 1 - src/App.vue | 2 +- src/components/chat_panel/chat_panel.js | 12 ++++++++++++ src/components/chat_panel/chat_panel.vue | 15 ++++++++++----- src/main.js | 2 -- src/modules/chat.js | 19 +++++++++++++++++++ yarn.lock | 4 ---- 7 files changed, 42 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 372155df..8dbf2503 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "punycode.js": "^2.1.0", "v-click-outside": "^2.1.1", "vue": "^2.6.11", - "vue-chat-scroll": "^1.2.1", "vue-i18n": "^7.3.2", "vue-router": "^3.0.1", "vue-template-compiler": "^2.6.11", diff --git a/src/App.vue b/src/App.vue index 1a166778..e09ce4c8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -50,7 +50,7 @@
diff --git a/src/components/chat_panel/chat_panel.js b/src/components/chat_panel/chat_panel.js index c3887098..556694ae 100644 --- a/src/components/chat_panel/chat_panel.js +++ b/src/components/chat_panel/chat_panel.js @@ -35,6 +35,18 @@ const chatPanel = { userProfileLink (user) { return generateProfileLink(user.id, user.username, this.$store.state.instance.restrictedNicknames) } + }, + watch: { + messages (newVal) { + const scrollEl = this.$el.querySelector('.chat-window') + if (!scrollEl) return + if (scrollEl.scrollTop + scrollEl.offsetHeight + 20 > scrollEl.scrollHeight) { + this.$nextTick(() => { + if (!scrollEl) return + scrollEl.scrollTop = scrollEl.scrollHeight - scrollEl.offsetHeight + }) + } + } } } diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue index 7993c94d..8a829115 100644 --- a/src/components/chat_panel/chat_panel.vue +++ b/src/components/chat_panel/chat_panel.vue @@ -10,17 +10,15 @@ @click.stop.prevent="togglePanel" >
- {{ $t('shoutbox.title') }} + {{ $t('shoutbox.title') }}
-
+
{ + id += 1 + return { + text: 'test' + id, + author: { + username: 'test', + avatar: '', + id + } + } + } + + const loop = () => { + store.commit('addMessage', createmsg()) + setTimeout(loop, 3000) + } + loop() + channel.on('new_msg', (msg) => { store.commit('addMessage', msg) }) diff --git a/yarn.lock b/yarn.lock index 6d0095db..80c09312 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8923,10 +8923,6 @@ void-elements@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" -vue-chat-scroll@^1.2.1: - version "1.3.5" - resolved "https://registry.yarnpkg.com/vue-chat-scroll/-/vue-chat-scroll-1.3.5.tgz#a5ee5bae5058f614818a96eac5ee3be4394a2f68" - vue-eslint-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-5.0.0.tgz#00f4e4da94ec974b821a26ff0ed0f7a78402b8a1" From becacf064303f0fceca8def3f1c49248b9d3e5f8 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 3 Mar 2021 16:47:59 +0200 Subject: [PATCH 5/7] remove shoutbox test hacks --- src/App.vue | 2 +- src/modules/chat.js | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/App.vue b/src/App.vue index e09ce4c8..1a166778 100644 --- a/src/App.vue +++ b/src/App.vue @@ -50,7 +50,7 @@
diff --git a/src/modules/chat.js b/src/modules/chat.js index 264ba00b..ffeb272b 100644 --- a/src/modules/chat.js +++ b/src/modules/chat.js @@ -18,24 +18,6 @@ const chat = { actions: { initializeChat (store, socket) { const channel = socket.channel('chat:public') - let id = 0 - const createmsg = () => { - id += 1 - return { - text: 'test' + id, - author: { - username: 'test', - avatar: '', - id - } - } - } - - const loop = () => { - store.commit('addMessage', createmsg()) - setTimeout(loop, 3000) - } - loop() channel.on('new_msg', (msg) => { store.commit('addMessage', msg) From b4f5df9ce502efbf35eccf5c62066200b04428f8 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 4 Mar 2021 22:24:17 +0300 Subject: [PATCH 6/7] Make it possible to localize user highlight options --- src/components/user_card/user_card.vue | 8 ++++---- src/i18n/en.json | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index 60776ebb..c59faaa6 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -141,10 +141,10 @@ v-model="userHighlightType" class="userHighlightSel" > - - - - + + + + Date: Thu, 4 Mar 2021 19:46:03 +0000 Subject: [PATCH 7/7] Apply 1 suggestion(s) to 1 file(s) --- src/components/user_card/user_card.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index c59faaa6..4b7ee7d5 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -141,10 +141,10 @@ v-model="userHighlightType" class="userHighlightSel" > - - - - + + + +