diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..c5b9ea10 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/build/webpack.prod.conf.js export-subst diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fb72931..444a863c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,37 @@ 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/). +## 2.6.1 +### Fixed +- fix admin dashboard not having any feedback on frontend installation +- Fix frontend admin tab crashing when no primary frontend is set +- Add aria attributes to react and extra buttons + +## 2.6.0 +### Added +- add the initial i18n translation file for Taiwanese (Hokkien), and modify some related files. +- Implemented a very basic instance administration screen +- Implement quoting + +### Fixed +- Keep aspect ratio of custom emoji reaction in notification +- Fix openSettingsModalTab so that it correctly opens Settings modal instead of Admin modal +- Add alt text to emoji picker buttons +- Use export-subst gitattribute to allow tarball builds +- fix reports now showing reason/content +- Fix HTML attribute parsing, discard attributes not strating with a letter +- Make MentionsLine aware of line breaking by non-br elements +- Fix a bug where mentioning a user twice will not fill the mention into the textarea +- Fix parsing non-ascii tags +- Fix OAuth2 token lingering after revocation +- fix regex issue in HTML parser/renderer +- don't display quoted status twice +- fix typo in code that prevented cards from showing at all +- Fix react button not working if reaction accounts are not loaded +- Fix react button misalignment on safari ios +- Fix pinned statuses gone when reloading user timeline +- Fix scrolling emoji selector in modal in safari ios + ## 2.5.1 ### Fixed - Checkboxes in settings can now work with screenreaders diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 7de93721..7a108f68 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -11,9 +11,16 @@ var env = process.env.NODE_ENV === 'testing' ? require('../config/test.env') : config.build.env -let commitHash = require('child_process') - .execSync('git rev-parse --short HEAD') - .toString(); +let commitHash = (() => { + const subst = "$Format:%h$"; + if(!subst.match(/Format:/)) { + return subst; + } else { + return require('child_process') + .execSync('git rev-parse --short HEAD') + .toString(); + } +})(); var webpackConfig = merge(baseWebpackConfig, { mode: 'production', diff --git a/changelog.d/add-apng.add b/changelog.d/add-apng.add new file mode 100644 index 00000000..cdec58af --- /dev/null +++ b/changelog.d/add-apng.add @@ -0,0 +1 @@ +Make Pleroma FE to also view apng (Animated PNG) attachment. diff --git a/changelog.d/add-taiwanese-aka-hokkien-i18n-support.add b/changelog.d/add-taiwanese-aka-hokkien-i18n-support.add deleted file mode 100644 index 53d89805..00000000 --- a/changelog.d/add-taiwanese-aka-hokkien-i18n-support.add +++ /dev/null @@ -1 +0,0 @@ -add the initial i18n translation file for Taiwanese (Hokkien), and modify some related files. \ No newline at end of file diff --git a/changelog.d/adminfe.add b/changelog.d/adminfe.add deleted file mode 100644 index 188c4555..00000000 --- a/changelog.d/adminfe.add +++ /dev/null @@ -1 +0,0 @@ -Implemented a very basic instance administration screen diff --git a/changelog.d/check-changelog.skip b/changelog.d/check-changelog.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/changelog.d/create-link-when-url-present.add b/changelog.d/create-link-when-url-present.add new file mode 100644 index 00000000..11aa3758 --- /dev/null +++ b/changelog.d/create-link-when-url-present.add @@ -0,0 +1 @@ +Create a link to the URL of the scrobble when it's present diff --git a/changelog.d/custom-emoji-notif-width.fix b/changelog.d/custom-emoji-notif-width.fix deleted file mode 100644 index da118f6b..00000000 --- a/changelog.d/custom-emoji-notif-width.fix +++ /dev/null @@ -1 +0,0 @@ -Keep aspect ratio of custom emoji reaction in notification diff --git a/changelog.d/double-notifications.fix b/changelog.d/double-notifications.fix new file mode 100644 index 00000000..24e08c0f --- /dev/null +++ b/changelog.d/double-notifications.fix @@ -0,0 +1 @@ +Fix native notifications appearing as many times as there are open tabs. Clicking on notification will focus last focused tab. diff --git a/changelog.d/edit-profile-button.fix b/changelog.d/edit-profile-button.fix deleted file mode 100644 index 5a92765c..00000000 --- a/changelog.d/edit-profile-button.fix +++ /dev/null @@ -1 +0,0 @@ -Fix openSettingsModalTab so that it correctly opens Settings modal instead of Admin modal diff --git a/changelog.d/extra-notifications.add b/changelog.d/extra-notifications.add new file mode 100644 index 00000000..90f21f54 --- /dev/null +++ b/changelog.d/extra-notifications.add @@ -0,0 +1 @@ +Support showing extra notifications in the notifications column diff --git a/changelog.d/focus-clear.add b/changelog.d/focus-clear.add new file mode 100644 index 00000000..70f54ab6 --- /dev/null +++ b/changelog.d/focus-clear.add @@ -0,0 +1 @@ +Focusing into a tab clears all current desktop notifications diff --git a/changelog.d/mention-twice.fix b/changelog.d/mention-twice.fix deleted file mode 100644 index 0e4b71df..00000000 --- a/changelog.d/mention-twice.fix +++ /dev/null @@ -1 +0,0 @@ -Fix a bug where mentioning a user twice will not fill the mention into the textarea diff --git a/changelog.d/mentionsline-shouldbreak.fix b/changelog.d/mentionsline-shouldbreak.fix deleted file mode 100644 index 33ee8d2c..00000000 --- a/changelog.d/mentionsline-shouldbreak.fix +++ /dev/null @@ -1 +0,0 @@ -Make MentionsLine aware of line breaking by non-br elements diff --git a/changelog.d/mobile-chrome-notifs.fix b/changelog.d/mobile-chrome-notifs.fix new file mode 100644 index 00000000..7db10c56 --- /dev/null +++ b/changelog.d/mobile-chrome-notifs.fix @@ -0,0 +1 @@ +Fixed error that appeared on mobile Chrome(ium) (and derivatives) when native notifications are allowed diff --git a/changelog.d/mobile-drawer-notifications.change b/changelog.d/mobile-drawer-notifications.change new file mode 100644 index 00000000..9353c709 --- /dev/null +++ b/changelog.d/mobile-drawer-notifications.change @@ -0,0 +1 @@ +Added option to not mark all notifications when closing notifications drawer on mobile, this creates a new button to mark all as seen. diff --git a/changelog.d/more-notification-types-setting.fix b/changelog.d/more-notification-types-setting.fix new file mode 100644 index 00000000..2d71b599 --- /dev/null +++ b/changelog.d/more-notification-types-setting.fix @@ -0,0 +1 @@ +Fixed being unable to set notification visibility for reports and follow requests diff --git a/changelog.d/native-filtering.add b/changelog.d/native-filtering.add new file mode 100644 index 00000000..82ab9a23 --- /dev/null +++ b/changelog.d/native-filtering.add @@ -0,0 +1 @@ +Added option to toggle what notification types appear in native notifications, by default less important ones (likes, repeats, etc) will no longer show up in native notifications. diff --git a/changelog.d/native-notifications.add b/changelog.d/native-notifications.add new file mode 100644 index 00000000..d896e7c0 --- /dev/null +++ b/changelog.d/native-notifications.add @@ -0,0 +1 @@ +Native notifications now also have "badge" property that matches instance's favicon (visible in Android Chromium at least) diff --git a/changelog.d/noninteractive-ignore-read.add b/changelog.d/noninteractive-ignore-read.add new file mode 100644 index 00000000..5e8710cf --- /dev/null +++ b/changelog.d/noninteractive-ignore-read.add @@ -0,0 +1 @@ +Added option to treat non-interactive notifications (likes, repeats et all) as seen for visual purposes (no read mark, ignored in counters, still can show in native notifications) diff --git a/changelog.d/notification-read.add b/changelog.d/notification-read.add new file mode 100644 index 00000000..e5027a95 --- /dev/null +++ b/changelog.d/notification-read.add @@ -0,0 +1 @@ +Interacting (opening reply box etc) or simply clicking on non-interactive notifications now marks them as read. Clicking on native notifications for non-interactive ones also marks them as seen. diff --git a/changelog.d/notifications-sorting.change b/changelog.d/notifications-sorting.change new file mode 100644 index 00000000..3a616244 --- /dev/null +++ b/changelog.d/notifications-sorting.change @@ -0,0 +1 @@ +Notifications are no longer sorted by "seen" status since interacting with them can change their read status and makes UI jumpy. Old behavior can be restored in settings. diff --git a/changelog.d/parser.fix b/changelog.d/parser.fix deleted file mode 100644 index 13bac0bf..00000000 --- a/changelog.d/parser.fix +++ /dev/null @@ -1 +0,0 @@ -fix regex issue in HTML parser/renderer diff --git a/changelog.d/react-button-safari.fix b/changelog.d/react-button-safari.fix deleted file mode 100644 index 9846d50d..00000000 --- a/changelog.d/react-button-safari.fix +++ /dev/null @@ -1 +0,0 @@ -Fix react button misalignment on safari ios diff --git a/changelog.d/react-button.fix b/changelog.d/react-button.fix deleted file mode 100644 index c2222fb6..00000000 --- a/changelog.d/react-button.fix +++ /dev/null @@ -1 +0,0 @@ -Fix react button not working if reaction accounts are not loaded diff --git a/changelog.d/scroll-emoji-selector-safari.fix b/changelog.d/scroll-emoji-selector-safari.fix deleted file mode 100644 index 3f5dda7d..00000000 --- a/changelog.d/scroll-emoji-selector-safari.fix +++ /dev/null @@ -1 +0,0 @@ -Fix scrolling emoji selector in modal in safari ios diff --git a/changelog.d/serviceworkers.change b/changelog.d/serviceworkers.change new file mode 100644 index 00000000..b3b64f6d --- /dev/null +++ b/changelog.d/serviceworkers.change @@ -0,0 +1 @@ +Notifications are now shown through a serviceworker (since mobile chrome does not allow them otherwise), it's always enabled, even if previously we only enabled it for WebPush notifications only. If you don't like websites "running" while closed, check how to disable them in your browser. Old way to show notifications will be used as a fallback but might not have all the new features. diff --git a/changelog.d/show-recent-scrobble.skip b/changelog.d/show-recent-scrobble.skip new file mode 100644 index 00000000..9227de06 --- /dev/null +++ b/changelog.d/show-recent-scrobble.skip @@ -0,0 +1 @@ +Shows the most recent scrobble under each post when available diff --git a/changelog.d/unreads-sync.fix b/changelog.d/unreads-sync.fix new file mode 100644 index 00000000..1eac3364 --- /dev/null +++ b/changelog.d/unreads-sync.fix @@ -0,0 +1 @@ +unread notifications should now properly catch up (eventually) in polling mode diff --git a/changelog.d/video-poster.fix b/changelog.d/video-poster.fix new file mode 100644 index 00000000..43e95f6e --- /dev/null +++ b/changelog.d/video-poster.fix @@ -0,0 +1 @@ +Video posters on Safari diff --git a/changelog.d/web-push-always.add b/changelog.d/web-push-always.add new file mode 100644 index 00000000..f8b8888a --- /dev/null +++ b/changelog.d/web-push-always.add @@ -0,0 +1 @@ +Added option to always "show" notifications when using web push for better compatibility with some browsers (chrome, edge, safari) diff --git a/index.html b/index.html index a02939f7..e790fb57 100644 --- a/index.html +++ b/index.html @@ -3,8 +3,8 @@ - + diff --git a/package.json b/package.json index 4824df82..fa41beb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pleroma_fe", - "version": "2.5.0", + "version": "2.6.1", "description": "Pleroma frontend, the default frontend of Pleroma social network server", "author": "Pleroma contributors ", "private": false, @@ -25,7 +25,7 @@ "@kazvmoe-infra/pinch-zoom-element": "1.2.0", "@kazvmoe-infra/unicode-emoji-json": "0.4.0", "@ruffle-rs/ruffle": "0.1.0-nightly.2022.7.12", - "@vuelidate/core": "2.0.2", + "@vuelidate/core": "2.0.3", "@vuelidate/validators": "2.0.0", "body-scroll-lock": "3.1.5", "chromatism": "3.0.0", @@ -35,9 +35,9 @@ "js-cookie": "3.0.1", "localforage": "1.10.0", "parse-link-header": "2.0.0", - "phoenix": "1.6.2", + "phoenix": "1.7.7", "punycode.js": "2.3.0", - "qrcode": "1.5.1", + "qrcode": "1.5.3", "querystring-es3": "0.2.1", "url": "0.11.0", "utf8": "3.0.0", @@ -97,7 +97,7 @@ "karma-spec-reporter": "0.0.36", "karma-webpack": "5.0.0", "lodash": "4.17.21", - "mini-css-extract-plugin": "2.7.5", + "mini-css-extract-plugin": "2.7.6", "mocha": "10.2.0", "nightwatch": "2.6.20", "opn": "5.5.0", diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 9c1f007b..84fea954 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -16,6 +16,7 @@ import backendInteractorService from '../services/backend_interactor_service/bac import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js' import { applyTheme, applyConfig } from '../services/style_setter/style_setter.js' import FaviconService from '../services/favicon_service/favicon_service.js' +import { initServiceWorker, updateFocus } from '../services/sw/sw.js' let staticInitialResults = null @@ -259,6 +260,7 @@ const getNodeInfo = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'editingAvailable', value: features.includes('editing') }) store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits }) store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled }) + store.dispatch('setInstanceOption', { name: 'quotingAvailable', value: features.includes('quote_posting') }) const uploadLimits = metadata.uploadLimits store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadLimits.general) }) @@ -343,6 +345,9 @@ const afterStoreSetup = async ({ store, i18n }) => { store.dispatch('setLayoutHeight', windowHeight()) FaviconService.initFaviconService() + initServiceWorker(store) + + window.addEventListener('focus', () => updateFocus()) const overrides = window.___pleromafe_dev_overrides || {} const server = (typeof overrides.target !== 'undefined') ? overrides.target : window.location.origin diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js index 68654f69..9baf63f2 100644 --- a/src/components/emoji_input/emoji_input.js +++ b/src/components/emoji_input/emoji_input.js @@ -1,4 +1,5 @@ import Completion from '../../services/completion/completion.js' +import genRandomSeed from '../../services/random_seed/random_seed.service.js' import EmojiPicker from '../emoji_picker/emoji_picker.vue' import Popover from 'src/components/popover/popover.vue' import ScreenReaderNotice from 'src/components/screen_reader_notice/screen_reader_notice.vue' @@ -110,7 +111,7 @@ const EmojiInput = { }, data () { return { - randomSeed: `${Math.random()}`.replace('.', '-'), + randomSeed: genRandomSeed(), input: undefined, caretEl: undefined, highlighted: -1, diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index 227d7718..0788f34c 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -3,7 +3,7 @@ ref="popover" trigger="click" popover-class="emoji-picker popover-default" - :trigger-attrs="{ 'aria-hidden': true }" + :trigger-attrs="{ 'aria-hidden': true, tabindex: -1 }" @show="onPopoverShown" @close="onPopoverClosed" > @@ -28,6 +28,7 @@ active: activeGroupView === group.id }" :title="group.text" + role="button" @click.prevent="highlight(group.id)" > diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 48b960b2..e2c88ceb 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -1,4 +1,5 @@ import Popover from '../popover/popover.vue' +import genRandomSeed from '../../services/random_seed/random_seed.service.js' import ConfirmModal from '../confirm_modal/confirm_modal.vue' import { library } from '@fortawesome/fontawesome-svg-core' import { @@ -40,7 +41,8 @@ const ExtraButtons = { data () { return { expanded: false, - showingDeleteDialog: false + showingDeleteDialog: false, + randomSeed: genRandomSeed() } }, methods: { @@ -152,6 +154,15 @@ const ExtraButtons = { editingAvailable () { return this.$store.state.instance.editingAvailable }, shouldConfirmDelete () { return this.$store.getters.mergedConfig.modalOnDelete + }, + triggerAttrs () { + return { + title: this.$t('status.more_actions'), + id: `popup-trigger-${this.randomSeed}`, + 'aria-controls': `popup-menu-${this.randomSeed}`, + 'aria-expanded': this.expanded, + 'aria-haspopup': 'menu' + } } } } diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index c1c15c0f..b7d3b1d3 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -2,6 +2,7 @@