From 9078917012688bcd5d0d9c13a550fef2445e1bf9 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 9 Oct 2023 13:39:47 +0200 Subject: [PATCH 01/14] Update build commands --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2b26f97a2f..e929fcfaca 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "node": ">=16" }, "scripts": { - "build:development": "cross-env RAILS_ENV=development NODE_ENV=development ./bin/webpack", - "build:production": "cross-env RAILS_ENV=production NODE_ENV=production ./bin/webpack", + "build:development": "cross-env NODE_ENV=development webpack --config config/webpack/development.js", + "build:production": "cross-env NODE_ENV=production webpack --config config/webpack/production.js", + "build": "cross-env NODE_ENV=production webpack --config config/webpack/production.js", "fix:js": "yarn lint:js --fix", "fix:json": "prettier --write \"**/*.{json,json5}\"", "fix:md": "prettier --write \"**/*.md\"", From d235afc303e57616522d863f4a3e0baef8649f4a Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 9 Oct 2023 13:53:35 +0200 Subject: [PATCH 02/14] Disable chunking --- config/webpack/shared.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/webpack/shared.js b/config/webpack/shared.js index bf1b006b0a..2235157a88 100644 --- a/config/webpack/shared.js +++ b/config/webpack/shared.js @@ -57,8 +57,7 @@ module.exports = { entry: entries, output: { - filename: 'js/[name]-[chunkhash].js', - chunkFilename: 'js/[name]-[chunkhash].chunk.js', + filename: 'js/[name].js', hotUpdateChunkFilename: 'js/[id]-[hash].hot-update.js', hashFunction: 'sha256', crossOriginLoading: 'anonymous', @@ -103,8 +102,7 @@ module.exports = { }, ), new MiniCssExtractPlugin({ - filename: 'css/[name]-[contenthash:8].css', - chunkFilename: 'css/[name]-[contenthash:8].chunk.css', + filename: 'css/[name].css', }), new AssetsManifestPlugin({ integrity: true, From 960614ec6fca5d0e2f7aca5b0ca2f8fba94ed905 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 20:13:42 +0200 Subject: [PATCH 03/14] Merge patchset from akko branch --- README.md | 35 ++++-- app/javascript/flavours/glitch/api.js | 11 ++ .../compose/components/action_bar.jsx | 2 - .../compose/components/navigation_bar.jsx | 8 +- .../compose/containers/warning_container.jsx | 2 +- .../local_settings/navigation/index.jsx | 9 +- .../features/local_settings/page/index.jsx | 4 +- .../components/deprecated_settings_modal.jsx | 2 +- .../features/ui/components/link_footer.jsx | 34 +----- .../ui/components/navigation_panel.jsx | 1 - app/javascript/flavours/glitch/stream.js | 3 +- .../flavours/glitch/utils/backend_links.js | 6 +- .../flavours/glitch/utils/log_out.js | 2 +- app/javascript/mastodon/locales/en.json | 2 +- public/auth.js | 101 +++++++++++++++++ public/images/mascot.svg | 11 ++ public/index.html | 33 ++++++ public/login.html | 13 +++ public/logout.html | 14 +++ public/manifest.json | 12 ++ public/prepare.html | 11 ++ public/verify-state.js | 103 ++++++++++++++++++ 22 files changed, 350 insertions(+), 69 deletions(-) create mode 100644 public/auth.js create mode 100644 public/images/mascot.svg create mode 100644 public/index.html create mode 100644 public/login.html create mode 100644 public/logout.html create mode 100644 public/manifest.json create mode 100644 public/prepare.html create mode 100644 public/verify-state.js diff --git a/README.md b/README.md index f878752fe3..79a63cb505 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,31 @@ -# Mastodon Glitch Edition +# Mastodon Glitch Edition (standalone frontend) -> Now with automated deploys! +This is a very hacky fork of akkoma-masto-fe that adds standalone support (meaning your browser can OAuth against an arbitrary instance). It's currently tested to "work" (login doesn't break, basic functionality works) with Iceshrimp and GoToSocial (and it obviously works with Mastodon). -[![Build Status](https://img.shields.io/circleci/project/github/glitch-soc/mastodon.svg)][circleci] -[![Code Climate](https://img.shields.io/codeclimate/maintainability/glitch-soc/mastodon.svg)][code_climate] +To try this out, go to [masto-fe.iceshrimp.dev](https://masto-fe.iceshrimp.dev), type in your instance domain name (for split domain setups, use the web domain) & press the button. -[circleci]: https://circleci.com/gh/glitch-soc/mastodon -[code_climate]: https://codeclimate.com/github/glitch-soc/mastodon +To set this up yourself, clone the repo into e.g. `/home/user/masto-fe-standalone` and run `yarn && yarn build:production` (you might have to use `NODE_OPTIONS=--openssl-legacy-provider` until we've rebased this onto upstream glitch). -So here's the deal: we all work on this code, and anyone who uses that does so absolutely at their own risk. can you dig it? +Then configure nginx for a subdomain like this: -- You can view documentation for this project at [glitch-soc.github.io/docs/](https://glitch-soc.github.io/docs/). -- And contributing guidelines are available [here](CONTRIBUTING.md) and [here](https://glitch-soc.github.io/docs/contributing/). +``` +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +server { + include sites/example.com/inc/ssl.conf; + server_name masto.example.com; + + location / { + root /home/user/masto-fe-standalone/public/; + index index.html; + try_files $uri /index.html; + } +} +``` + +And open `https://masto.example.com` in your browser, type in your instance domain, press the button & follow the OAuth flow. + +Should anything break, open `https://masto.example.com/logout.html` or clear local storage manually. diff --git a/app/javascript/flavours/glitch/api.js b/app/javascript/flavours/glitch/api.js index 948ffbc95c..73e3d8b371 100644 --- a/app/javascript/flavours/glitch/api.js +++ b/app/javascript/flavours/glitch/api.js @@ -53,6 +53,15 @@ const authorizationHeaderFromState = getState => { /** * @param {() => import('immutable').Map} getState + * @returns string + */ +const baseUrlFromState = getState => { + const baseUrl = getState && getState().getIn(['meta', 'base_url'], ''); + return `${baseUrl}`; +}; + +/** + * @param {() => import('immutable').Map} getState * @returns {import('axios').AxiosInstance} */ export default function api(getState) { @@ -62,6 +71,8 @@ export default function api(getState) { ...authorizationHeaderFromState(getState), }, + baseURL: baseUrlFromState(getState), + transformResponse: [ function (data) { try { diff --git a/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx b/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx index ff7d4d03dc..3c971a7c0c 100644 --- a/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx @@ -42,8 +42,6 @@ class ActionBar extends PureComponent { let menu = []; - menu.push({ text: intl.formatMessage(messages.edit_profile), href: profileLink }); - menu.push({ text: intl.formatMessage(messages.preferences), href: preferencesLink }); menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' }); menu.push(null); menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' }); diff --git a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx index 383a9db528..988dfd30c2 100644 --- a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx @@ -27,16 +27,10 @@ export default class NavigationBar extends ImmutablePureComponent {
+
{this.props.account.get('display_name')}
@{this.props.account.get('acct')} - - { profileLink !== undefined && ( - - )}
diff --git a/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx b/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx index 16916ba9c0..16a2358529 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx +++ b/app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx @@ -19,7 +19,7 @@ const mapStateToProps = state => ({ const WarningWrapper = ({ needsLockWarning, hashtagWarning, directMessageWarning }) => { if (needsLockWarning) { - return }} />} />; + return }} />} />; } if (hashtagWarning) { diff --git a/app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx b/app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx index 022d817126..39894be400 100644 --- a/app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx +++ b/app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx @@ -73,15 +73,8 @@ class LocalSettingsNavigation extends PureComponent { /> - + - + ), }} /> diff --git a/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx index ba77feb6a5..e3728bc173 100644 --- a/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx @@ -68,7 +68,7 @@ class DeprecatedSettingsModal extends PureComponent {
    { settings.map((setting_name) => (
  • - +
  • )) }
diff --git a/app/javascript/flavours/glitch/features/ui/components/link_footer.jsx b/app/javascript/flavours/glitch/features/ui/components/link_footer.jsx index 0ef37bb239..8343de711b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/link_footer.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/link_footer.jsx @@ -64,42 +64,12 @@ class LinkFooter extends PureComponent { return (

- {domain}: - {' '} - - {statusPageUrl && ( - <> - {DividingCircle} - - - )} - {canInvite && ( - <> - {DividingCircle} - - - )} - {canProfileDirectory && ( - <> - {DividingCircle} - - - )} + Masto-FE-standalone {DividingCircle} - -

- -

- Mastodon: - {' '} - - {DividingCircle} - + {DividingCircle} {DividingCircle} - - {DividingCircle} v{version}

diff --git a/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx b/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx index f6984d5adb..38c8c15311 100644 --- a/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx @@ -104,7 +104,6 @@ class NavigationPanel extends Component {
- {!!preferencesLink && } )} diff --git a/app/javascript/flavours/glitch/stream.js b/app/javascript/flavours/glitch/stream.js index 55f009e130..554889bc3d 100644 --- a/app/javascript/flavours/glitch/stream.js +++ b/app/javascript/flavours/glitch/stream.js @@ -235,8 +235,9 @@ const createConnection = (streamingAPIBaseURL, accessToken, channelName, { conne channelName = params.shift(); if (streamingAPIBaseURL.startsWith('ws')) { + params.push(`access_token=${accessToken}`); // @ts-expect-error - const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken); + const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming?${params.join('&')}`, accessToken); // @ts-expect-error ws.onopen = connected; diff --git a/app/javascript/flavours/glitch/utils/backend_links.js b/app/javascript/flavours/glitch/utils/backend_links.js index 2028a1e608..fc20052907 100644 --- a/app/javascript/flavours/glitch/utils/backend_links.js +++ b/app/javascript/flavours/glitch/utils/backend_links.js @@ -1,6 +1,6 @@ -export const preferencesLink = '/settings/preferences'; -export const profileLink = '/settings/profile'; -export const signOutLink = '/auth/sign_out'; +export const preferencesLink = undefined; +export const profileLink = undefined; +export const signOutLink = '/logout.html'; export const privacyPolicyLink = '/privacy-policy'; export const accountAdminLink = (id) => `/admin/accounts/${id}`; export const statusAdminLink = (account_id, status_id) => `/admin/accounts/${account_id}/statuses/${status_id}`; diff --git a/app/javascript/flavours/glitch/utils/log_out.js b/app/javascript/flavours/glitch/utils/log_out.js index a7c7ef5454..8c604e102f 100644 --- a/app/javascript/flavours/glitch/utils/log_out.js +++ b/app/javascript/flavours/glitch/utils/log_out.js @@ -26,7 +26,7 @@ export const logOut = () => { submitButton.setAttribute('type', 'submit'); form.appendChild(submitButton); - form.method = 'post'; + form.method = 'get'; form.action = signOutLink; form.style.display = 'none'; diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 4399b99951..68f66ba9c3 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -283,7 +283,7 @@ "footer.invite": "Invite people", "footer.keyboard_shortcuts": "Keyboard shortcuts", "footer.privacy_policy": "Privacy policy", - "footer.source_code": "View source code", + "footer.source_code": "Source code", "footer.status": "Status", "generic.saved": "Saved", "getting_started.heading": "Getting started", diff --git a/public/auth.js b/public/auth.js new file mode 100644 index 0000000000..6066b68962 --- /dev/null +++ b/public/auth.js @@ -0,0 +1,101 @@ +document.addEventListener("DOMContentLoaded", async function() { + await ready(); +}); + +async function ready() { + const domain = localStorage.getItem('domain'); + let accessToken = localStorage.getItem(`access_token`); + + if (domain) document.getElementById('instance').value = domain; + + const urlParams = new URLSearchParams(window.location.search); + const code = urlParams.get('code'); + + if (domain && code && !accessToken) await getToken(code, domain).then(res => accessToken = res); + if (accessToken) { + window.location.href = '/prepare.html'; + } +} + +async function auth() { + setMessage('Please wait'); + const instance = document.getElementById('instance').value; + const domain = instance.match(/(?:https?:\/\/)?(.*)/)[1]; + if (!domain) { + setMessage('Invalid instance', false); + return; + } + + localStorage.setItem('domain', domain); + + // We need to run this every time in cases like Iceshrimp, where the client id/secret aren't reusable (yet) because they contain use-once session information + await registerApp(domain); + + authorize(domain); +} + +async function registerApp(domain) { + setMessage('Registering app'); + + const appsUrl = `https://${domain}/api/v1/apps`; + const formData = new FormData(); + formData.append('client_name', 'Masto-FE standalone'); + formData.append('redirect_uris', document.location.origin + document.location.pathname); + formData.append('scopes', 'read write follow push'); + + // eslint-disable-next-line promise/catch-or-return + await fetch(appsUrl, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: new URLSearchParams(formData), + }) + .then(async res => { + const app = await res.json(); + localStorage.setItem(`client_id`, app.client_id); + localStorage.setItem(`client_secret`, app.client_secret); + }); +} + +function authorize(domain) { + setMessage('Authorizing'); + const clientId = localStorage.getItem(`client_id`); + document.location.href = `https://${domain}/oauth/authorize?response_type=code&client_id=${clientId}&redirect_uri=${document.location.origin + document.location.pathname}&scope=read+write+follow+push`; +} + +async function getToken(code, domain) { + setMessage('Getting token'); + + const tokenUrl = `https://${domain}/oauth/token`; + const clientId = localStorage.getItem(`client_id`); + const clientSecret = localStorage.getItem(`client_secret`); + + const formData = new FormData(); + formData.append('grant_type', 'authorization_code'); + formData.append('code', code); + formData.append('client_id', clientId); + formData.append('client_secret', clientSecret); + formData.append('scope', 'read write follow push'); + formData.append('redirect_uri', document.location.origin + document.location.pathname); + + + // eslint-disable-next-line promise/catch-or-return + return fetch(tokenUrl, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: new URLSearchParams(formData), + }) + .then(async res => { + const app = await res.json(); + if (app.access_token) localStorage.setItem(`access_token`, app.access_token); + return app.access_token; + }); +} + +function setMessage(message, disabled = true) { + document.getElementById('message').textContent = message; + document.getElementById('btn').disabled = disabled; +} \ No newline at end of file diff --git a/public/images/mascot.svg b/public/images/mascot.svg new file mode 100644 index 0000000000..23384b6617 --- /dev/null +++ b/public/images/mascot.svg @@ -0,0 +1,11 @@ + +image/svg+xml + + + + + + + + + \ No newline at end of file diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000000..b9f329c6a0 --- /dev/null +++ b/public/index.html @@ -0,0 +1,33 @@ + + + + + + Masto-FE standalone + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + diff --git a/public/login.html b/public/login.html new file mode 100644 index 0000000000..90e56024af --- /dev/null +++ b/public/login.html @@ -0,0 +1,13 @@ + + + + + Login | Masto-FE standalone + + + + + + + + \ No newline at end of file diff --git a/public/logout.html b/public/logout.html new file mode 100644 index 0000000000..f49e3dc501 --- /dev/null +++ b/public/logout.html @@ -0,0 +1,14 @@ + + + + + Logout | Masto-FE standalone + + + +Clearing local storage and redirecting back to login... + + \ No newline at end of file diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000000..c1c0f9dda7 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,12 @@ +{ + "background_color": "#191b22", + "categories": ["social"], + "description": "Masto-FE standalone", + "display": "standalone", + "name": "Masto-FE standalone", + "serviceworker": { + "src": "/sw.js" + }, + "start_url": "/getting-started", + "theme_color": "#282c37" +} diff --git a/public/prepare.html b/public/prepare.html new file mode 100644 index 0000000000..e6e5f1e0cc --- /dev/null +++ b/public/prepare.html @@ -0,0 +1,11 @@ + + + + + Login | Masto-FE standalone + + + +

Preparing state object...

+ + \ No newline at end of file diff --git a/public/verify-state.js b/public/verify-state.js new file mode 100644 index 0000000000..5308ff6f46 --- /dev/null +++ b/public/verify-state.js @@ -0,0 +1,103 @@ +loadState().then(_ => null); + +async function loadState() { + const domain = localStorage.getItem('domain'); + const access_token = localStorage.getItem('access_token'); + const storedState = localStorage.getItem('initial_state'); + + if (!domain || !access_token) { + window.location.href = '/login.html'; + return; + } + + if (storedState && window.location.pathname !== '/prepare.html') { + document.getElementById('initial-state').textContent = storedState; + } + + const apiUrl = `https://${domain}/api`; + const instance = await fetch(`${apiUrl}/v1/instance`).then(async p => await p.json()); + const options = {headers: {Authorization: `Bearer ${access_token}`}}; + const credentials = await fetch(`${apiUrl}/v1/accounts/verify_credentials`, options).then(async p => await p.json()); + const state = { + "accounts": { + "plc":{ + "accepts_direct_messages_from":"everybody", + "acct": credentials.acct, + "avatar": credentials.avatar, + "avatar_static": credentials.avatar_static, + "bot": credentials.bot, + "created_at": credentials.created_at, + "display_name": credentials.display_name, + "emojis":[], + "fields":[], + "follow_requests_count":0, + "followers_count": credentials.followers_count, + "following_count": credentials.following_count, + "fqn":`${credentials.acct}@${domain}`, + "header": credentials.header, + "header_static": credentials.header_static, + "id": credentials.id, + "last_status_at": credentials.created_at, + "locked": credentials.locked, + "note":"", + "source": credentials.source, + "statuses_count": credentials.statuses_count, + "url": credentials.url, + "username": credentials.acct + } + }, + "char_limit": instance.configuration.statuses.max_characters, + "compose": { + "allow_content_types": [ + "text/x.misskeymarkdown" + ], + "default_privacy": credentials.source.privacy, + "default_sensitive": credentials.source.sensitive, + "me": credentials.id + }, + "media_attachments": { + "accept_content_types": instance.configuration.media_attachments.supported_mime_types + }, + "meta": { + "access_token": access_token, + "admin": "0", + "advanced_layout": true, + "auto_play_gif": false, + "boost_modal": false, + "compact_reaction": false, + "delete_modal": true, + "display_sensitive_media": false, + "domain": domain, + "enable_reaction": true, + "locale": "en", + "mascot": "/images/mascot.svg", + "max_toot_chars": instance.configuration.statuses.max_characters, + "me": credentials.id, + "reduce_motion": false, + "show_quote_button": true, + "base_url": `https://${domain}`, + "streaming_api_base_url": `wss://${domain}`, + "title": `${instance.title}`, + "unfollow_modal": true, + "source_url": 'https://iceshrimp.dev/iceshrimp/masto-fe-standalone', + "version": instance.version + }, + "poll_limits": { + "max_expiration": instance.configuration.polls.max_expiration, + "max_option_chars": instance.configuration.polls.max_characters_per_option, + "max_options": instance.configuration.polls.max_options, + "min_expiration": instance.configuration.polls.min_expiration + }, + "push_subscription": null, + "rights": { + "admin": false, + "delete_others_notice": false + }, + "settings": {} + }; + + const json = JSON.stringify(state); + if (window.location.pathname !== '/prepare.html') document.getElementById('initial-state').textContent = json; + localStorage.setItem("initial_state", json); + if (window.location.pathname === '/prepare.html') window.location.href = '/'; +} \ No newline at end of file From e6fd0de8400cd0c91cf5c0857b62aa5dc20b7dd1 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 19:05:05 +0200 Subject: [PATCH 04/14] Update patchset to upstream glitch --- public/index.html | 14 +++++++------- public/verify-state.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/index.html b/public/index.html index b9f329c6a0..6d434b492f 100644 --- a/public/index.html +++ b/public/index.html @@ -7,17 +7,17 @@ + - - - - - - - + + + + + + diff --git a/public/verify-state.js b/public/verify-state.js index 5308ff6f46..2306cbd4fc 100644 --- a/public/verify-state.js +++ b/public/verify-state.js @@ -71,7 +71,6 @@ async function loadState() { "enable_reaction": true, "locale": "en", "mascot": "/images/mascot.svg", - "max_toot_chars": instance.configuration.statuses.max_characters, "me": credentials.id, "reduce_motion": false, "show_quote_button": true, @@ -82,6 +81,7 @@ async function loadState() { "source_url": 'https://iceshrimp.dev/iceshrimp/masto-fe-standalone', "version": instance.version }, + "max_toot_chars": instance.configuration.statuses.max_characters, "poll_limits": { "max_expiration": instance.configuration.polls.max_expiration, "max_option_chars": instance.configuration.polls.max_characters_per_option, From d7254bd3327c5ad208b7f74aade749234441b3bc Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 19:38:17 +0200 Subject: [PATCH 05/14] Update default local-settings --- app/javascript/flavours/glitch/reducers/local_settings.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/flavours/glitch/reducers/local_settings.js b/app/javascript/flavours/glitch/reducers/local_settings.js index 712f115d0b..eefb06ce79 100644 --- a/app/javascript/flavours/glitch/reducers/local_settings.js +++ b/app/javascript/flavours/glitch/reducers/local_settings.js @@ -14,8 +14,8 @@ const initialState = ImmutableMap({ confirm_missing_media_description: false, confirm_boost_missing_media_description: false, confirm_before_clearing_draft: true, - prepend_cw_re: true, - preselect_on_reply: true, + prepend_cw_re: false, + preselect_on_reply: false, inline_preview_cards: true, hicolor_privacy_icons: false, show_content_type_choice: false, @@ -30,7 +30,7 @@ const initialState = ImmutableMap({ enabled : true, auto : ImmutableMap({ all : false, - notifications : true, + notifications : false, lengthy : true, reblogs : false, replies : false, From d35cbe44734ec55effc6a0983e9fbb6d120ab945 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 19:54:26 +0200 Subject: [PATCH 06/14] Remove /deck prefix --- app/javascript/flavours/glitch/components/router.tsx | 12 ++---------- app/javascript/flavours/glitch/features/ui/index.jsx | 7 +++---- public/index.html | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/javascript/flavours/glitch/components/router.tsx b/app/javascript/flavours/glitch/components/router.tsx index f093716517..36d94c25fd 100644 --- a/app/javascript/flavours/glitch/components/router.tsx +++ b/app/javascript/flavours/glitch/components/router.tsx @@ -21,11 +21,7 @@ browserHistory.push = (path: string, state?: MastodonLocationState) => { state = state ?? {}; state.fromMastodon = true; - if (layoutFromWindow() === 'multi-column' && !path.startsWith('/deck')) { - originalPush(`/deck${path}`, state); - } else { - originalPush(path, state); - } + originalPush(path, state); }; browserHistory.replace = (path: string, state?: MastodonLocationState) => { @@ -34,11 +30,7 @@ browserHistory.replace = (path: string, state?: MastodonLocationState) => { state.fromMastodon = true; } - if (layoutFromWindow() === 'multi-column' && !path.startsWith('/deck')) { - originalReplace(`/deck${path}`, state); - } else { - originalReplace(path, state); - } + originalReplace(path, state); }; export const Router: React.FC = ({ children }) => { diff --git a/app/javascript/flavours/glitch/features/ui/index.jsx b/app/javascript/flavours/glitch/features/ui/index.jsx index 6f80509577..f88a78e9ae 100644 --- a/app/javascript/flavours/glitch/features/ui/index.jsx +++ b/app/javascript/flavours/glitch/features/ui/index.jsx @@ -174,7 +174,7 @@ class SwitchingColumnsArea extends PureComponent { if (singleColumn) { redirect = ; } else { - redirect = ; + redirect = ; } } else if (singleUserMode && owner && initialState?.accounts[owner]) { redirect = ; @@ -189,9 +189,8 @@ class SwitchingColumnsArea extends PureComponent { {redirect} - {singleColumn ? : null} - {singleColumn && pathName.startsWith('/deck/') ? : null} - {!singleColumn && pathName === '/getting-started' ? : null} + {singleColumn ? : null} + {pathName.startsWith('/deck/') ? : null} diff --git a/public/index.html b/public/index.html index 6d434b492f..abf9880378 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ - + From ad151d2e3c75059fc58e05765df7cc2923911bcb Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 20:23:12 +0200 Subject: [PATCH 07/14] Revert to old profile actions icon --- .../flavours/glitch/features/compose/components/action_bar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx b/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx index 3c971a7c0c..9cc386d1af 100644 --- a/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/action_bar.jsx @@ -60,7 +60,7 @@ class ActionBar extends PureComponent { return (
- +
); From 114fd1a521552055a4226cbd38b7ef8b73a2e094 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 20:26:48 +0200 Subject: [PATCH 08/14] Update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79a63cb505..8a3a8f85f0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Mastodon Glitch Edition (standalone frontend) -This is a very hacky fork of akkoma-masto-fe that adds standalone support (meaning your browser can OAuth against an arbitrary instance). It's currently tested to "work" (login doesn't break, basic functionality works) with Iceshrimp and GoToSocial (and it obviously works with Mastodon). +This is a somewhat hacky fork of glitch-soc that adds standalone support (meaning your browser can OAuth against an arbitrary instance). It's currently tested to work (for the most part) with Iceshrimp and GoToSocial (and obviously Mastodon). To try this out, go to [masto-fe.iceshrimp.dev](https://masto-fe.iceshrimp.dev), type in your instance domain name (for split domain setups, use the web domain) & press the button. -To set this up yourself, clone the repo into e.g. `/home/user/masto-fe-standalone` and run `yarn && yarn build:production` (you might have to use `NODE_OPTIONS=--openssl-legacy-provider` until we've rebased this onto upstream glitch). +To set this up yourself, clone the repo into e.g. `/home/user/masto-fe-standalone` and run `yarn && yarn build:production`. Then configure nginx for a subdomain like this: From 4a6124675000d2dc4c7e513d2fed6a3d2a35e3f4 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 21:01:51 +0200 Subject: [PATCH 09/14] Remove issue templates --- .github/ISSUE_TEMPLATE/1.web_bug_report.yml | 76 ------------------- .../ISSUE_TEMPLATE/2.server_bug_report.yml | 65 ---------------- .github/ISSUE_TEMPLATE/3.feature_request.yml | 22 ------ .github/ISSUE_TEMPLATE/config.yml | 5 -- public/verify-state.js | 4 +- 5 files changed, 3 insertions(+), 169 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/1.web_bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/2.server_bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/3.feature_request.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/1.web_bug_report.yml b/.github/ISSUE_TEMPLATE/1.web_bug_report.yml deleted file mode 100644 index 20e27d103c..0000000000 --- a/.github/ISSUE_TEMPLATE/1.web_bug_report.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Bug Report (Web Interface) -description: If you are using Mastodon's web interface and something is not working as expected -labels: [bug, 'status/to triage', 'area/web interface'] -body: - - type: markdown - attributes: - value: | - Make sure that you are submitting a new bug that was not previously reported or already fixed. - - Please use a concise and distinct title for the issue. - - type: textarea - attributes: - label: Steps to reproduce the problem - description: What were you trying to do? - value: | - 1. - 2. - 3. - ... - validations: - required: true - - type: input - attributes: - label: Expected behaviour - description: What should have happened? - validations: - required: true - - type: input - attributes: - label: Actual behaviour - description: What happened? - validations: - required: true - - type: textarea - attributes: - label: Detailed description - validations: - required: false - - type: input - attributes: - label: Mastodon instance - description: The address of the Mastodon instance where you experienced the issue - placeholder: mastodon.social - validations: - required: true - - type: input - attributes: - label: Mastodon version - description: | - This is displayed at the bottom of the About page, eg. `v4.1.2+nightly-20230627` - placeholder: v4.1.2 - validations: - required: true - - type: input - attributes: - label: Browser name and version - description: | - What browser are you using when getting this bug? Please specify the version as well. - placeholder: Firefox 105.0.3 - validations: - required: true - - type: input - attributes: - label: Operating system - description: | - What OS are you running? Please specify the version as well. - placeholder: macOS 13.4.1 - validations: - required: true - - type: textarea - attributes: - label: Technical details - description: | - Any additional technical details you may have. This can include the full error log, inspector's output… - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/2.server_bug_report.yml b/.github/ISSUE_TEMPLATE/2.server_bug_report.yml deleted file mode 100644 index 49d5f57209..0000000000 --- a/.github/ISSUE_TEMPLATE/2.server_bug_report.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Bug Report (server / API) -description: | - If something is not working as expected, but is not from using the web interface. -labels: [bug, 'status/to triage'] -body: - - type: markdown - attributes: - value: | - Make sure that you are submitting a new bug that was not previously reported or already fixed. - - Please use a concise and distinct title for the issue. - - type: textarea - attributes: - label: Steps to reproduce the problem - description: What were you trying to do? - value: | - 1. - 2. - 3. - ... - validations: - required: true - - type: input - attributes: - label: Expected behaviour - description: What should have happened? - validations: - required: true - - type: input - attributes: - label: Actual behaviour - description: What happened? - validations: - required: true - - type: textarea - attributes: - label: Detailed description - validations: - required: false - - type: input - attributes: - label: Mastodon instance - description: The address of the Mastodon instance where you experienced the issue - placeholder: mastodon.social - validations: - required: false - - type: input - attributes: - label: Mastodon version - description: | - This is displayed at the bottom of the About page, eg. `v4.1.2+nightly-20230627` - placeholder: v4.1.2 - validations: - required: false - - type: textarea - attributes: - label: Technical details - description: | - Any additional technical details you may have, like logs or error traces - value: | - If this is happening on your own Mastodon server, please fill out those: - - Ruby version: (from `ruby --version`, eg. v3.1.2) - - Node.js version: (from `node --version`, eg. v18.16.0) - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/3.feature_request.yml b/.github/ISSUE_TEMPLATE/3.feature_request.yml deleted file mode 100644 index 2cabcf61e0..0000000000 --- a/.github/ISSUE_TEMPLATE/3.feature_request.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Feature Request -description: I have a suggestion -labels: [suggestion] -body: - - type: markdown - attributes: - value: | - Please use a concise and distinct title for the issue. - - Consider: Could it be implemented as a 3rd party app using the REST API instead? - - type: textarea - attributes: - label: Pitch - description: Describe your idea for a feature. Make sure it has not already been suggested/implemented/turned down before. - validations: - required: true - - type: textarea - attributes: - label: Motivation - description: Why do you think this feature is needed? Who would benefit from it? - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index f5d3196528..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: GitHub Discussions - url: https://github.com/mastodon/mastodon/discussions - about: Please ask and answer questions here. diff --git a/public/verify-state.js b/public/verify-state.js index 2306cbd4fc..543b55bdcb 100644 --- a/public/verify-state.js +++ b/public/verify-state.js @@ -93,7 +93,9 @@ async function loadState() { "admin": false, "delete_others_notice": false }, - "settings": {} + "settings": { + + } }; const json = JSON.stringify(state); From aa27eaece41c63865fa6578b56366e50558e39e9 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 12 Oct 2023 21:04:46 +0200 Subject: [PATCH 10/14] Fix languages crash --- public/verify-state.js | 993 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 991 insertions(+), 2 deletions(-) diff --git a/public/verify-state.js b/public/verify-state.js index 543b55bdcb..8d2c222ddd 100644 --- a/public/verify-state.js +++ b/public/verify-state.js @@ -94,8 +94,997 @@ async function loadState() { "delete_others_notice": false }, "settings": { - - } + "frequentlyUsedLanguages": { + "en": 1 + } + }, + "languages":[ + [ + "aa", + "Afar", + "Afaraf" + ], + [ + "ab", + "Abkhaz", + "аҧсуа бызшәа" + ], + [ + "ae", + "Avestan", + "avesta" + ], + [ + "af", + "Afrikaans", + "Afrikaans" + ], + [ + "ak", + "Akan", + "Akan" + ], + [ + "am", + "Amharic", + "አማርኛ" + ], + [ + "an", + "Aragonese", + "aragonés" + ], + [ + "ar", + "Arabic", + "اللغة العربية" + ], + [ + "as", + "Assamese", + "অসমীয়া" + ], + [ + "av", + "Avaric", + "авар мацӀ" + ], + [ + "ay", + "Aymara", + "aymar aru" + ], + [ + "az", + "Azerbaijani", + "azərbaycan dili" + ], + [ + "ba", + "Bashkir", + "башҡорт теле" + ], + [ + "be", + "Belarusian", + "беларуская мова" + ], + [ + "bg", + "Bulgarian", + "български език" + ], + [ + "bh", + "Bihari", + "भोजपुरी" + ], + [ + "bi", + "Bislama", + "Bislama" + ], + [ + "bm", + "Bambara", + "bamanankan" + ], + [ + "bn", + "Bengali", + "বাংলা" + ], + [ + "bo", + "Tibetan", + "བོད་ཡིག" + ], + [ + "br", + "Breton", + "brezhoneg" + ], + [ + "bs", + "Bosnian", + "bosanski jezik" + ], + [ + "ca", + "Catalan", + "Català" + ], + [ + "ce", + "Chechen", + "нохчийн мотт" + ], + [ + "ch", + "Chamorro", + "Chamoru" + ], + [ + "co", + "Corsican", + "corsu" + ], + [ + "cr", + "Cree", + "ᓀᐦᐃᔭᐍᐏᐣ" + ], + [ + "cs", + "Czech", + "čeština" + ], + [ + "cu", + "Old Church Slavonic", + "ѩзыкъ словѣньскъ" + ], + [ + "cv", + "Chuvash", + "чӑваш чӗлхи" + ], + [ + "cy", + "Welsh", + "Cymraeg" + ], + [ + "da", + "Danish", + "dansk" + ], + [ + "de", + "German", + "Deutsch" + ], + [ + "dv", + "Divehi", + "Dhivehi" + ], + [ + "dz", + "Dzongkha", + "རྫོང་ཁ" + ], + [ + "ee", + "Ewe", + "Eʋegbe" + ], + [ + "el", + "Greek", + "Ελληνικά" + ], + [ + "en", + "English", + "English" + ], + [ + "eo", + "Esperanto", + "Esperanto" + ], + [ + "es", + "Spanish", + "Español" + ], + [ + "et", + "Estonian", + "eesti" + ], + [ + "eu", + "Basque", + "euskara" + ], + [ + "fa", + "Persian", + "فارسی" + ], + [ + "ff", + "Fula", + "Fulfulde" + ], + [ + "fi", + "Finnish", + "suomi" + ], + [ + "fj", + "Fijian", + "Vakaviti" + ], + [ + "fo", + "Faroese", + "føroyskt" + ], + [ + "fr", + "French", + "Français" + ], + [ + "fy", + "Western Frisian", + "Frysk" + ], + [ + "ga", + "Irish", + "Gaeilge" + ], + [ + "gd", + "Scottish Gaelic", + "Gàidhlig" + ], + [ + "gl", + "Galician", + "galego" + ], + [ + "gu", + "Gujarati", + "ગુજરાતી" + ], + [ + "gv", + "Manx", + "Gaelg" + ], + [ + "ha", + "Hausa", + "هَوُسَ" + ], + [ + "he", + "Hebrew", + "עברית" + ], + [ + "hi", + "Hindi", + "हिन्दी" + ], + [ + "ho", + "Hiri Motu", + "Hiri Motu" + ], + [ + "hr", + "Croatian", + "Hrvatski" + ], + [ + "ht", + "Haitian", + "Kreyòl ayisyen" + ], + [ + "hu", + "Hungarian", + "magyar" + ], + [ + "hy", + "Armenian", + "Հայերեն" + ], + [ + "hz", + "Herero", + "Otjiherero" + ], + [ + "ia", + "Interlingua", + "Interlingua" + ], + [ + "id", + "Indonesian", + "Bahasa Indonesia" + ], + [ + "ie", + "Interlingue", + "Interlingue" + ], + [ + "ig", + "Igbo", + "Asụsụ Igbo" + ], + [ + "ii", + "Nuosu", + "ꆈꌠ꒿ Nuosuhxop" + ], + [ + "ik", + "Inupiaq", + "Iñupiaq" + ], + [ + "io", + "Ido", + "Ido" + ], + [ + "is", + "Icelandic", + "Íslenska" + ], + [ + "it", + "Italian", + "Italiano" + ], + [ + "iu", + "Inuktitut", + "ᐃᓄᒃᑎᑐᑦ" + ], + [ + "ja", + "Japanese", + "日本語" + ], + [ + "jv", + "Javanese", + "basa Jawa" + ], + [ + "ka", + "Georgian", + "ქართული" + ], + [ + "kg", + "Kongo", + "Kikongo" + ], + [ + "ki", + "Kikuyu", + "Gĩkũyũ" + ], + [ + "kj", + "Kwanyama", + "Kuanyama" + ], + [ + "kk", + "Kazakh", + "қазақ тілі" + ], + [ + "kl", + "Kalaallisut", + "kalaallisut" + ], + [ + "km", + "Khmer", + "ខេមរភាសា" + ], + [ + "kn", + "Kannada", + "ಕನ್ನಡ" + ], + [ + "ko", + "Korean", + "한국어" + ], + [ + "kr", + "Kanuri", + "Kanuri" + ], + [ + "ks", + "Kashmiri", + "कश्मीरी" + ], + [ + "ku", + "Kurmanji (Kurdish)", + "Kurmancî" + ], + [ + "kv", + "Komi", + "коми кыв" + ], + [ + "kw", + "Cornish", + "Kernewek" + ], + [ + "ky", + "Kyrgyz", + "Кыргызча" + ], + [ + "la", + "Latin", + "latine" + ], + [ + "lb", + "Luxembourgish", + "Lëtzebuergesch" + ], + [ + "lg", + "Ganda", + "Luganda" + ], + [ + "li", + "Limburgish", + "Limburgs" + ], + [ + "ln", + "Lingala", + "Lingála" + ], + [ + "lo", + "Lao", + "ລາວ" + ], + [ + "lt", + "Lithuanian", + "lietuvių kalba" + ], + [ + "lu", + "Luba-Katanga", + "Tshiluba" + ], + [ + "lv", + "Latvian", + "latviešu valoda" + ], + [ + "mg", + "Malagasy", + "fiteny malagasy" + ], + [ + "mh", + "Marshallese", + "Kajin M̧ajeļ" + ], + [ + "mi", + "Māori", + "te reo Māori" + ], + [ + "mk", + "Macedonian", + "македонски јазик" + ], + [ + "ml", + "Malayalam", + "മലയാളം" + ], + [ + "mn", + "Mongolian", + "Монгол хэл" + ], + [ + "mr", + "Marathi", + "मराठी" + ], + [ + "ms", + "Malay", + "Bahasa Melayu" + ], + [ + "mt", + "Maltese", + "Malti" + ], + [ + "my", + "Burmese", + "ဗမာစာ" + ], + [ + "na", + "Nauru", + "Ekakairũ Naoero" + ], + [ + "nb", + "Norwegian Bokmål", + "Norsk bokmål" + ], + [ + "nd", + "Northern Ndebele", + "isiNdebele" + ], + [ + "ne", + "Nepali", + "नेपाली" + ], + [ + "ng", + "Ndonga", + "Owambo" + ], + [ + "nl", + "Dutch", + "Nederlands" + ], + [ + "nn", + "Norwegian Nynorsk", + "Norsk Nynorsk" + ], + [ + "no", + "Norwegian", + "Norsk" + ], + [ + "nr", + "Southern Ndebele", + "isiNdebele" + ], + [ + "nv", + "Navajo", + "Diné bizaad" + ], + [ + "ny", + "Chichewa", + "chiCheŵa" + ], + [ + "oc", + "Occitan", + "occitan" + ], + [ + "oj", + "Ojibwe", + "ᐊᓂᔑᓈᐯᒧᐎᓐ" + ], + [ + "om", + "Oromo", + "Afaan Oromoo" + ], + [ + "or", + "Oriya", + "ଓଡ଼ିଆ" + ], + [ + "os", + "Ossetian", + "ирон æвзаг" + ], + [ + "pa", + "Panjabi", + "ਪੰਜਾਬੀ" + ], + [ + "pi", + "Pāli", + "पाऴि" + ], + [ + "pl", + "Polish", + "Polski" + ], + [ + "ps", + "Pashto", + "پښتو" + ], + [ + "pt", + "Portuguese", + "Português" + ], + [ + "qu", + "Quechua", + "Runa Simi" + ], + [ + "rm", + "Romansh", + "rumantsch grischun" + ], + [ + "rn", + "Kirundi", + "Ikirundi" + ], + [ + "ro", + "Romanian", + "Română" + ], + [ + "ru", + "Russian", + "Русский" + ], + [ + "rw", + "Kinyarwanda", + "Ikinyarwanda" + ], + [ + "sa", + "Sanskrit", + "संस्कृतम्" + ], + [ + "sc", + "Sardinian", + "sardu" + ], + [ + "sd", + "Sindhi", + "सिन्धी" + ], + [ + "se", + "Northern Sami", + "Davvisámegiella" + ], + [ + "sg", + "Sango", + "yângâ tî sängö" + ], + [ + "si", + "Sinhala", + "සිංහල" + ], + [ + "sk", + "Slovak", + "slovenčina" + ], + [ + "sl", + "Slovenian", + "slovenščina" + ], + [ + "sn", + "Shona", + "chiShona" + ], + [ + "so", + "Somali", + "Soomaaliga" + ], + [ + "sq", + "Albanian", + "Shqip" + ], + [ + "sr", + "Serbian", + "српски језик" + ], + [ + "ss", + "Swati", + "SiSwati" + ], + [ + "st", + "Southern Sotho", + "Sesotho" + ], + [ + "su", + "Sundanese", + "Basa Sunda" + ], + [ + "sv", + "Swedish", + "Svenska" + ], + [ + "sw", + "Swahili", + "Kiswahili" + ], + [ + "ta", + "Tamil", + "தமிழ்" + ], + [ + "te", + "Telugu", + "తెలుగు" + ], + [ + "tg", + "Tajik", + "тоҷикӣ" + ], + [ + "th", + "Thai", + "ไทย" + ], + [ + "ti", + "Tigrinya", + "ትግርኛ" + ], + [ + "tk", + "Turkmen", + "Türkmen" + ], + [ + "tl", + "Tagalog", + "Wikang Tagalog" + ], + [ + "tn", + "Tswana", + "Setswana" + ], + [ + "to", + "Tonga", + "faka Tonga" + ], + [ + "tr", + "Turkish", + "Türkçe" + ], + [ + "ts", + "Tsonga", + "Xitsonga" + ], + [ + "tt", + "Tatar", + "татар теле" + ], + [ + "tw", + "Twi", + "Twi" + ], + [ + "ty", + "Tahitian", + "Reo Tahiti" + ], + [ + "ug", + "Uyghur", + "ئۇيغۇرچە‎" + ], + [ + "uk", + "Ukrainian", + "Українська" + ], + [ + "ur", + "Urdu", + "اردو" + ], + [ + "uz", + "Uzbek", + "Ўзбек" + ], + [ + "ve", + "Venda", + "Tshivenḓa" + ], + [ + "vi", + "Vietnamese", + "Tiếng Việt" + ], + [ + "vo", + "Volapük", + "Volapük" + ], + [ + "wa", + "Walloon", + "walon" + ], + [ + "wo", + "Wolof", + "Wollof" + ], + [ + "xh", + "Xhosa", + "isiXhosa" + ], + [ + "yi", + "Yiddish", + "ייִדיש" + ], + [ + "yo", + "Yoruba", + "Yorùbá" + ], + [ + "za", + "Zhuang", + "Saɯ cueŋƅ" + ], + [ + "zh", + "Chinese", + "中文" + ], + [ + "zu", + "Zulu", + "isiZulu" + ], + [ + "ast", + "Asturian", + "Asturianu" + ], + [ + "ckb", + "Sorani (Kurdish)", + "سۆرانی" + ], + [ + "cnr", + "Montenegrin", + "crnogorski" + ], + [ + "jbo", + "Lojban", + "la .lojban." + ], + [ + "kab", + "Kabyle", + "Taqbaylit" + ], + [ + "kmr", + "Kurmanji (Kurdish)", + "Kurmancî" + ], + [ + "ldn", + "Láadan", + "Láadan" + ], + [ + "lfn", + "Lingua Franca Nova", + "lingua franca nova" + ], + [ + "sco", + "Scots", + "Scots" + ], + [ + "sma", + "Southern Sami", + "Åarjelsaemien Gïele" + ], + [ + "smj", + "Lule Sami", + "Julevsámegiella" + ], + [ + "szl", + "Silesian", + "ślůnsko godka" + ], + [ + "tok", + "Toki Pona", + "toki pona" + ], + [ + "zba", + "Balaibalan", + "باليبلن" + ], + [ + "zgh", + "Standard Moroccan Tamazight", + "ⵜⴰⵎⴰⵣⵉⵖⵜ" + ] + ], }; const json = JSON.stringify(state); From 1feffe43265b1a3d46b70ee72330b6ae04818f8a Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 14 Oct 2023 14:59:59 +0200 Subject: [PATCH 11/14] Ignore hashtag history if undefined --- app/javascript/flavours/glitch/components/hashtag.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/flavours/glitch/components/hashtag.jsx b/app/javascript/flavours/glitch/components/hashtag.jsx index 9821cf1858..7e87440c6f 100644 --- a/app/javascript/flavours/glitch/components/hashtag.jsx +++ b/app/javascript/flavours/glitch/components/hashtag.jsx @@ -63,7 +63,7 @@ export const ImmutableHashtag = ({ hashtag }) => ( to={`/tags/${hashtag.get('name')}`} people={hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1} // @ts-expect-error - history={hashtag.get('history').reverse().map((day) => day.get('uses')).toArray()} + history={hashtag.get('history')?.reverse().map((day) => day.get('uses')).toArray()} /> ); @@ -82,7 +82,7 @@ const Hashtag = ({ name, href, to, people, uses, history, className, description {description ? ( {description} ) : ( - typeof people !== 'undefined' ? : + !isNaN(people) && (typeof people !== 'undefined' ? : ) )}
@@ -92,7 +92,7 @@ const Hashtag = ({ name, href, to, people, uses, history, className, description )} - {withGraph && ( + {withGraph && typeof history !== 'undefined' && (
0)}> From aa0801e1f32997d79f5fef2ba8c0400367c820e1 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 18 Oct 2023 01:05:23 +0200 Subject: [PATCH 12/14] Remove explore prompt --- .../flavours/glitch/features/home_timeline/index.jsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/javascript/flavours/glitch/features/home_timeline/index.jsx b/app/javascript/flavours/glitch/features/home_timeline/index.jsx index ac378291e5..26e9fbb4bf 100644 --- a/app/javascript/flavours/glitch/features/home_timeline/index.jsx +++ b/app/javascript/flavours/glitch/features/home_timeline/index.jsx @@ -191,10 +191,6 @@ class HomeTimeline extends PureComponent { banners.push(); } - if (tooSlow) { - banners.push(); - } - return ( Date: Wed, 18 Oct 2023 01:11:56 +0200 Subject: [PATCH 13/14] Add domain to acct display in sidebar --- .../glitch/features/compose/components/navigation_bar.jsx | 2 ++ .../flavours/glitch/styles/components/drawer.scss | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx index 988dfd30c2..c3e11892c2 100644 --- a/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx @@ -10,6 +10,7 @@ import Permalink from 'flavours/glitch/components/permalink'; import { profileLink } from 'flavours/glitch/utils/backend_links'; import ActionBar from './action_bar'; +import initialState from 'mastodon/initial_state'; export default class NavigationBar extends ImmutablePureComponent { @@ -30,6 +31,7 @@ export default class NavigationBar extends ImmutablePureComponent {
{this.props.account.get('display_name')}
@{this.props.account.get('acct')} + @{initialState.meta.domain}
diff --git a/app/javascript/flavours/glitch/styles/components/drawer.scss b/app/javascript/flavours/glitch/styles/components/drawer.scss index f2fa38fac2..c1e2075354 100644 --- a/app/javascript/flavours/glitch/styles/components/drawer.scss +++ b/app/javascript/flavours/glitch/styles/components/drawer.scss @@ -112,11 +112,14 @@ .acct { display: block; - color: $secondary-text-color; - font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + + strong { + color: $secondary-text-color; + font-weight: 500; + } } } From 3962700726f58d946d5a6eed9e9bea63b8c2eb04 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 23 Oct 2023 12:12:46 +0200 Subject: [PATCH 14/14] Fix 24:xx timestamps --- .../flavours/glitch/components/edited_timestamp/index.jsx | 2 +- .../glitch/features/status/components/detailed_status.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx index 3dbac58b54..8b67ace2dd 100644 --- a/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx +++ b/app/javascript/flavours/glitch/components/edited_timestamp/index.jsx @@ -66,7 +66,7 @@ class EditedTimestamp extends PureComponent { return ( ); diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx b/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx index 1770436ae7..57664c7807 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx @@ -334,7 +334,7 @@ class DetailedStatus extends ImmutablePureComponent {
- + {edited}{visibilityLink}{applicationLink}{reblogLink} · {favouriteLink}