From 3eb1666e625a2c5c2c0a3cf40a64e8f7eac5343b Mon Sep 17 00:00:00 2001 From: notfire Date: Mon, 4 Aug 2025 22:15:32 -0400 Subject: [PATCH 1/6] further unfuck search result styling --- src/components/search/search.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/search/search.vue b/src/components/search/search.vue index b1ebbe0e..c0fff580 100644 --- a/src/components/search/search.vue +++ b/src/components/search/search.vue @@ -200,6 +200,10 @@ } } +.search-result .status-heading { + padding-bottom: .5em; +} + .loading-icon { padding: 1em; } From 949c9332168c1e4659c39e019cb9f43118bb6c77 Mon Sep 17 00:00:00 2001 From: notfire Date: Fri, 8 Aug 2025 14:05:25 -0400 Subject: [PATCH 2/6] even further unfuck search result styling --- src/components/status/status.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/status/status.scss b/src/components/status/status.scss index 8b92f42a..608d0a15 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -42,6 +42,10 @@ padding: var(--status-margin, $status-margin); } + .popover .status-container { + padding: .5em; + } + &.classic .status-heading { margin-bottom: 0.5em; } From 01f19e7fcd8c0833cdec90f5b5047563f7fd5434 Mon Sep 17 00:00:00 2001 From: notfire Date: Sat, 9 Aug 2025 18:03:09 -0400 Subject: [PATCH 3/6] add option to not scroll to the top when showing unread posts --- README.md | 3 ++- .../settings_modal/tabs/general_tab.vue | 8 ++++++++ src/components/timeline/timeline.js | 15 ++++++++++++++- src/i18n/en.json | 1 + src/modules/config.js | 1 + src/modules/instance.js | 1 + 6 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a5b7be9..3ddc081d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## list of changes in this fork: - additional confirmations for: - post visibility (choose direct, private, unlisted, public, local) - - posting with an attachment marked sensitive but no cw + - posting with an attachment marked sensitive but no cw (todo: fix the conf showing up with no attachments) - biting: - users - notes @@ -26,6 +26,7 @@ - for unreads: - option to disable favicon badge changing on unreads - option to disable title showing unreads + - option to not scroll to the top when showing unreads - update the list of emojis: - switched weird unicode ones to proper emojis - emojis are sourced from discord's list of emojis diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index c0bf3489..ed3b3c3d 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -201,6 +201,14 @@ +
  • + + {{ $t('settings.scroll_to_top_on_new_post_click') }} + +
  • 0) { + // i REALLY don't like this code. it results in flickering best case scenario. this is kind of just a limit + // of how akko-fe is written, and being able to do this without flicker would require an async rewrite most + // likely. this is probably the best way this can be reasonably done without a full rewrite. + setTimeout(function() { + let after = document.getElementsByClassName("Timeline")[0].scrollHeight + let diff = bef - after + if (diff < 0) diff = diff * -1 + window.scrollTo({ top: (window.scrollY + diff) }) + }, 0); } }, fetchOlderStatuses: throttle( function () { diff --git a/src/i18n/en.json b/src/i18n/en.json index d024dffd..aa69983a 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -753,6 +753,7 @@ "saving_err": "Error saving settings", "saving_ok": "Settings saved", "scope_copy": "Copy scope when replying (DMs are always copied)", + "scroll_to_top_on_new_post_click": "Scroll to the top when showing new posts (disabling this may result in buggy behavior)", "search_pagination_limit": "Results to show per search page", "search_user_to_block": "Search whom you want to block", "search_user_to_mute": "Search whom you want to mute", diff --git a/src/modules/config.js b/src/modules/config.js index efed69b4..777f052b 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -128,6 +128,7 @@ export const defaultState = { recurseSearch: false, recurseSearchLimit: 100, dedupeBoosts: true, + scrollToTopOnNewPostClick: true, showFaviconBadge: true, autoRefreshOnRequired: true, showUnreadInTitle: true, diff --git a/src/modules/instance.js b/src/modules/instance.js index 75dd6aa7..6477d9b1 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -84,6 +84,7 @@ const defaultState = { recurseSearch: false, recurseSearchLimit: 100, dedupeBoosts: true, + scrollToTopOnNewPostClick: true, showFaviconBadge: true, autoRefreshOnRequired: true, showUnreadInTitle: true, From 872c11051036f649a9b004d42ca235a9405a7cb4 Mon Sep 17 00:00:00 2001 From: notfire Date: Sat, 9 Aug 2025 18:05:19 -0400 Subject: [PATCH 4/6] remove unused import --- src/components/timeline/timeline.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 5b9074ee..1c2ae5b6 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -7,7 +7,6 @@ import TimelineQuickSettings from './timeline_quick_settings.vue' import { debounce, throttle, keyBy } from 'lodash' import { library } from '@fortawesome/fontawesome-svg-core' import { faCircleNotch, faCog, faPlus, faMinus } from '@fortawesome/free-solid-svg-icons' -import {calcLineCount} from "diff/lib/patch/merge"; library.add( faCircleNotch, From 526f7464d175f64bca72dcffed280785520693ff Mon Sep 17 00:00:00 2001 From: notfire Date: Sat, 9 Aug 2025 18:28:36 -0400 Subject: [PATCH 5/6] add option to prevent page from getting pushed when making a new post with streaming api enabled --- README.md | 1 + src/components/post_status_form/post_status_form.js | 10 ++++++++++ src/components/settings_modal/tabs/general_tab.vue | 9 +++++++++ src/i18n/en.json | 1 + src/modules/config.js | 1 + src/modules/instance.js | 1 + 6 files changed, 23 insertions(+) diff --git a/README.md b/README.md index 3ddc081d..373b3b15 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ - script to get new emojis is included for future unicode versions - add toggle for showing post edit notifications - add support for accepted follow request notifications +- add option to prevent page from getting pushed when making a new post with streaming api enabled (similar to 3rd "for unreads" option) - add a script to download ruffle for flash support (requires python3 and requests library) - download by entering `tools/` and running `python3 download_ruffle.py` diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index d40d2290..cb0536d2 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -436,6 +436,8 @@ const PostStatusForm = { const postHandler = this.postHandler ? this.postHandler : statusPoster.postStatus + let bef = document.getElementsByClassName("Timeline")[0].scrollHeight + postHandler(postingOptions).then((data) => { if (!data.error) { this.clearStatus() @@ -444,6 +446,14 @@ const PostStatusForm = { this.error = data.error } this.posting = false + + // same as timeline.js + if (this.$store.getters.mergedConfig.fixupScrollOnPostWStreaming && window.scrollY > 0) { + let after = document.getElementsByClassName("Timeline")[0].scrollHeight + let diff = bef - after + if (diff < 0) diff = diff * -1 + window.scrollTo({ top: (window.scrollY + diff) }) + } }) }, previewStatus () { diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index ed3b3c3d..8b7fa9e4 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -229,6 +229,15 @@ {{ $t('settings.deletePostsStreaming') }}
  • +
  • + + {{ $t('settings.fixup_scroll_on_post_with_streaming') }} + +
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index aa69983a..6cf74b63 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -577,6 +577,7 @@ }, "filtering": "Filtering", "filtering_explanation": "All posts containing these words will be muted, one per line", + "fixup_scroll_on_post_with_streaming": "Prevent the page from getting pushed down by new posts you make", "follow_export": "Follow export", "follow_export_button": "Export your follows to a csv file", "follow_import": "Follow import", diff --git a/src/modules/config.js b/src/modules/config.js index 777f052b..8d57c3f2 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -129,6 +129,7 @@ export const defaultState = { recurseSearchLimit: 100, dedupeBoosts: true, scrollToTopOnNewPostClick: true, + fixupScrollOnPostWStreaming: false, showFaviconBadge: true, autoRefreshOnRequired: true, showUnreadInTitle: true, diff --git a/src/modules/instance.js b/src/modules/instance.js index 6477d9b1..13efbfb4 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -85,6 +85,7 @@ const defaultState = { recurseSearchLimit: 100, dedupeBoosts: true, scrollToTopOnNewPostClick: true, + fixupScrollOnPostWStreaming: false, showFaviconBadge: true, autoRefreshOnRequired: true, showUnreadInTitle: true, From 0adbff7856cbf41a5cfb4410cbb8cecebe754f77 Mon Sep 17 00:00:00 2001 From: notfire Date: Sun, 10 Aug 2025 11:29:42 -0400 Subject: [PATCH 6/6] fix posts not working from pages other than the timeline --- src/components/post_status_form/post_status_form.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index cb0536d2..25eac1d6 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -436,7 +436,9 @@ const PostStatusForm = { const postHandler = this.postHandler ? this.postHandler : statusPoster.postStatus - let bef = document.getElementsByClassName("Timeline")[0].scrollHeight + let bef = null + if (document.getElementsByClassName("Timeline") > 0) + bef = document.getElementsByClassName("Timeline")[0].scrollHeight postHandler(postingOptions).then((data) => { if (!data.error) { @@ -448,7 +450,7 @@ const PostStatusForm = { this.posting = false // same as timeline.js - if (this.$store.getters.mergedConfig.fixupScrollOnPostWStreaming && window.scrollY > 0) { + if (this.$store.getters.mergedConfig.fixupScrollOnPostWStreaming && window.scrollY > 0 && (document.getElementsByClassName("Timeline") > 0)) { let after = document.getElementsByClassName("Timeline")[0].scrollHeight let diff = bef - after if (diff < 0) diff = diff * -1