From 68aadcdd08ee4f6c553993f9385da4ec61e701fa Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 11 Dec 2025 18:18:05 +0200 Subject: [PATCH 1/3] MANIFEST EDITING FUCK YEAH --- .../admin_tabs/instance_tab.vue | 1 + .../helpers/pwa_manifest_icons_setting.js | 64 ++++- .../helpers/pwa_manifest_icons_setting.vue | 241 +++++++++++------- .../settings_modal/helpers/setting.js | 1 - src/i18n/en.json | 26 ++ 5 files changed, 239 insertions(+), 94 deletions(-) diff --git a/src/components/settings_modal/admin_tabs/instance_tab.vue b/src/components/settings_modal/admin_tabs/instance_tab.vue index 63def257d..1ad84113a 100644 --- a/src/components/settings_modal/admin_tabs/instance_tab.vue +++ b/src/components/settings_modal/admin_tabs/instance_tab.vue @@ -44,6 +44,7 @@ path=":pleroma.:instance.:instance_thumbnail" /> +

{{ $t('admin_dash.instance.pwa.manifest') }}

  • diff --git a/src/components/settings_modal/helpers/pwa_manifest_icons_setting.js b/src/components/settings_modal/helpers/pwa_manifest_icons_setting.js index 3e6ff23fa..9986f6f39 100644 --- a/src/components/settings_modal/helpers/pwa_manifest_icons_setting.js +++ b/src/components/settings_modal/helpers/pwa_manifest_icons_setting.js @@ -1,12 +1,69 @@ import { clone } from 'lodash' +import { fileTypeExt } from 'src/services/file_type/file_type.service.js' + import Setting from './setting.js' +import Select from 'src/components/select/select.vue' +import Attachment from 'src/components/attachment/attachment.vue' +import MediaUpload from 'src/components/media_upload/media_upload.vue' export default { ...Setting, + components: { + ...Setting.components, + Select, + Attachment, + MediaUpload + }, + computed: { + ...Setting.computed, + purposeOptions () { + return ['any','monochrome','maskable'].map(value => ({ + value, + key: value, + label: this.$t('admin_dash.instance.pwa.icon.' + value) + })) + } + }, methods: { ...Setting.methods, - optionPresent (option) { - return this.valueSet.has(option) + attachment (e) { + const path = e[':src'] + if (!path) { + return { + mimetype: '', + url: '' + } + } + const url = path.includes('://') ? path : this.$store.state.instance.server + path + + return { + mimetype: fileTypeExt(url), + url + } + }, + setMediaFile ({ event, index }) { + this.update({ + event: { + target: { + value: event.url + }, + }, + index, + eventType: 'edit', + field: ':src' + }) + }, + setPurpose ({ event, index }) { + this.update({ + event: { + target: { + value: event + }, + }, + index, + eventType: 'edit', + field: ':purpose' + }) }, getValue ({ event, field, index, eventType }) { switch (eventType) { @@ -27,7 +84,6 @@ export default { const post = this.visibleState.slice(index + 1) const item = clone(this.visibleState[index]) const string = event.target.value - console.log(item) if (!string) { delete item[field] @@ -35,8 +91,6 @@ export default { item[field] = string } - console.log(item) - return [...pre, item, ...post] } } diff --git a/src/components/settings_modal/helpers/pwa_manifest_icons_setting.vue b/src/components/settings_modal/helpers/pwa_manifest_icons_setting.vue index c98b582f9..043128f91 100644 --- a/src/components/settings_modal/helpers/pwa_manifest_icons_setting.vue +++ b/src/components/settings_modal/helpers/pwa_manifest_icons_setting.vue @@ -7,6 +7,12 @@ class="pwa-label setting-label" :class="{ 'faint': shouldBeDisabled }" > + + + {{ ' ' }} @@ -22,106 +28,130 @@ > {{ backendDescriptionDescription + ' ' }}

    -
      -
    • -
      -
      -
      purpose
      -
      - +
        +
      • + {{ $t('admin_dash.instance.pwa.no_icons') }} + +
      • +
      • +
        +
        + +
        + + +
        + +
        +
        +
        {{ $t('admin_dash.instance.pwa.icon.purpose') }}
        +
        + +
        +
        sizes{{ $t('admin_dash.instance.pwa.optional') }}
        +
        + +
        +
        type{{ $t('admin_dash.instance.pwa.optional') }}
        +
        + +
        +
        +
        +
      -
      sizes
      -
      - + +
      -
      src
      -
      - -
      -
      type
      -
      - -
      -
      -
      - - + + +
      - -
    • -
    - - + + + diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index 4ed6227a1..cf68eaa14 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -161,7 +161,6 @@ export default { } }, backendDescriptionDescription () { - console.log('LOL', this.description) if (this.description) return this.description if (this.realSource !== 'admin') return '' if (this.hideDescription) return null diff --git a/src/i18n/en.json b/src/i18n/en.json index 934d5c53f..763d77d20 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1391,6 +1391,32 @@ "always": "Always", "never": "Never" }, + "instance": { + "instance": "Instance information", + "pwa": { + "manifest": "PWA Manifest", + "optional": "(optional)", + "no_icons": "No icons defined", + "icon": { + "purpose": "Icon purpose", + "any": "Any", + "monochrome": "Monochrome", + "maskable": "Maskable" + } + }, + "branding": "Branding", + "access": "Instance access", + "rich_metadata": "Metadata", + "restrict": { + "header": "Restrict access for anonymous visitors", + "description": "Detailed setting for allowing/disallowing access to certain aspects of API. By default (indeterminate state) it will disallow if instance is not public, ticked checkbox means disallow access even if instance is public, unticked means allow access even if instance is private. Please note that unexpected behavior might happen if some settings are set, i.e. if profile access is disabled posts will show without profile information.", + "timelines": "Timelines access", + "profiles": "User profiles access", + "activities": "Statuses/activities access" + }, + ":unauthenticated": "Unauthenticated", + ":all": "Everyone" + }, "temp_overrides": { ":pleroma": { ":connections_pool": { From 06608adec4baa2e5ea095175150194bffdba6a52 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 11 Dec 2025 18:27:12 +0200 Subject: [PATCH 2/3] fix submit button --- src/App.scss | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/App.scss b/src/App.scss index d9d8101b7..c8bb61361 100644 --- a/src/App.scss +++ b/src/App.scss @@ -381,7 +381,6 @@ nav { font-size: 1em; font-family: sans-serif; font-family: var(--font); - height: 2em; &.-transparent { backdrop-filter: blur(0.125em) contrast(60%); @@ -705,13 +704,8 @@ option { position: relative; display: inline-flex; vertical-align: middle; - min-height: 2em; align-items: end; - .input { - height: 2em; - } - > *, > * .button-default { --_roundness-left: 0; From 3355f1d797ce79403bf79c522634404f8a05f16f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 11 Dec 2025 18:29:55 +0200 Subject: [PATCH 3/3] pleasing the linter gods --- .../interface_language_switcher.vue | 2 +- .../settings_modal/helpers/pwa_manifest_icons_setting.vue | 4 ++-- src/components/settings_modal/helpers/rate_setting.vue | 6 +++--- src/components/settings_modal/helpers/tuple_setting.vue | 2 +- src/components/settings_modal/settings_modal.scss | 5 ++++- src/components/settings_modal/tabs/composing_tab.vue | 5 ++++- src/components/settings_modal/tabs/filtering_tab.vue | 2 +- src/components/settings_modal/tabs/general_tab.vue | 4 +++- src/components/settings_modal/tabs/notifications_tab.vue | 2 +- src/components/settings_modal/tabs/profile_tab.vue | 2 +- 10 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/components/interface_language_switcher/interface_language_switcher.vue b/src/components/interface_language_switcher/interface_language_switcher.vue index 1f7d419e9..a547b98a5 100644 --- a/src/components/interface_language_switcher/interface_language_switcher.vue +++ b/src/components/interface_language_switcher/interface_language_switcher.vue @@ -13,8 +13,8 @@ {{ $t('admin_dash.rate_limit.separate') }} - - + + diff --git a/src/components/settings_modal/helpers/tuple_setting.vue b/src/components/settings_modal/helpers/tuple_setting.vue index 09e4aa9dd..e39e23344 100644 --- a/src/components/settings_modal/helpers/tuple_setting.vue +++ b/src/components/settings_modal/helpers/tuple_setting.vue @@ -1,7 +1,7 @@