diff --git a/.containerignore b/.containerignore new file mode 100644 index 0000000..ae02570 --- /dev/null +++ b/.containerignore @@ -0,0 +1 @@ +release/ \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..674a67d --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,17 @@ +name: 'Close stale issues' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + stale-issue-message: 'This issue is stale because it has been open 150 days with no activity. Remove stale label or comment or this will be closed in 14 days.' + days-before-issue-stale: 150 + days-before-issue-close: 14 + days-before-pr-stale: -1 + days-before-pr-close: -1 + exempt-issue-labels: 'longterm,enhancement,parity-with-android,prio:medium,prio:high,electron issue,encrypted room search,build infrastructure' diff --git a/Containerfile.debian b/Containerfile.debian new file mode 100644 index 0000000..86614ba --- /dev/null +++ b/Containerfile.debian @@ -0,0 +1,28 @@ +ARG NODE_VERSION +FROM docker.io/node:${NODE_VERSION}-bookworm + +RUN apt-get -qq update && apt-get -qq install --no-install-recommends -y \ + curl \ + g++ \ + gcc \ + git \ + jq \ + libarchive-tools \ + libsecret-1-dev \ + libsqlcipher-dev \ + libssl-dev \ + make \ + openssl \ + pkg-config \ + python3 \ + rpm \ + tcl \ + vim +RUN ln -s /usr/bin/python3 /usr/bin/python + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal + +WORKDIR /project diff --git a/Containerfile.fedora b/Containerfile.fedora new file mode 100644 index 0000000..d1074da --- /dev/null +++ b/Containerfile.fedora @@ -0,0 +1,22 @@ +FROM docker.io/fedora:40 + +RUN dnf install -y openssl openssl-devel cargo llvm libsecret libsecret-devel sqlcipher sqlcipher-devel g++ ruby-devel gcc make rpm-build libffi-devel tcl libxcrypt-compat pkgconf perl + +# node setup +ARG NODE_VERSION +RUN mkdir -p /usr/local/n +RUN mkdir -p /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share +RUN curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n +RUN bash n ${NODE_VERSION} +RUN npm install -g n +RUN npm install -g yarn +RUN npm install -g node-gyp +RUN gem install --no-user-install --no-document fpm +RUN ln -s /usr/bin/python3 /usr/bin/python + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal + +WORKDIR /project diff --git a/Containerfile.windows b/Containerfile.windows new file mode 100644 index 0000000..0c0776a --- /dev/null +++ b/Containerfile.windows @@ -0,0 +1,13 @@ +ARG CONTAINER_IMAGE_DEBIAN +FROM ${CONTAINER_IMAGE_DEBIAN}:latest + +RUN dpkg --add-architecture i386 && apt-get update && apt-get install --no-install-recommends -y \ + wine \ + wine32 \ + wine64 \ + libwine \ + libwine:i386 \ + fonts-wine \ + zip + +WORKDIR /project \ No newline at end of file diff --git a/FEATURES.md b/FEATURES.md new file mode 100644 index 0000000..05b8736 --- /dev/null +++ b/FEATURES.md @@ -0,0 +1,28 @@ +# Features and changes compared to upstream + +Note that this list may be incomplete or outdated. + + +## General UI + +... TODO Schildi theme? + + +## Chat overview ("room list") + +- Unified room list instead of separating DMs and groups (TODO: setting) +- Do not exclude currently selected room when updating room sort order +- Do not force muted rooms to be sorted at the bottom +- Hide reactions from room previews +- Show unread state of muted rooms +- Increase default visible tiles before collapsing each section +- Include DMs in space unread counts +- Show space overview rather then jumping to last opened room when switching space +- Do not add spaces to recently opened rooms list ("breadcrumbs") + + +## Conversation screen + +- Render captions +- Allow sending freeform reactions +- Less restrictive width limit for rendering text reactions diff --git a/Makefile b/Makefile index 95fd274..ab3280b 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,22 @@ .PHONY: all setup regenerate-i18n web desktop-common linux debian rpm pacman local-pkgbuild local-pkgbuild-install windows windows-portable .PHONY: web-release debian-release rpm-release pacman-release windows-setup-release windows-unpacked-release windows-portable-release windows-release .PHONY: macos-common macos macos-mas macos-release macos-mas-release icns -.PHONY: clean +.PHONY: container-build-debian container-build-fedora container-build-windows +.PHONY: container-web-release container-debian-release container-rpm-release container-appimage-release container-windows-release container-release container-local-pkgbuild +.PHONY: clean undo_setup fixup +.PHONY: fix_yarn_cache CFGDIR ?= configs/sc all: web YARN ?= yarnpkg +CONTAINER_ENGINE ?= podman +NODE_VERSION ?= 22 VERSION := $(shell grep version element-desktop/package.json | sed 's|.*: \"\(.*\)\",|\1|') -WEB_APP_NAME := $(shell grep '"name"' element-web/package.json | head -n 1 | sed 's|.*: \"\(.*\)\",|\1|') +#WEB_APP_NAME := $(shell grep '"name"' element-web/package.json | head -n 1 | sed 's|.*: \"\(.*\)\",|\1|') +WEB_APP_NAME := element DESKTOP_APP_NAME := $(shell grep '"name"' element-desktop/package.json | head -n 1 | sed 's|.*: \"\(.*\)\",|\1|') PRODUCT_NAME := $(shell grep '"productName"' element-desktop/package.json | sed 's|.*: \"\(.*\)\",|\1|') @@ -32,6 +38,10 @@ OUT_WIN64_PORTABLE_BETTER_NAME := $(PRODUCT_NAME)_win-portable_v$(VERSION) OUT_MACOS := $(DESKTOP_OUT)/$(PRODUCT_NAME)-$(VERSION)-universal.dmg OUT_MACOS_MAS := $(DESKTOP_OUT)/mas-universal/$(PRODUCT_NAME).app +CONTAINER_IMAGE_DEBIAN := schildichat-desktop-containerbuild-debian +CONTAINER_IMAGE_FEDORA := schildichat-desktop-containerbuild-fedora +CONTAINER_IMAGE_WINDOWS := schildichat-desktop-containerbuild-windows + RELEASE_DIR := release CURRENT_RELEASE_DIR := $(RELEASE_DIR)/$(VERSION) @@ -68,7 +78,7 @@ web: setup desktop-common: web $(YARN) --cwd element-desktop run fetch --cfgdir '' - SQLCIPHER_STATIC=1 $(YARN) --cwd element-desktop run build:native + SQLCIPHER_BUNDLED=1 $(YARN) --cwd element-desktop run build:native macos-common: web icns $(YARN) --cwd element-desktop run fetch --cfgdir '' @@ -153,16 +163,61 @@ macos-mas-release: macos-mas mkdir -p $(CURRENT_RELEASE_DIR) cp $(OUT_MACOS_MAS) $(CURRENT_RELEASE_DIR) +container-build-debian: + $(CONTAINER_ENGINE) build --security-opt seccomp=unconfined --security-opt label=disable -t $(CONTAINER_IMAGE_DEBIAN) -f Containerfile.debian --build-arg NODE_VERSION=$(NODE_VERSION) . + +container-build-fedora: + $(CONTAINER_ENGINE) build --security-opt seccomp=unconfined --security-opt label=disable -t $(CONTAINER_IMAGE_FEDORA) -f Containerfile.fedora --build-arg NODE_VERSION=$(NODE_VERSION) . + +container-build-windows: container-build-debian + $(CONTAINER_ENGINE) build --security-opt seccomp=unconfined --security-opt label=disable -t $(CONTAINER_IMAGE_WINDOWS) -f Containerfile.windows --build-arg CONTAINER_IMAGE_DEBIAN=$(CONTAINER_IMAGE_DEBIAN) . + +container-web-release: container-build-debian + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_DEBIAN):latest make web-release + +container-debian-release: container-build-debian + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_DEBIAN):latest make debian-release + +container-rpm-release: container-build-fedora + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_FEDORA):latest make rpm-release + +container-appimage-release: container-build-debian + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_DEBIAN):latest make appimage-release + +container-windows-release: container-build-windows + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_WINDOWS):latest make windows-release + +container-release: container-build-windows #container-build-fedora + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_WINDOWS):latest make web-release debian-release appimage-release rpm-release windows-setup-release windows-portable-release + #$(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_FEDORA):latest make rpm-release + +linux-container-release: container-build-debian + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_DEBIAN):latest make web-release debian-release appimage-release rpm-release + +container-local-pkgbuild: container-build-debian + $(CONTAINER_ENGINE) run --rm -ti -v $(PWD):/project --security-opt seccomp=unconfined --security-opt label=disable $(CONTAINER_IMAGE_DEBIAN):latest make local-pkgbuild + bom.lock: element-desktop/yarn.lock element-web/yarn.lock matrix-js-sdk/yarn.lock matrix-react-sdk/yarn.lock ./build-bom.sh bom: bom.lock +fix_yarn_cache: + $(YARN) cache list || $(YARN) cache clean + clean: $(YARN) --cwd matrix-js-sdk clean $(YARN) --cwd matrix-react-sdk clean $(YARN) --cwd element-web clean $(YARN) --cwd element-desktop clean - rm -f element-desktop/webapp + rm -f element-desktop/webapp || true rm -rf element-web/dist rm -rf local-pkgbuild rm -f bom.lock + +undo_setup: + rm -rf element-desktop/node_modules element-web/node_modules matrix-react-sdk/node_modules matrix-js-sdk/node_modules i18n-helper/node_modules element-desktop/.hak + +fixup: undo_setup fix_yarn_cache + make setup + make clean + make setup diff --git a/README.md b/README.md index f4d437d..b34abad 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,10 @@ # SchildiChat Web/Desktop -SchildiChat Web/Desktop is a fork of Element [Web](https://github.com/vector-im/element-web)/[Desktop](https://github.com/vector-im/element-desktop). +SchildiChat Web/Desktop is a fork of Element [Web](https://github.com/element-hq/element-web)/[Desktop](https://github.com/element-hq/element-desktop). -The most important changes of SchildiChat Web/Desktop compared to Element Web/Desktop are: -- Customizable room list style (compact single line, intermediate and roomy with two line preview) -- Option to show direct and group chats in a combined list -- Improved theming options -- Message bubbles -- … and more! -Desktop downloads with installation instructions are listed on our website: [https://schildi.chat/desktop](https://schildi.chat/desktop) -Hosted web variant: [https://app.schildi.chat/](https://app.schildi.chat/) -Feel free to [join the discussion on matrix](https://matrix.to/#/#schildichat-web:matrix.org). - - - -
-Public key used to sign the Debian packages - -``` -pub rsa4096 2020-12-08 [SC] - 560BB70DA86A6633A39CEC6023358905FE294D01 -uid Super apt repo key -sub rsa4096 2020-12-08 [E] -``` - -
+## Old build instructions, to be revised in the future ## Building SchildiChat Web/Desktop @@ -54,7 +32,7 @@ The following are the dependencies required to build SchildiChat Web/Desktop on ``` # apt install vim curl git make gcc g++ python jq libsqlcipher-dev pkg-config libsecret-1-dev libarchive-tools openssl libssl-dev tcl -# curl -sL https://deb.nodesource.com/setup_14.x | bash - +# curl -sL https://deb.nodesource.com/setup_16.x | bash - # apt update # apt install nodejs @@ -95,7 +73,7 @@ To notarize a build with Apple set `NOTARIZE_APPLE_ID` to your AppleID and set t As already noted above, **`master` contains the latest release** and **`sc` is the development branch**! ``` -git clone -b master --recurse-submodules https://github.com/SchildiChat/schildichat-desktop.git +git clone -b lite --recurse-submodules https://github.com/SchildiChat/schildichat-desktop.git cd schildichat-desktop make setup # optional step if using the other make targets ``` @@ -135,3 +113,13 @@ your-deploy-%: CFGDIR := $(YOUR_CFGDIR) your-deploy-web: web rsync --info=progress2 -rup --del element-web/webapp/ you@yourwebserver:/the/folder/served/for/schildi/ ``` + + +# Merge helpers + +## Add upstream repo remotes + +``` +source merge_helpers.sh +forall_repos add_upstream +``` diff --git a/apply_patches.sh b/apply_patches.sh new file mode 100755 index 0000000..8d581f9 --- /dev/null +++ b/apply_patches.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -e + +mydir="$(dirname "$(realpath "$0")")" + +print_section() { + local msg="$1" + echo "##############################################################" + echo "# $msg" + echo "##############################################################" +} + +pushd "$mydir" > /dev/null + +source ./merge_helpers.sh + +# Apply our patches +print_section "Apply patches to matrix-js-sdk" +apply_patches matrix-js-sdk +print_section "Apply patches to matrix-react-sdk" +apply_patches matrix-react-sdk +#print_section "Apply patches to element-web" +#apply_patches element-web +print_section "Apply patches to element-desktop" +apply_patches element-desktop + +# Automatic adjustments +#print_section "Apply i18n" +#automatic_i18n_adjustment +print_section "Apply automatic package adjustments" +automatic_packagejson_adjustment + +# Automatic theme and icon update +print_section "Apply automatic theme updates" +./theme.sh y +print_section "Generate icons" +./graphics/icon_gen.sh y + +popd > /dev/null diff --git a/configs/sc/config.json b/configs/sc/config.json index 2916dee..0402a78 100644 --- a/configs/sc/config.json +++ b/configs/sc/config.json @@ -1,6 +1,11 @@ { "update_base_url": null, - "default_server_name": "matrix.org", + "default_server_config": { + "m.homeserver": { + "base_url": "https://matrix-client.matrix.org", + "server_name": "matrix.org" + } + }, "brand": "SchildiChat", "integrations_ui_url": "https://scalar.vector.im/", "integrations_rest_url": "https://scalar.vector.im/api", @@ -11,10 +16,13 @@ "https://scalar-staging.vector.im/api", "https://scalar-staging.riot.im/scalar/api" ], - "showLabsSettings": true, - "roomDirectory": { + "show_labs_settings": true, + "room_directory": { "servers": [ - "matrix.org" + "matrix.org", + "gitter.im", + "libera.chat", + "schildi.chat" ] }, "enable_presence_by_hs_url": { diff --git a/deploy/create-github-release.sh b/deploy/create-github-release.sh index b93f7d5..63c327c 100755 --- a/deploy/create-github-release.sh +++ b/deploy/create-github-release.sh @@ -10,12 +10,16 @@ set -e version="$1" releasepath="$2" -github_api_token=`cat ~/githubtoken` +if [ -z "$GITHUB_API_TOKEN" ]; then + github_api_token=`cat ~/githubtoken` +else + github_api_token="$GITHUB_API_TOKEN" +fi release_notes_file="/tmp/scrn.md" owner=SchildiChat repo=schildichat-desktop -target=master +target=lite # Define variables GH_API="https://api.github.com" @@ -37,7 +41,7 @@ json_string=`jq -n --arg tag "v$version" --arg target "$target" --arg body "$rel name: $tag, body: $body, draft: true, - prerelease: false + prerelease: true }'` # echo "$json_string" res=`echo "$json_string" | curl -sH "$AUTH" $GH_REPO/releases -d @-` diff --git a/deploy/update-flathub.sh b/deploy/update-flathub.sh index 31c4ce5..7451aec 100755 --- a/deploy/update-flathub.sh +++ b/deploy/update-flathub.sh @@ -20,8 +20,11 @@ debdate=$(date +%Y-%m-%d -r $debpath) pushd "$repopath" > /dev/null git fetch +git checkout master git reset --hard origin/master +git checkout -B "release-v$version" + yamlFile="chat.schildi.desktop.yaml" xmlFile="chat.schildi.desktop.metainfo.xml" @@ -33,8 +36,8 @@ sed -i "s|^\s\s$| \n /dev/null -echo "Release v$version published on flathub!" +echo "Release v$version published on flathub, now merge that branch as PR: https://github.com/flathub/chat.schildi.desktop/" diff --git a/element-desktop b/element-desktop index bb09b97..96aa172 160000 --- a/element-desktop +++ b/element-desktop @@ -1 +1 @@ -Subproject commit bb09b97684db6927539a57ac05356bb7b6dffad3 +Subproject commit 96aa1725d46fe9858108eff051711838da2d60fc diff --git a/element-web b/element-web index 2a51d27..60754c1 160000 --- a/element-web +++ b/element-web @@ -1 +1 @@ -Subproject commit 2a51d277c7bc83b1b001d1aae50574bfb812d488 +Subproject commit 60754c17d92a1e8d9790dfb476f703949b60ce47 diff --git a/flake.lock b/flake.lock index 271a3d0..d010aa2 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1633901457, - "narHash": "sha256-GNJLwKENqEA4xlzkWI76VLHBAua4LUIlTeeiH4FR7Gc=", + "lastModified": 1699380656, + "narHash": "sha256-H9kQH3J2Z15Ady3zVQsN/tXv8qnRr+p1B0eUkR1bKfE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f358794824b4595d77fec93732485d329ed7b0e0", + "rev": "03e7a22654c44489a0a70ea0e237de3e512cd8a6", "type": "github" }, "original": { diff --git a/generate_changelog.sh b/generate_changelog.sh new file mode 100755 index 0000000..1e65601 --- /dev/null +++ b/generate_changelog.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +set -e + +mydir="$(dirname "$(realpath "$0")")" + +pushd "$mydir" > /dev/null + +source ./merge_helpers.sh + +# Check branch +check_branch $branch +forall_repos check_branch $branch + +# Ensure clean git state +forall_repos check_clean_git + +# Fetch upstream +forall_repos git fetch origin > /dev/null 2>/dev/null +forall_repos git fetch upstream > /dev/null 2>/dev/null + +( + # Add new line below git log: https://unix.stackexchange.com/a/345558 + + get_latest_upstream_tag + forelement_repos git log --pretty=format:"- %s" "sc" "^$latest_upstream_tag" "^master" \ + | printf '%s\n' "$(cat)" \ + | sed "s|Merge tag '\\(.*\\)' into sc.*|Update codebase to Element \1|" \ + | sed "s|Merge tag '\\(.*\\)' into merge.*|Update codebase to Element \1|" + + get_current_mxsdk_tags + + pushd "matrix-js-sdk" > /dev/null + git log --pretty=format:"- %s" "sc" "^$current_mxjssdk_tag" "^master" \ + | printf '%s\n' "$(cat)" \ + | grep -v "Merge .*tag" + popd > /dev/null + + pushd "matrix-react-sdk" > /dev/null + git log --pretty=format:"- %s" "sc" "^$current_mxreactsdk_tag" "^master" \ + | printf '%s\n' "$(cat)" \ + | grep -v "Merge .*tag" + popd > /dev/null +) \ + | grep -v "Automatic i18n reversion" \ + | grep -v "Automatic package.json reversion" \ + | grep -v "Merge .*branch" \ + | grep -v "Automatic theme update" \ + | grep -v "Automatic package.json adjustment" \ + | grep -v "Automatic i18n adjustment" \ + | grep -v "Update version to .*-sc\\..*" \ + | grep -v "\\.sh" \ + | grep -v "\\.md" \ + | grep -v "Added translation using Weblate" \ + | grep -v "Translated using Weblate" \ + | grep -v "weblate/sc" \ + | grep -v "\\[.*merge.*\\]" \ + | awk '!seen[$0]++' `# https://stackoverflow.com/a/1444448` \ + || echo "No significant changes since the last stable release" + +popd > /dev/null diff --git a/generate_patches.sh b/generate_patches.sh new file mode 100755 index 0000000..4a2771d --- /dev/null +++ b/generate_patches.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +mydir="$(dirname "$(realpath "$0")")" +pushd "$mydir" > /dev/null + +source ./merge_helpers.sh + +persist_patches() { + local repo="$(realpath "$1")" + local patch_dir="$SCHILDI_ROOT/patches/$(basename "$1")" + if [ ! -d "$repo" ]; then + echo "Unknown repo: $repo" + return 1 + fi + + pushd "$repo" + + if [ -d "$patch_dir" ]; then + echo "Clearing old patches..." + rm "$patch_dir"/* + else + echo "Creating new patch dir $patch_dir..." + mkdir "$patch_dir" + fi + echo "Creating new patches" + git format-patch -k upstream/master.. -o "$patch_dir" + echo "Clearing automated commits from patches" + find "$patch_dir" -name "*-Automatic-package.json-adjustment.patch" -exec rm {} \; + find "$patch_dir" -name "*-Automatic-icon-update.patch" -exec rm {} \; + find "$patch_dir" -name "*-Automatic-theme-update.patch" -exec rm {} \; + find "$patch_dir" -name "*-Automatic-setup-commit.patch" -exec rm {} \; + find "$patch_dir" -name "*-Update-version-to-*.patch" -exec rm {} \; + popd +} + +persist_patches element-desktop +#persist_patches element-web +persist_patches matrix-react-sdk +persist_patches matrix-js-sdk + +popd > /dev/null diff --git a/graphics/feature_image.svg b/graphics/feature_image.svg new file mode 100644 index 0000000..acb9ffc --- /dev/null +++ b/graphics/feature_image.svg @@ -0,0 +1,815 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/feature_image_transparent.svg b/graphics/feature_image_transparent.svg new file mode 100644 index 0000000..c241206 --- /dev/null +++ b/graphics/feature_image_transparent.svg @@ -0,0 +1,784 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/ic_launcher_sc.svg b/graphics/ic_launcher_sc.svg new file mode 100644 index 0000000..6dee8d6 --- /dev/null +++ b/graphics/ic_launcher_sc.svg @@ -0,0 +1,2243 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/icon_gen.sh b/graphics/icon_gen.sh new file mode 100755 index 0000000..d6938d1 --- /dev/null +++ b/graphics/icon_gen.sh @@ -0,0 +1,97 @@ +#!/bin/bash + +set -e + +mydir="$(dirname "$(realpath "$0")")" +automatic_commit="$1" + +SCHILDI_ROOT="$mydir/.." +source "$SCHILDI_ROOT/merge_helpers.sh" + +if [[ "$automatic_commit" == [Yy]* ]]; then + forelement_repos check_clean_git +fi + + +export_rect() { + w="$1" + h="$2" + in="$3" + out="$4" + inkscape -w "$w" -h "$h" --export-filename="$out" -C "$in" +} +export_square() { + size="$1" + in="$2" + out="$3" + export_rect "$1" "$size" "$in" "$out" +} + +repo_dir="$SCHILDI_ROOT/element-web" +base_out="$repo_dir/res/vector-icons" + +for i in 1024 120 150 152 180 24 300 44 48 50 76 88; do + export_square "$i" "$mydir/ic_launcher_sc.svg" "$base_out/$i.png" +done + +for i in 114 120 144 152 180 57 60 72 76; do + export_square "$i" "$mydir/store_icon.svg" "$base_out/apple-touch-icon-$i.png" +done + +for i in 150 310 70; do + export_square "$i" "$mydir/store_icon.svg" "$base_out/mstile-$i.png" +done + +# TODO fix measures of input to have correct measures for export here again +export_rect 1024 500 "$mydir/feature_image_transparent.svg" "$base_out/1240x600.png" +export_rect 512 250 "$mydir/feature_image_transparent.svg" "$base_out/620x300.png" +export_rect 256 125 "$mydir/feature_image.svg" "$base_out/mstile-310x150.png" + +magick "$base_out/48.png" "$base_out/favicon.ico" +rm "$base_out/48.png" # this was only created for favicon.ico + +for f in "$base_out"/*.png; do + pngcrush -ow "$f" +done + + +cp "$mydir/ic_launcher_sc.svg" "$repo_dir/res/themes/element/img/logos/element-logo.svg" + + +repo_dir="$SCHILDI_ROOT/element-desktop" +base_out="$repo_dir/res/img" + +export_square 256 "$mydir/ic_launcher_sc.svg" "$base_out/element.png" + +magick "$base_out/element.png" "$base_out/element.ico" + +for f in "$base_out"/*.png; do + pngcrush -ow "$f" +done + + + + +base_out="$repo_dir/build" + +for i in 16 24 48 64 96 128 256 512 1024; do + export_square "$i" "$mydir/ic_launcher_sc.svg" "$base_out/icons/$i"x"$i.png" +done + +export_square "320" "$mydir/ic_launcher_sc.svg" "$base_out/install-spinner.png" +pngcrush "$base_out/install-spinner.png" +magick "$base_out/install-spinner.png" "$base_out/install-spinner.gif" +rm "$base_out/install-spinner.png" + +magick "$base_out/icons/256x256.png" "$base_out/icon.ico" +magick "$base_out/icons/1024x1024.png" "$base_out/icon.icns" +rm "$base_out/icons/1024x1024.png" + +for f in "$base_out/icons"/*.png; do + pngcrush -ow "$f" +done + + +if [[ "$automatic_commit" == [Yy]* ]]; then + forelement_repos commit_if_dirty "Automatic icon update" +fi diff --git a/graphics/store_icon.svg b/graphics/store_icon.svg new file mode 120000 index 0000000..30278a9 --- /dev/null +++ b/graphics/store_icon.svg @@ -0,0 +1 @@ +ic_launcher_sc.svg \ No newline at end of file diff --git a/hard_reset_repos.sh b/hard_reset_repos.sh new file mode 100755 index 0000000..4e17e2a --- /dev/null +++ b/hard_reset_repos.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +mydir="$(dirname "$(realpath "$0")")" + +cd "$mydir" + +source ./merge_helpers.sh + +# Note: this doesn't delete files starting with a dot, +# and in particular not the '.git' directory, which we +# want to keep +forall_repos bash -c 'rm -rf *' +forall_repos git reset HEAD --hard diff --git a/i18n-helper/index.js b/i18n-helper/index.js index f226e47..11e3fc4 100644 --- a/i18n-helper/index.js +++ b/i18n-helper/index.js @@ -35,7 +35,13 @@ function writeStrings(p, strings) { let strings = readStrings(p); for (const key of Object.keys(strings)) { - strings[key] = strings[key].replace(/Element/g, "SchildiChat").replace(/element\.io/g, "schildi.chat"); + strings[key] = strings[key] + .replace(/Element/g, "SchildiChat") + .replace(/element\.io/g, "schildi.chat") + + // It's still Element Call + .replace(/SchildiChat Call/g, "Element Call") + .replace(/SchildiChat-Call/g, "Element-Call"); } if (overlayPath) { diff --git a/i18n-overlays/element-desktop/hu.json b/i18n-overlays/element-desktop/hu.json index 0967ef4..8598663 100644 --- a/i18n-overlays/element-desktop/hu.json +++ b/i18n-overlays/element-desktop/hu.json @@ -1 +1,3 @@ -{} +{ + "Show": "Mutat" +} diff --git a/i18n-overlays/element-desktop/ja.json b/i18n-overlays/element-desktop/ja.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/i18n-overlays/element-desktop/ja.json @@ -0,0 +1 @@ +{} diff --git a/i18n-overlays/element-web/en_EN.json b/i18n-overlays/element-web/en_EN.json index 0967ef4..e707661 100644 --- a/i18n-overlays/element-web/en_EN.json +++ b/i18n-overlays/element-web/en_EN.json @@ -1 +1,3 @@ -{} +{ + "Welcome to SchildiChat": "Welcome to SchildiChat" +} diff --git a/i18n-overlays/element-web/ja.json b/i18n-overlays/element-web/ja.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/i18n-overlays/element-web/ja.json @@ -0,0 +1 @@ +{} diff --git a/i18n-overlays/matrix-react-sdk/cs.json b/i18n-overlays/matrix-react-sdk/cs.json index 861e944..a0816fc 100644 --- a/i18n-overlays/matrix-react-sdk/cs.json +++ b/i18n-overlays/matrix-react-sdk/cs.json @@ -21,8 +21,8 @@ "MXID": "MXID", "In group chats": "Ve skupinových chatech", "In public rooms": "Ve veřejných místnostech", - "All rooms you're in will appear in Home.": "Všechny místnosti, ve kterých se nacházíte, se zobrazí v domovském zobrazení.", - "Show all rooms in Home": "Ukázat všechny místnosti v domovském zobrazení", + "All rooms you're in will appear in Home.": "Všechny místnosti, ve kterých se nacházíte, se zobrazí v Úvodu.", + "Show all rooms in Home": "Zobrazit všechny místnosti v Úvodu", "Show people in spaces": "Ukázat lidi v prostorech", "Show notification badges for People in Spaces": "Zobrazit odznaky oznámení pro Lidé v prostorech", "Return to the room previously opened in a space": "Návrat do dříve otevřené místnosti v prostoru", @@ -50,5 +50,6 @@ "Mixed": "Smíšené", "Sound pack": "Balíček zvuků", "Schildi: Softer sounds for reduced anxiety": "Schildi: Jemnější zvuky pro snížení úzkosti", - "Classic: The same sharp sounds as Element": "Klasické: Stejně ostré zvuky jako Element" + "Classic: The same sharp sounds as Element": "Klasické: Stejně ostré zvuky jako Element", + "React with \"%(reaction)s\"": "Reagovat pomocí \"%(reaction)s\"" } diff --git a/i18n-overlays/matrix-react-sdk/en_EN.json b/i18n-overlays/matrix-react-sdk/en_EN.json index 7732df7..2c59706 100644 --- a/i18n-overlays/matrix-react-sdk/en_EN.json +++ b/i18n-overlays/matrix-react-sdk/en_EN.json @@ -49,5 +49,6 @@ "Mixed": "Mixed", "Sound pack": "Sound pack", "Schildi: Softer sounds for reduced anxiety": "Schildi: Softer sounds for reduced anxiety", - "Classic: The same sharp sounds as Element": "Classic: The same sharp sounds as Element" + "Classic: The same sharp sounds as Element": "Classic: The same sharp sounds as Element", + "React with \"%(reaction)s\"": "React with \"%(reaction)s\"" } diff --git a/i18n-overlays/matrix-react-sdk/hu.json b/i18n-overlays/matrix-react-sdk/hu.json index a048d36..cde030f 100644 --- a/i18n-overlays/matrix-react-sdk/hu.json +++ b/i18n-overlays/matrix-react-sdk/hu.json @@ -3,5 +3,27 @@ "Show message bubbles on one side only": "Üzenetbuborékok megjelenítése csak az egyik oldalon", "Message bubbles": "Üzenet buborékok", "Show message bubbles depending on the width either on both sides or only on one side": "Üzenetbuborékok megjelenítése a szélességtől függően mindkét oldalon vagy csak az egyik oldalon", - "Normal priority": "Normál prioritás" + "Normal priority": "Normál prioritás", + "Show people and rooms in a combined list": "Személyek és szobák megjelenítése egy egyesített listában", + "Update notifications": "Értesítések frissítése", + "Do you want to join a room notifying you about new releases? This is especially useful if your platform doesn't support automatic updates for SchildiChat (e.g. Windows and macOS).": "Szeretne csatlakozni olyan szobához, amely értesíti Önt az új megjelenésekről? Ez különösen akkor hasznos, ha az Ön platformja nem támogatja a SchildiChat automatikus frissítéseit (pl. Windows és macOS).", + "System": "Rendszer", + "Show all rooms in Home": "Az összes szoba megjelenítése a kezdőoldalon", + "All rooms you're in will appear in Home.": "Az összes szoba, amelyben tartózkodik, megjelenik a Kezdőlapon.", + "Mark as read": "Olvasottnak jelöl", + "Enable YouTube embed player": "YouTube beágyazott lejátszó engedélyezése", + "Home is useful for getting an overview of everything. Keep in mind that disabling it could leave you unable to see certain rooms.": "A Kezdőlap hasznos ahhoz, hogy mindenről áttekintést kapjunk. Ne feledje, hogy a kikapcsolásával bizonyos szobákat nem fog látni.", + "Schildi: Softer sounds for reduced anxiety": "Schildi: Lágyabb hangok a kevesebb stresszért", + "Sound pack": "Hangcsomag", + "Classic: The same sharp sounds as Element": "Klasszikus: Ugyanazok az éles hangok, mint az Elementnél", + "Don't ask again": "Ne kérdezze újra", + "Light theme": "Világos téma", + "Dark theme": "Sötét téma", + "Mark as unread": "Olvasatlannak jelöl", + "Collapse additional buttons": "További gombok összecsukása", + "Theme": "Téma", + "Room list": "Szobák listája", + "Font size and typeface": "Betűméret és betűtípus", + "Message layout": "Üzenetek elrendezése", + "Modern": "Modern" } diff --git a/i18n-overlays/matrix-react-sdk/id.json b/i18n-overlays/matrix-react-sdk/id.json index c0d5cbb..3324b6f 100644 --- a/i18n-overlays/matrix-react-sdk/id.json +++ b/i18n-overlays/matrix-react-sdk/id.json @@ -49,5 +49,6 @@ "Mixed": "Campur", "Sound pack": "Paket suara", "Schildi: Softer sounds for reduced anxiety": "Schildi: Suara lebih lembut untuk mengurangi kecemasan", - "Classic: The same sharp sounds as Element": "Klasik: Suara keras yang biasa seperti Element" + "Classic: The same sharp sounds as Element": "Klasik: Suara keras yang biasa seperti Element", + "React with \"%(reaction)s\"": "Reaksi dengan \"%(reaction)s\"" } diff --git a/i18n-overlays/matrix-react-sdk/it.json b/i18n-overlays/matrix-react-sdk/it.json index 72a5b3a..187e9c4 100644 --- a/i18n-overlays/matrix-react-sdk/it.json +++ b/i18n-overlays/matrix-react-sdk/it.json @@ -9,5 +9,26 @@ "Light theme": "Tema chiaro", "Dark theme": "Tema scuro", "Normal priority": "Priorità normale", - "Do you want to join a room notifying you about new releases? This is especially useful if your platform doesn't support automatic updates for SchildiChat (e.g. Windows and macOS).": "Vuoi entrare in una stanza che ti notificherà riguardo nuove release? Sarebbe comodo particolarmente se la tua piattaforma non supporta aggiornamenti automatici (Come per esempio Windows o MacOS.)" + "Do you want to join a room notifying you about new releases? This is especially useful if your platform doesn't support automatic updates for SchildiChat (e.g. Windows and macOS).": "Vuoi entrare in una stanza che ti notificherà riguardo nuove release? Sarebbe comodo particolarmente se la tua piattaforma non supporta aggiornamenti automatici (Come per esempio Windows o MacOS.)", + "Show message bubbles on one side only": "Visualizza bolle messaggi su un lato solo", + "Show message bubbles depending on the width either on both sides or only on one side": "Visualizza bolle messaggi in base alla lunghezza di entrambi i lati o di uno solo", + "User name color mode": "Modalità colore nome utente", + "Room list style": "Stile lista stanze", + "Theme": "Tema", + "Show all rooms in Home": "Visualizza tutte le stanze nella Home", + "All rooms you're in will appear in Home.": "Tutte le stanze in cui partecipi appariranno nella Home.", + "For people": "Per le persone", + "Room list": "Lista stanze", + "Show advanced theme settings": "Visualizza impostazioni avanzate tema", + "Mark rooms as unread": "Permetti di segnare le chat come non lette", + "Message bubbles": "Bolle messaggi", + "Message layout": "Impaginazione messaggi", + "Mark as unread": "Segna come non letto", + "Uniform": "Uniforme", + "Show people in spaces": "Visualizza persone negli spazi", + "MXID": "MXID", + "In public rooms": "Nelle stanze pubbliche", + "In group chats": "Nelle chat di gruppo", + "Font size and typeface": "Dimensione e tipo carattere", + "Hide advanced theme settings": "Nascondi impostazioni avanzate tema" } diff --git a/i18n-overlays/matrix-react-sdk/ja.json b/i18n-overlays/matrix-react-sdk/ja.json new file mode 100644 index 0000000..fedc533 --- /dev/null +++ b/i18n-overlays/matrix-react-sdk/ja.json @@ -0,0 +1,3 @@ +{ + "Normal priority": "常優先度" +} diff --git a/i18n-overlays/matrix-react-sdk/lt.json b/i18n-overlays/matrix-react-sdk/lt.json index 2b32484..7013517 100644 --- a/i18n-overlays/matrix-react-sdk/lt.json +++ b/i18n-overlays/matrix-react-sdk/lt.json @@ -17,5 +17,37 @@ "In group chats": "Pokalbių grupėse", "In public rooms": "Viešuose kambariuose", "Show all rooms in Home": "Rodyti visus kambarius Pradžioje", - "All rooms you're in will appear in Home.": "Visi kambariai kuriuose esate bus rodomi Pradžioje." + "All rooms you're in will appear in Home.": "Visi kambariai kuriuose esate bus rodomi Pradžioje.", + "Hide advanced theme settings": "Slėpti išplėstinius temos nustatymus", + "Show advanced theme settings": "Rodyti išplėstinius temos nustatymus", + "Theme": "Tema", + "Font size and typeface": "Šrifto dydis ir raštas", + "Show message bubbles depending on the width either on both sides or only on one side": "Rodyti žinučių burbulus, priklausomai nuo pločio, abiejose pusėse arba tik vienoje pusėje", + "Sound pack": "Garso paketas", + "Schildi: Softer sounds for reduced anxiety": "Schildi: švelnesni garsai sumažintam nerimui", + "Classic: The same sharp sounds as Element": "Klasikiniai: Tie patys aštrūs garsai kaip ir Element", + "Enable YouTube embed player": "Įgalinti YouTube įterptą grotuvą", + "Add custom theme": "Pridėti pasirinktinę temą", + "Mark as unread": "Žymėti kaip neskaitytą", + "Mark as read": "Žymėti kaip perskaitytą", + "User name color mode": "Naudotojo vardo spalvų režimas", + "Uniform": "Vienodi", + "Show notification badges for People in Spaces": "Rodyti pranešimų ženkliukus žmonėms erdvėse", + "Return to the room previously opened in a space": "Grįžti į anksčiau atidarytą kambarį erdvėje", + "If disabled, the space overview will be shown when switching to another space.": "Jei išjungta, perjungiant į kitą erdvę bus rodoma erdvės apžvalga.", + "Room list style": "Kambarių sąrašo stilius", + "Compact: tiny avatar together with name and preview in one line": "Kompaktiška: mažytis avataras kartu su vardu ir peržiūra vienoje eilutėje", + "Intermediate: medium sized avatar with single-line preview": "Vidutinis: vidutinio dydžio avataras su vienos eilutės peržiūra", + "Roomy: big avatar with two-line preview": "Erdvus: didelis avataras su dviejų eilučių peržiūra", + "PowerLevel": "Galios lygis", + "For people": "Žmonėms", + "Show people in spaces": "Rodyti žmones erdvėse", + "If disabled, you can still add Direct Messages to Personal Spaces. If enabled, you'll automatically see everyone who is a member of the Space.": "Jei išjungta, vis tiek galite pridėti tiesioginius pokalbius į asmenines erdves. Jei ši funkcija įjungta, automatiškai matysite visus, kurie yra erdvės nariai.", + "Mark rooms as unread": "Leisti žymėti pokalbius kaip neskaitytus", + "Home is useful for getting an overview of everything. Keep in mind that disabling it could leave you unable to see certain rooms.": "Pradžia yra naudinga, kad galėtumėte viską apžvelgti. Turėkite omenyje, kad ją išjungę galite nematyti tam tikrų kambarių.", + "Collapse additional buttons": "Sulankstyti papildomus mygtukus", + "Corners": "Kampai", + "Round": "Apvalus", + "Extra round": "Ypač apvalus", + "Mixed": "Mišrus" } diff --git a/i18n-overlays/matrix-react-sdk/pt_BR.json b/i18n-overlays/matrix-react-sdk/pt_BR.json index 5bac536..1b4c8af 100644 --- a/i18n-overlays/matrix-react-sdk/pt_BR.json +++ b/i18n-overlays/matrix-react-sdk/pt_BR.json @@ -40,5 +40,6 @@ "Room list style": "Estilo da lista de salas", "Mark rooms as unread": "Permitir markar conversas como não lidos", "Mark as unread": "Markar como não lido", - "Mark as read": "Markar como lido" + "Mark as read": "Markar como lido", + "Collapse additional buttons": "Recolher botões adicionais" } diff --git a/i18n-overlays/matrix-react-sdk/zh_Hans.json b/i18n-overlays/matrix-react-sdk/zh_Hans.json index aef112a..e3e332a 100644 --- a/i18n-overlays/matrix-react-sdk/zh_Hans.json +++ b/i18n-overlays/matrix-react-sdk/zh_Hans.json @@ -42,5 +42,13 @@ "Mark as unread": "标记为未读", "Home is useful for getting an overview of everything. Keep in mind that disabling it could leave you unable to see certain rooms.": "主页对于概览所有消息来说非常有用。请注意:禁用主页可能会让您无法看到某些房间。", "Enable YouTube embed player": "启用 YouTube 嵌入式播放器", - "Collapse additional buttons": "折叠额外的按钮" + "Collapse additional buttons": "折叠额外的按钮", + "Round": "圆角", + "React with \"%(reaction)s\"": "与 \"%(reaction)s\" 互动", + "Schildi: Softer sounds for reduced anxiety": "Schildi: 舒缓音效以减少焦虑", + "Mixed": "混合", + "Extra round": "超圆角", + "Sound pack": "音频包", + "Classic: The same sharp sounds as Element": "Classic: 与 Element 相同的尖锐声音", + "Corners": "边缘" } diff --git a/matrix-js-sdk b/matrix-js-sdk index c2deb2a..6390182 160000 --- a/matrix-js-sdk +++ b/matrix-js-sdk @@ -1 +1 @@ -Subproject commit c2deb2a20e687b1ef566a3e21ae3c5c18b473dd1 +Subproject commit 63901825c14da3ec6f59017d2696ad98be91d2e0 diff --git a/matrix-react-sdk b/matrix-react-sdk index bf34169..16fe0fe 160000 --- a/matrix-react-sdk +++ b/matrix-react-sdk @@ -1 +1 @@ -Subproject commit bf34169e576fde32cc9b0384eed22220b311ef39 +Subproject commit 16fe0fe8d0068e4c5da3fa5516c5578d2ffaabc7 diff --git a/merge_helpers.sh b/merge_helpers.sh index 3808eab..d80ff9e 100755 --- a/merge_helpers.sh +++ b/merge_helpers.sh @@ -1,8 +1,10 @@ #!/bin/bash -SCHILDI_ROOT="$(dirname "$(realpath "$0")")" +if [ -z "$SCHILDI_ROOT" ]; then + SCHILDI_ROOT="$(dirname "$(realpath "$0")")" +fi -branch=${BRANCH:-"sc"} +branch=${BRANCH:-"lite"} i18n_helper_path="$SCHILDI_ROOT/i18n-helper/index.js" i18n_path="src/i18n/strings" @@ -12,16 +14,16 @@ yarn=yarnpkg add_upstream() { if git remote | grep -q upstream; then - echo "Remote named upstream already exists!" - return 1 + echo "Remote named upstream already exists, deleting..." + git remote remove upstream fi local sc_remote="$(git remote -v|grep origin|grep fetch|sed 's|.*\t\(.*\) (fetch)|\1|')" - if echo "$sc_remote" | grep -q matrix; then + if echo "$sc_remote" | grep -q matrix-js-sdk; then # matrix.org repo local upstream_remote="$(echo "$sc_remote" | sed 's|SchildiChat|matrix-org|')" - elif echo "$sc_remote" | grep -q element; then + elif echo "$sc_remote" | grep -q "element\\|matrix-react-sdk"; then # vector-im repo - local upstream_remote="$(echo "$sc_remote" | sed 's|SchildiChat|vector-im|')" + local upstream_remote="$(echo "$sc_remote" | sed 's|SchildiChat|element-hq|')" else echo "Don't know upstream repo for $sc_remote" return 1 @@ -32,36 +34,24 @@ add_upstream() { } forall_repos() { - pushd "$SCHILDI_ROOT/matrix-js-sdk" > /dev/null - "$@" - popd > /dev/null - - pushd "$SCHILDI_ROOT/matrix-react-sdk" > /dev/null - "$@" - popd > /dev/null - - pushd "$SCHILDI_ROOT/element-web" > /dev/null - "$@" - popd > /dev/null - - pushd "$SCHILDI_ROOT/element-desktop" > /dev/null - "$@" - popd > /dev/null + for repo in "matrix-js-sdk" "matrix-react-sdk" "element-web" "element-desktop"; do + pushd "$SCHILDI_ROOT/$repo" > /dev/null + "$@" + popd > /dev/null + done } forelement_repos() { - pushd "$SCHILDI_ROOT/element-web" > /dev/null - "$@" - popd > /dev/null - - pushd "$SCHILDI_ROOT/element-desktop" > /dev/null - "$@" - popd > /dev/null + for repo in "element-web" "element-desktop"; do + pushd "$SCHILDI_ROOT/$repo" > /dev/null + "$@" + popd > /dev/null + done } ensure_yes() { read -e -p "$1 [y/N] " choice - + if [[ "$choice" != [Yy]* ]]; then exit 1 fi @@ -217,10 +207,10 @@ revert_packagejson_changes() { apply_packagejson_overlay() { local orig_path="$1" - local overlay_path="$2" + local overlay_path="../overlay/$(basename "$PWD")/package.json" # see: https://stackoverflow.com/a/24904276 - new_content=`jq -s '.[0] * .[1]' "$orig_path" "$overlay_path"` + new_content=`jq -s '.[0] * .[1]' "$orig_path" "$overlay_path" | sed 's| | |g'` echo "$new_content" > "$orig_path" git add "$orig_path" @@ -240,7 +230,7 @@ automatic_packagejson_adjustment() { local versions get_current_versions - forelement_repos apply_packagejson_overlay "package.json" "overlay-package.json" + forelement_repos apply_packagejson_overlay "package.json" forelement_repos write_version "package.json" } @@ -261,3 +251,51 @@ get_current_mxsdk_tags() { current_mxreactsdk_tag="v$(cat "$SCHILDI_ROOT/element-web/package.json" | jq '.dependencies["matrix-react-sdk"]' -r)" current_mxjssdk_tag="v$(cat "$SCHILDI_ROOT/element-web/package.json" | jq '.dependencies["matrix-js-sdk"]' -r)" } + +apply_patches() { + local repo="$(realpath "$1")" + local patch_dir="$SCHILDI_ROOT/patches/$(basename "$1")" + if [ ! -d "$repo" ]; then + echo "Unknown repo: $repo" + return 1 + fi + if [ ! -d "$patch_dir" ]; then + echo "No patches found at $patch_dir" + return 1 + fi + pushd "$repo" + for patch in "$patch_dir"/*; do + echo "Applying $patch to $repo..." + git am "$patch" || on_apply_patch_fail_try_original_commit "$patch" "$repo" + done + popd +} + +on_apply_patch_fail_try_original_commit() { + local patch="$1" + local repo="$2" + local orig_commit="$(head -n 1 "$patch"|sed 's|From ||;s| .*||')" + echo "Applying $patch failed, trying with original commit $orig_commit..." + git am --abort + git cherry-pick "$orig_commit" || on_apply_patch_fail "$patch" "$repo" "$orig_commit" +} + +on_apply_patch_fail() { + local patch="$1" + local repo="$2" + local orig_commit="$3" + echo "----------------------------------" + echo "Applying patch failed, please commit manually!" + echo "Patch: $patch" + echo "Repo: $repo" + echo "Original commit: $(head -n 1 "$patch"|sed 's|From ||;s| .*||')" + echo "----------------------------------" + read -p "Press enter after committing resolved conflicts: " +} + +commit_if_dirty() { + local message="$1" + # see: https://devops.stackexchange.com/a/5443 + git add -A + git diff-index --quiet HEAD || git commit -m "$message" +} diff --git a/merge_upstream.sh b/merge_upstream.sh index cfbea1f..79b3f5b 100755 --- a/merge_upstream.sh +++ b/merge_upstream.sh @@ -4,49 +4,56 @@ set -e mydir="$(dirname "$(realpath "$0")")" +# Update patches? +if [ "$1" = "-u" ]; then + keep_patches=0 + shift +else + keep_patches=1 +fi + pushd "$mydir" > /dev/null source ./merge_helpers.sh -# Check branch -check_branch $branch -forall_repos check_branch $branch +# Persist current state +if [ "$keep_patches" = 0 ]; then + ./generate_patches.sh +fi -# Ensure clean git state -forall_repos check_clean_git +# Abandon all local submodule state +forall_repos git reset --hard +git submodule update -f --recursive # Fetch upstream forall_repos git fetch upstream -# Automatic reversions -automatic_i18n_reversion -automatic_packagejson_reversion +# Check if specific version to merge passed +if [ -z "$1" ]; then + get_latest_upstream_tag +else + latest_upstream_tag="$1" +fi -# Merge upstream -get_latest_upstream_tag -forelement_repos git merge "$latest_upstream_tag" +sc_branch_name="sc_$latest_upstream_tag" + +forelement_repos git checkout "$latest_upstream_tag" -B "$sc_branch_name" get_current_mxsdk_tags pushd "matrix-js-sdk" > /dev/null -git merge "$current_mxjssdk_tag" +git checkout "$current_mxjssdk_tag" -B "$sc_branch_name" popd > /dev/null pushd "matrix-react-sdk" > /dev/null -git merge "$current_mxreactsdk_tag" +git checkout "$current_mxreactsdk_tag" -B "$sc_branch_name" popd > /dev/null # Refresh environment make clean make setup +forall_repos commit_if_dirty "Automatic setup commit" -# Automatic adjustments -automatic_i18n_adjustment -automatic_packagejson_adjustment - -# Automatic theme update -pushd "matrix-react-sdk" > /dev/null -./theme.sh y -popd > /dev/null +./apply_patches.sh popd > /dev/null diff --git a/overlay/element-desktop/package.json b/overlay/element-desktop/package.json new file mode 100644 index 0000000..f8d8434 --- /dev/null +++ b/overlay/element-desktop/package.json @@ -0,0 +1,10 @@ +{ + "name": "schildichat-desktop-alpha", + "productName": "SchildiChatAlpha", + "description": "A Matrix Client based on Element with some changes and tweaks", + "author": "SchildiChat", + "repository": { + "url": "https://github.com/SchildiChat/schildichat-desktop" + }, + "homepage": "https://schildi.chat/" +} diff --git a/overlay/element-web/package.json b/overlay/element-web/package.json new file mode 100644 index 0000000..35e873a --- /dev/null +++ b/overlay/element-web/package.json @@ -0,0 +1,8 @@ +{ + "name": "schildichat-web-alpha", + "description": "A Matrix Client based on Element with some changes and tweaks", + "author": "SchildiChat", + "repository": { + "url": "https://github.com/SchildiChat/schildichat-desktop" + } +} diff --git a/patches/element-desktop/0002-Add-back-schildi-fetch-package.ts-modifications.patch b/patches/element-desktop/0002-Add-back-schildi-fetch-package.ts-modifications.patch new file mode 100644 index 0000000..61764fe --- /dev/null +++ b/patches/element-desktop/0002-Add-back-schildi-fetch-package.ts-modifications.patch @@ -0,0 +1,62 @@ +From e326039d1acbc5da0cdd95dc235646202264d3c3 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Sat, 2 Dec 2023 12:57:26 +0100 +Subject: Add back schildi fetch-package.ts modifications + +--- + scripts/fetch-package.ts | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/scripts/fetch-package.ts b/scripts/fetch-package.ts +index 54da3f3..354f039 100644 +--- a/scripts/fetch-package.ts ++++ b/scripts/fetch-package.ts +@@ -55,6 +55,7 @@ async function main(): Promise { + let filename: string | undefined; + let url: string | undefined; + let setVersion = false; ++ const sc = true; + + while (process.argv.length > 2) { + switch (process.argv[2]) { +@@ -83,7 +84,9 @@ async function main(): Promise { + process.argv.shift(); + } + +- if (targetVersion === undefined) { ++ if (sc) { ++ // nothing ++ } else if (targetVersion === undefined) { + targetVersion = "v" + riotDesktopPackageJson.version; + } else if (targetVersion !== "develop") { + setVersion = true; // version was specified +@@ -93,7 +96,7 @@ async function main(): Promise { + filename = "develop.tar.gz"; + url = DEVELOP_TGZ_URL; + verify = false; // develop builds aren't signed +- } else if (targetVersion.includes("://")) { ++ } else if (targetVersion?.includes("://")) { + filename = targetVersion.substring(targetVersion.lastIndexOf("/") + 1); + url = targetVersion; + verify = false; // manually verified +@@ -145,12 +148,15 @@ async function main(): Promise { + } + + let haveDeploy = false; +- let expectedDeployDir = path.join(deployDir, path.basename(filename).replace(/\.tar\.gz/, "")); ++ let expectedDeployDir = sc ? "../element-web/webapp" : path.join(deployDir, path.basename(filename).replace(/\.tar\.gz/, "")); + try { + await fs.opendir(expectedDeployDir); + console.log(expectedDeployDir + "already exists"); + haveDeploy = true; +- } catch (e) {} ++ } catch (e) { ++ console.log("Not a valid webapp dir: " + expectedDeployDir, e); ++ return 1; ++ } + + if (!haveDeploy) { + const outPath = path.join(pkgDir, filename); +-- +2.47.0 + diff --git a/patches/matrix-js-sdk/0001-Add-fields-for-media-caption-support.patch b/patches/matrix-js-sdk/0001-Add-fields-for-media-caption-support.patch new file mode 100644 index 0000000..70aff3f --- /dev/null +++ b/patches/matrix-js-sdk/0001-Add-fields-for-media-caption-support.patch @@ -0,0 +1,56 @@ +From 63901825c14da3ec6f59017d2696ad98be91d2e0 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Thu, 9 May 2024 09:21:21 +0200 +Subject: Add fields for media caption support + +--- + src/@types/media.ts | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/@types/media.ts b/src/@types/media.ts +index 1128b40d3..d85526642 100644 +--- a/src/@types/media.ts ++++ b/src/@types/media.ts +@@ -189,6 +189,9 @@ export interface FileContent extends BaseContent { + * One of: [m.file]. + */ + msgtype: MsgType.File; ++ ++ format?: string; ++ formatted_body?: string; + } + + /** +@@ -205,6 +208,9 @@ export interface ImageContent extends BaseContent { + * One of: [m.image]. + */ + msgtype: MsgType.Image; ++ ++ format?: string; ++ formatted_body?: string; + } + + /** +@@ -221,6 +227,9 @@ export interface AudioContent extends BaseContent { + * One of: [m.audio]. + */ + msgtype: MsgType.Audio; ++ ++ format?: string; ++ formatted_body?: string; + } + + /** +@@ -237,6 +246,9 @@ export interface VideoContent extends BaseContent { + * One of: [m.video]. + */ + msgtype: MsgType.Video; ++ ++ format?: string; ++ formatted_body?: string; + } + + /** +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0001-Disable-sticky-rooms.patch b/patches/matrix-react-sdk/0001-Disable-sticky-rooms.patch new file mode 100644 index 0000000..f8f0dce --- /dev/null +++ b/patches/matrix-react-sdk/0001-Disable-sticky-rooms.patch @@ -0,0 +1,29 @@ +From 913772283fd2b9f682a11a594061a6a1189b7869 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Tue, 18 Jan 2022 13:28:22 +0100 +Subject: Disable sticky rooms + +--- + src/stores/room-list/algorithms/Algorithm.ts | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts +index c3450d70cf..e296676149 100644 +--- a/src/stores/room-list/algorithms/Algorithm.ts ++++ b/src/stores/room-list/algorithms/Algorithm.ts +@@ -159,8 +159,10 @@ export class Algorithm extends EventEmitter { + this.recalculateActiveCallRooms(tagId); + } + +- private updateStickyRoom(val: Room | null): void { +- this.doUpdateStickyRoom(val); ++ private updateStickyRoom(val: Room) { ++ // Schildi: we don't want it sticky ++ this.doUpdateStickyRoom(null); ++ //this.doUpdateStickyRoom(val); + this._lastStickyRoom = null; // clear to indicate we're done changing + } + +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0002-Bring-back-unified-room-list.patch b/patches/matrix-react-sdk/0002-Bring-back-unified-room-list.patch new file mode 100644 index 0000000..81bd614 --- /dev/null +++ b/patches/matrix-react-sdk/0002-Bring-back-unified-room-list.patch @@ -0,0 +1,263 @@ +From e2045dd5dcbd82f7b5c4f98d89b258cc304d3e26 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Sun, 5 May 2024 10:12:17 +0200 +Subject: Bring back unified room list + +Remaining TODO: +- Hook up setting to UI again (better with own SC-specific screen?) + +Co-authored-by: su-ex +--- + src/components/views/rooms/RoomList.tsx | 39 +++++++++++++++++++- + src/settings/Settings.tsx | 8 ++++ + src/stores/room-list/RoomListStore.ts | 19 +++++++++- + src/stores/room-list/algorithms/Algorithm.ts | 20 ++++++++-- + src/stores/room-list/models.ts | 2 + + 5 files changed, 83 insertions(+), 5 deletions(-) + +diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx +index e27b2ca03f..311a54d9d8 100644 +--- a/src/components/views/rooms/RoomList.tsx ++++ b/src/components/views/rooms/RoomList.tsx +@@ -72,11 +72,13 @@ interface IState { + sublists: ITagMap; + currentRoomId?: string; + suggestedRooms: ISuggestedRoom[]; ++ unifiedRoomList: boolean; + } + + export const TAG_ORDER: TagID[] = [ + DefaultTagID.Invite, + DefaultTagID.Favourite, ++ DefaultTagID.Unified, + DefaultTagID.DM, + DefaultTagID.Untagged, + DefaultTagID.Conference, +@@ -89,6 +91,7 @@ export const TAG_ORDER: TagID[] = [ + // but we'd have to make sure that rooms you weren't in were hidden. + ]; + const ALWAYS_VISIBLE_TAGS: TagID[] = [DefaultTagID.DM, DefaultTagID.Untagged]; ++const ALWAYS_VISIBLE_UNIFIED_TAGS: TagID[] = [DefaultTagID.Unified]; + + interface ITagAesthetics { + sectionLabel: TranslationKey; +@@ -366,6 +369,17 @@ const UntaggedAuxButton: React.FC = ({ tabIndex }) => { + return null; + }; + ++const UnifiedAuxButton: React.FC = (iAuxButtonProps: IAuxButtonProps) => { ++ return ( ++ <> ++ {/* eslint-disable-next-line new-cap */} ++ {DmAuxButton(iAuxButtonProps)} ++ {/* eslint-disable-next-line new-cap */} ++ {UntaggedAuxButton(iAuxButtonProps)} ++ ++ ); ++}; ++ + const TAG_AESTHETICS: TagAestheticsMap = { + [DefaultTagID.Invite]: { + sectionLabel: _td("action|invites_list"), +@@ -383,6 +397,12 @@ const TAG_AESTHETICS: TagAestheticsMap = { + defaultHidden: false, + AuxButtonComponent: DmAuxButton, + }, ++ [DefaultTagID.Unified]: { ++ sectionLabel: _td("Normal priority"), ++ isInvite: false, ++ defaultHidden: false, ++ AuxButtonComponent: UnifiedAuxButton, ++ }, + [DefaultTagID.Conference]: { + sectionLabel: _td("voip|metaspace_video_rooms|conference_room_section"), + isInvite: false, +@@ -421,6 +441,7 @@ const TAG_AESTHETICS: TagAestheticsMap = { + + export default class RoomList extends React.PureComponent { + private dispatcherRef?: string; ++ private readonly unifiedRoomListWatcherRef: string; + private treeRef = createRef(); + + public static contextType = MatrixClientContext; +@@ -432,7 +453,14 @@ export default class RoomList extends React.PureComponent { + this.state = { + sublists: {}, + suggestedRooms: SpaceStore.instance.suggestedRooms, ++ unifiedRoomList: SettingsStore.getValue("unifiedRoomList"), + }; ++ ++ this.unifiedRoomListWatcherRef = SettingsStore.watchSetting( ++ "unifiedRoomList", ++ null, ++ this.onUnifiedRoomListChange, ++ ); + } + + public componentDidMount(): void { +@@ -447,9 +475,16 @@ export default class RoomList extends React.PureComponent { + SpaceStore.instance.off(UPDATE_SUGGESTED_ROOMS, this.updateSuggestedRooms); + RoomListStore.instance.off(LISTS_UPDATE_EVENT, this.updateLists); + if (this.dispatcherRef) defaultDispatcher.unregister(this.dispatcherRef); ++ SettingsStore.unwatchSetting(this.unifiedRoomListWatcherRef); + SdkContextClass.instance.roomViewStore.off(UPDATE_EVENT, this.onRoomViewStoreUpdate); + } + ++ private onUnifiedRoomListChange = (): void => { ++ this.setState({ ++ unifiedRoomList: SettingsStore.getValue("unifiedRoomList"), ++ }); ++ }; ++ + private onRoomViewStoreUpdate = (): void => { + this.setState({ + currentRoomId: SdkContextClass.instance.roomViewStore.getRoomId() ?? undefined, +@@ -590,7 +625,9 @@ export default class RoomList extends React.PureComponent { + const aesthetics = TAG_AESTHETICS[orderedTagId]; + if (!aesthetics) throw new Error(`Tag ${orderedTagId} does not have aesthetics`); + +- let alwaysVisible = ALWAYS_VISIBLE_TAGS.includes(orderedTagId); ++ let alwaysVisible = ( ++ this.state.unifiedRoomList ? ALWAYS_VISIBLE_UNIFIED_TAGS : ALWAYS_VISIBLE_TAGS ++ ).includes(orderedTagId); + if ( + (this.props.activeSpace === MetaSpace.Favourites && orderedTagId !== DefaultTagID.Favourite) || + (this.props.activeSpace === MetaSpace.People && orderedTagId !== DefaultTagID.DM) || +diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx +index 76bb109cac..7aea53ceea 100644 +--- a/src/settings/Settings.tsx ++++ b/src/settings/Settings.tsx +@@ -191,6 +191,14 @@ export interface IFeature extends Omit, "isFeature"> { + export type ISetting = IBaseSetting | IFeature; + + export const SETTINGS: { [setting: string]: ISetting } = { ++ // SC settings start ++ "unifiedRoomList": { ++ supportedLevels: LEVELS_ACCOUNT_SETTINGS, ++ displayName: _td("Show people and rooms in a combined list"), ++ default: true, ++ controller: new ReloadOnChangeController(), ++ }, ++ // SC settings end + "feature_video_rooms": { + isFeature: true, + labsGroup: LabGroup.VoiceAndVideo, +diff --git a/src/stores/room-list/RoomListStore.ts b/src/stores/room-list/RoomListStore.ts +index 53377e0a01..381187b85c 100644 +--- a/src/stores/room-list/RoomListStore.ts ++++ b/src/stores/room-list/RoomListStore.ts +@@ -500,6 +500,9 @@ export class RoomListStoreClass extends AsyncStoreWithClient implements + this.setAndPersistListOrder(tag, listOrder); + } + } ++ ++ // SC: Unified list for DMs and groups ++ this.algorithm.setUnifiedRoomList(SettingsStore.getValue("unifiedRoomList")); + } + + private onAlgorithmListUpdated = (forceUpdate: boolean): void => { +@@ -613,7 +616,21 @@ export class RoomListStoreClass extends AsyncStoreWithClient implements + */ + public getTagsForRoom(room: Room): TagID[] { + const algorithmTags = this.algorithm.getTagsForRoom(room); +- if (!algorithmTags) return [DefaultTagID.Untagged]; ++ if (!algorithmTags) { ++ if (SettingsStore.getValue("unifiedRoomList")) { ++ return [DefaultTagID.Unified]; ++ } else { ++ return [DefaultTagID.Untagged]; ++ } ++ } ++ const dmTagIndex = algorithmTags.indexOf(DefaultTagID.DM); ++ if (dmTagIndex !== -1) { ++ algorithmTags[dmTagIndex] = DefaultTagID.Unified; ++ } ++ const untaggedTagIndex = algorithmTags.indexOf(DefaultTagID.Untagged); ++ if (untaggedTagIndex !== -1) { ++ algorithmTags[untaggedTagIndex] = DefaultTagID.Unified; ++ } + return algorithmTags; + } + +diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts +index e296676149..06147137b3 100644 +--- a/src/stores/room-list/algorithms/Algorithm.ts ++++ b/src/stores/room-list/algorithms/Algorithm.ts +@@ -75,6 +75,7 @@ export class Algorithm extends EventEmitter { + * Set to true to suspend emissions of algorithm updates. + */ + public updatesInhibited = false; ++ private unifiedRoomList: boolean = true; + + public start(): void { + CallStore.instance.on(CallStoreEvent.ConnectedCalls, this.onConnectedCalls); +@@ -106,6 +107,10 @@ export class Algorithm extends EventEmitter { + return this._cachedRooms; + } + ++ public setUnifiedRoomList(unifiedRoomList: boolean): void { ++ this.unifiedRoomList = unifiedRoomList; ++ } ++ + /** + * Awaitable version of the sticky room setter. + * @param val The new room to sticky. +@@ -513,7 +518,10 @@ export class Algorithm extends EventEmitter { + } + + if (!inTag) { +- if (DMRoomMap.shared().getUserIdForRoomId(room.roomId)) { ++ if (this.unifiedRoomList) { ++ // SC: Unified room list for DMs and groups ++ newTags[DefaultTagID.Unified].push(room); ++ } else if (DMRoomMap.shared().getUserIdForRoomId(room.roomId)) { + newTags[DefaultTagID.DM].push(room); + } else { + newTags[DefaultTagID.Untagged].push(room); +@@ -557,7 +565,13 @@ export class Algorithm extends EventEmitter { + tags.push(...this.getTagsOfJoinedRoom(room)); + } + +- if (!tags.length) tags.push(DefaultTagID.Untagged); ++ if (!tags.length) { ++ if (this.unifiedRoomList) { ++ tags.push(DefaultTagID.Unified); ++ } else { ++ tags.push(DefaultTagID.Untagged); ++ } ++ } + + return tags; + } +@@ -567,7 +581,7 @@ export class Algorithm extends EventEmitter { + + if (tags.length === 0) { + // Check to see if it's a DM if it isn't anything else +- if (DMRoomMap.shared().getUserIdForRoomId(room.roomId)) { ++ if (DMRoomMap.shared().getUserIdForRoomId(room.roomId) && !this.unifiedRoomList) { + tags = [DefaultTagID.DM]; + } + } +diff --git a/src/stores/room-list/models.ts b/src/stores/room-list/models.ts +index 50cecda665..8efc2d040d 100644 +--- a/src/stores/room-list/models.ts ++++ b/src/stores/room-list/models.ts +@@ -13,6 +13,7 @@ export enum DefaultTagID { + LowPriority = "m.lowpriority", + Favourite = "m.favourite", + DM = "im.vector.fake.direct", ++ Unified = "chat.schildi.fake.unified", + Conference = "im.vector.fake.conferences", + ServerNotice = "m.server_notice", + Suggested = "im.vector.fake.suggested", +@@ -21,6 +22,7 @@ export enum DefaultTagID { + export const OrderedDefaultTagIDs = [ + DefaultTagID.Invite, + DefaultTagID.Favourite, ++ DefaultTagID.Unified, + DefaultTagID.DM, + DefaultTagID.Conference, + DefaultTagID.Untagged, +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0003-Don-t-sort-muted-rooms-to-bottom-I-still-want-to-see.patch b/patches/matrix-react-sdk/0003-Don-t-sort-muted-rooms-to-bottom-I-still-want-to-see.patch new file mode 100644 index 0000000..2363d5b --- /dev/null +++ b/patches/matrix-react-sdk/0003-Don-t-sort-muted-rooms-to-bottom-I-still-want-to-see.patch @@ -0,0 +1,25 @@ +From 1d3847da55e91dfc5e555e69fbadcbc1d033a8d9 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Sun, 17 Dec 2023 11:11:58 +0100 +Subject: Don't sort muted rooms to bottom, I still want to see them. + +--- + .../room-list/algorithms/list-ordering/OrderingAlgorithm.ts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts +index 67ee1ca084..67dcaa3855 100644 +--- a/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts ++++ b/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts +@@ -38,7 +38,7 @@ export abstract class OrderingAlgorithm { + } + + public get isMutedToBottom(): boolean { +- return this.sortingAlgorithm === SortAlgorithm.Recent; ++ return this.sortingAlgorithm === SortAlgorithm.Recent && false; + } + + /** +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0004-Add-support-for-rendering-captions-in-media-messages.patch b/patches/matrix-react-sdk/0004-Add-support-for-rendering-captions-in-media-messages.patch new file mode 100644 index 0000000..f097ae4 --- /dev/null +++ b/patches/matrix-react-sdk/0004-Add-support-for-rendering-captions-in-media-messages.patch @@ -0,0 +1,104 @@ +From ac0fb82339fc580da9db60c183a39d72e6fba3ea Mon Sep 17 00:00:00 2001 +From: Tulir Asokan +Date: Tue, 12 Jul 2022 15:34:57 +0300 +Subject: Add support for rendering captions in media messages + +--- + src/components/views/messages/IBodyProps.ts | 2 ++ + src/components/views/messages/MessageEvent.tsx | 15 +++++++++++++++ + src/components/views/messages/TextualBody.tsx | 11 +++++++++++ + src/utils/FileUtils.ts | 4 +++- + 4 files changed, 31 insertions(+), 1 deletion(-) + +diff --git a/src/components/views/messages/IBodyProps.ts b/src/components/views/messages/IBodyProps.ts +index e48ba96b56..3caeff225c 100644 +--- a/src/components/views/messages/IBodyProps.ts ++++ b/src/components/views/messages/IBodyProps.ts +@@ -51,4 +51,6 @@ export interface IBodyProps { + // Set to `true` to disable interactions (e.g. video controls) and to remove controls from the tab order. + // This may be useful when displaying a preview of the event. + inhibitInteraction?: boolean; ++ ++ OrigBodyType?: React.ComponentType>; + } +diff --git a/src/components/views/messages/MessageEvent.tsx b/src/components/views/messages/MessageEvent.tsx +index 1a5d09e415..bfe908aacc 100644 +--- a/src/components/views/messages/MessageEvent.tsx ++++ b/src/components/views/messages/MessageEvent.tsx +@@ -175,6 +175,15 @@ export default class MessageEvent extends React.Component implements IMe + } + } + ++ // @ts-ignore ++ const hasCaption = [MsgType.Image, MsgType.File, MsgType.Audio, MsgType.Video].includes(msgtype) ++ && content.filename && content.filename !== content.body; ++ let OrigBodyType; ++ if (hasCaption) { ++ OrigBodyType = BodyType ++ BodyType = CaptionBody ++ } ++ + if (SettingsStore.getValue("feature_mjolnir")) { + const key = `mx_mjolnir_render_${this.props.mxEvent.getRoomId()}__${this.props.mxEvent.getId()}`; + const allowRender = localStorage.getItem(key) === "true"; +@@ -208,7 +217,13 @@ export default class MessageEvent extends React.Component implements IMe + getRelationsForEvent={this.props.getRelationsForEvent} + isSeeingThroughMessageHiddenForModeration={this.props.isSeeingThroughMessageHiddenForModeration} + inhibitInteraction={this.props.inhibitInteraction} ++ OrigBodyType={OrigBodyType} + /> + ) : null; + } + } ++ ++const CaptionBody: React.FunctionComponent>}> = ({OrigBodyType, ...props}) => (
++ ++ ++
) +diff --git a/src/components/views/messages/TextualBody.tsx b/src/components/views/messages/TextualBody.tsx +index 8b7bfb9a5a..a8890303f8 100644 +--- a/src/components/views/messages/TextualBody.tsx ++++ b/src/components/views/messages/TextualBody.tsx +@@ -557,6 +557,9 @@ export default class TextualBody extends React.Component { + const isNotice = content.msgtype === MsgType.Notice; + const isEmote = content.msgtype === MsgType.Emote; + ++ // @ts-ignore ++ const isCaption = [MsgType.Image, MsgType.File, MsgType.Audio, MsgType.Video].includes(content.msgtype); ++ + const willHaveWrapper = + this.props.replacingEventId || this.props.isSeeingThroughMessageHiddenForModeration || isEmote; + +@@ -635,6 +638,14 @@ export default class TextualBody extends React.Component { + + ); + } ++ if (isCaption) { ++ return ( ++
++ { body } ++ { widgets } ++
++ ); ++ } + return ( +
+ {body} +diff --git a/src/utils/FileUtils.ts b/src/utils/FileUtils.ts +index 194cb31d20..0c0aec2138 100644 +--- a/src/utils/FileUtils.ts ++++ b/src/utils/FileUtils.ts +@@ -38,7 +38,9 @@ export function presentableTextForFile( + shortened = false, + ): string { + let text = fallbackText; +- if (content.body?.length) { ++ if (content.filename?.length) { ++ text = content.filename ++ } else if (content.body?.length) { + // The content body should be the name of the file including a + // file extension. + text = content.body; +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0005-Don-t-preview-reactions.patch b/patches/matrix-react-sdk/0005-Don-t-preview-reactions.patch new file mode 100644 index 0000000..b935d6e --- /dev/null +++ b/patches/matrix-react-sdk/0005-Don-t-preview-reactions.patch @@ -0,0 +1,29 @@ +From 0f0f80d270be5c88b0b762b51fe570c11b0bea7f Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Thu, 14 Dec 2023 10:32:10 +0100 +Subject: Don't preview reactions + +--- + src/stores/room-list/MessagePreviewStore.ts | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/stores/room-list/MessagePreviewStore.ts b/src/stores/room-list/MessagePreviewStore.ts +index e0e06ec980..7ee27f8402 100644 +--- a/src/stores/room-list/MessagePreviewStore.ts ++++ b/src/stores/room-list/MessagePreviewStore.ts +@@ -57,10 +57,12 @@ const PREVIEWS: Record< + isState: false, + previewer: new StickerEventPreview(), + }, ++ /* + "m.reaction": { + isState: false, + previewer: new ReactionEventPreview(), + }, ++ */ + [M_POLL_START.name]: { + isState: false, + previewer: new PollStartEventPreview(), +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0006-Hide-the-mute-notification-state-the-same-way-as-the.patch b/patches/matrix-react-sdk/0006-Hide-the-mute-notification-state-the-same-way-as-the.patch new file mode 100644 index 0000000..eafb725 --- /dev/null +++ b/patches/matrix-react-sdk/0006-Hide-the-mute-notification-state-the-same-way-as-the.patch @@ -0,0 +1,30 @@ +From bc49b8d30cf7e0da038fac992ee2ff04c9dc91aa Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Wed, 17 Nov 2021 12:50:25 +0100 +Subject: Hide the "mute" notification state the same way as the other states + +This can get in the way of the "marked as unread" icon otherwise. +Furthermore, I didn't really like it showing there persistently either +way. +--- + src/components/views/rooms/RoomTile.tsx | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx +index 93fb42f447..09df8eaac9 100644 +--- a/src/components/views/rooms/RoomTile.tsx ++++ b/src/components/views/rooms/RoomTile.tsx +@@ -304,7 +304,9 @@ export class RoomTile extends React.PureComponent { + + // Only show the icon by default if the room is overridden to muted. + // TODO: [FTUE Notifications] Probably need to detect global mute state +- mx_RoomTile_notificationsButton_show: state === RoomNotifState.Mute, ++ //mx_RoomTile_notificationsButton_show: state === RoomNotifState.Mute, ++ // SchildiChat: never show the icon by default. This gets in the way of the "marked as unread" icon. ++ mx_RoomTile_notificationsButton_show: false, + }); + + return ( +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0007-Allow-muted-rooms-to-render-as-unread.patch b/patches/matrix-react-sdk/0007-Allow-muted-rooms-to-render-as-unread.patch new file mode 100644 index 0000000..dd98773 --- /dev/null +++ b/patches/matrix-react-sdk/0007-Allow-muted-rooms-to-render-as-unread.patch @@ -0,0 +1,25 @@ +From 10b23f715bf5115715dca07676ca467a6433c9c9 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Fri, 10 May 2024 18:58:32 +0200 +Subject: Allow muted rooms to render as unread + +--- + src/RoomNotifs.ts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/RoomNotifs.ts b/src/RoomNotifs.ts +index cc027c9682..c4c31a51cb 100644 +--- a/src/RoomNotifs.ts ++++ b/src/RoomNotifs.ts +@@ -255,7 +255,7 @@ export function determineUnreadState( + return { symbol: "!", count: 1, level: NotificationLevel.Highlight }; + } + +- if (getRoomNotifsState(room.client, room.roomId) === RoomNotifState.Mute) { ++ if (false && getRoomNotifsState(room.client, room.roomId) === RoomNotifState.Mute) { + return { symbol: null, count: 0, level: NotificationLevel.None }; + } + +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0008-Increase-default-visible-tiles.patch b/patches/matrix-react-sdk/0008-Increase-default-visible-tiles.patch new file mode 100644 index 0000000..e2d8e51 --- /dev/null +++ b/patches/matrix-react-sdk/0008-Increase-default-visible-tiles.patch @@ -0,0 +1,25 @@ +From 641cd216c155318e35eabef30761613706e36c87 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Sun, 30 Aug 2020 15:33:01 +0200 +Subject: Increase default visible tiles + +--- + src/stores/room-list/ListLayout.ts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/stores/room-list/ListLayout.ts b/src/stores/room-list/ListLayout.ts +index ff60309e08..275b6d330b 100644 +--- a/src/stores/room-list/ListLayout.ts ++++ b/src/stores/room-list/ListLayout.ts +@@ -74,7 +74,7 @@ export class ListLayout { + + public get defaultVisibleTiles(): number { + // This number is what "feels right", and mostly subject to design's opinion. +- return 8; ++ return 50; + } + + public tilesWithPadding(n: number, paddingPx: number): number { +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0009-Bring-back-showSpaceDMBadges-setting-force-enabled-f.patch b/patches/matrix-react-sdk/0009-Bring-back-showSpaceDMBadges-setting-force-enabled-f.patch new file mode 100644 index 0000000..7ef1a39 --- /dev/null +++ b/patches/matrix-react-sdk/0009-Bring-back-showSpaceDMBadges-setting-force-enabled-f.patch @@ -0,0 +1,92 @@ +From 2203554625f7c8d924981b3cd03b1389dc6873d9 Mon Sep 17 00:00:00 2001 +From: su-ex +Date: Sun, 26 May 2024 10:43:36 +0200 +Subject: Bring back showSpaceDMBadges setting, force-enabled for now + +TODO settings UI + +Co-authored-by: SpiritCroc +--- + src/settings/Settings.tsx | 5 +++++ + src/stores/spaces/SpaceStore.ts | 25 +++++++++++++++++++++++++ + 2 files changed, 30 insertions(+) + +diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx +index 7aea53ceea..b668c65dfd 100644 +--- a/src/settings/Settings.tsx ++++ b/src/settings/Settings.tsx +@@ -198,6 +198,11 @@ export const SETTINGS: { [setting: string]: ISetting } = { + default: true, + controller: new ReloadOnChangeController(), + }, ++ "Spaces.showSpaceDMBadges": { ++ displayName: _td("Show notification badges for People in Spaces"), ++ supportedLevels: LEVELS_ACCOUNT_SETTINGS, ++ default: true, ++ }, + // SC settings end + "feature_video_rooms": { + isFeature: true, +diff --git a/src/stores/spaces/SpaceStore.ts b/src/stores/spaces/SpaceStore.ts +index 90358f3310..60df05478a 100644 +--- a/src/stores/spaces/SpaceStore.ts ++++ b/src/stores/spaces/SpaceStore.ts +@@ -154,9 +154,17 @@ export class SpaceStoreClass extends AsyncStoreWithClient { + /** Whether the feature flag is set for MSC3946 */ + private _msc3946ProcessDynamicPredecessor: boolean = SettingsStore.getValue("feature_dynamic_room_predecessors"); + ++ // SC start ++ private _showSpaceDMBadges = true; ++ // SC end ++ + public constructor() { + super(defaultDispatcher, {}); + ++ // SC start ++ SettingsStore.monitorSetting("Spaces.showSpaceDMBadges", null); ++ // SC end ++ + SettingsStore.monitorSetting("Spaces.allRoomsInHome", null); + SettingsStore.monitorSetting("Spaces.enabledMetaSpaces", null); + SettingsStore.monitorSetting("Spaces.showPeopleInSpace", null); +@@ -192,6 +200,10 @@ export class SpaceStoreClass extends AsyncStoreWithClient { + return this._allRoomsInHome; + } + ++ public get showSpaceDMBadges(): boolean { // SC ++ return this._showSpaceDMBadges; ++ } ++ + public setActiveRoomInSpace(space: SpaceKey): void { + if (!isMetaSpace(space) && !this.matrixClient?.getRoom(space)?.isSpaceRoom()) return; + if (space !== this.activeSpace) this.setActiveSpace(space, false); +@@ -701,6 +713,10 @@ export class SpaceStoreClass extends AsyncStoreWithClient { + + if (room.isSpaceRoom() || !flattenedRoomsForSpace.has(room.roomId)) return false; + ++ if (this.showSpaceDMBadges) { // SC ++ return true; ++ } ++ + if (dmBadgeSpace && DMRoomMap.shared().getUserIdForRoomId(room.roomId)) { + return s === dmBadgeSpace; + } +@@ -1277,6 +1293,15 @@ export class SpaceStoreClass extends AsyncStoreWithClient { + break; + } + ++ case "Spaces.showSpaceDMBadges": { // SC ++ const newValue = SettingsStore.getValue("Spaces.showSpaceDMBadges"); ++ if (this.showSpaceDMBadges !== newValue) { ++ this._showSpaceDMBadges = newValue; ++ this.rebuildSpaceHierarchy(); // rebuild everything ++ } ++ break; ++ } ++ + case "Spaces.enabledMetaSpaces": { + const newValue = SettingsStore.getValue("Spaces.enabledMetaSpaces"); + const enabledMetaSpaces = metaSpaceOrder.filter((k) => newValue[k]); +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0010-Squashed-Freeform-reactions-from-tadzik-freeform-rea.patch b/patches/matrix-react-sdk/0010-Squashed-Freeform-reactions-from-tadzik-freeform-rea.patch new file mode 100644 index 0000000..a281def --- /dev/null +++ b/patches/matrix-react-sdk/0010-Squashed-Freeform-reactions-from-tadzik-freeform-rea.patch @@ -0,0 +1,134 @@ +From 961ee28392810973057a0c8af410e1067a15547a Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Wed, 29 May 2024 19:32:42 +0200 +Subject: Squashed: Freeform reactions from tadzik/freeform-reactions-upstream +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 9eea56b0080db3720efa49b457707bcde3be6474 +Merge: 06f81c9662 8570f16e31 +Author: Tadeusz Sośnierz +Date: Tue Jun 20 09:57:19 2023 +0200 + + Merge branch 'develop' into tadzik/freeform-reactions-upstream + +commit 06f81c9662fbe033b4eac859d7e14e0ab24a6e91 +Merge: ad4fef85b1 0d6a550c33 +Author: Michael Telatynski <7t3chguy@gmail.com> +Date: Wed Aug 31 09:06:49 2022 +0100 + + Merge branch 'develop' into tadzik/freeform-reactions + +commit ad4fef85b160087b8017b9ae9cf9aebfd5348f41 +Merge: 689b57c0b9 5aae974e93 +Author: Tadeusz Sośnierz +Date: Sun Aug 28 10:11:48 2022 +0200 + + Merge branch 'develop' into tadzik/freeform-reactions + +commit 689b57c0b91e12907a8dbc3fac3ed10302a11e4a +Author: Tadeusz Sośnierz +Date: Fri May 20 10:35:06 2022 +0200 + + Fix conflict resolution fail in EmojiPicker + +commit 70a8e212b748584949b37bc99b72acffce2fd148 +Merge: 215df55f13 a0cdc93642 +Author: Tadeusz Sośnierz +Date: Fri May 20 10:25:17 2022 +0200 + + Merge branch 'develop' into tadzik/freeform-reactions-upstream + +commit 215df55f13162bdc8eb13da5219763c56f560dd0 +Author: Tadeusz Sośnierz +Date: Tue Aug 17 16:30:06 2021 +0200 + + Disable freeform emoji reactions in the message composer + +commit 6bb8263007e077d22929fcc1fb439d94a4f15c6f +Author: Tadeusz Sośnierz +Date: Tue Aug 17 12:12:28 2021 +0200 + + Add more typing to EmojiPicker + +commit b2a1728318a8a5496345797995c1ec09ae3f88e6 +Author: Tadeusz Sośnierz +Date: Tue Aug 17 11:52:35 2021 +0200 + + Make free-form reaction button translatable + +commit f4adaf00b805baba454fbceb41cc5c081ec886a7 +Author: Tadeusz Sośnierz +Date: Tue Aug 17 11:29:22 2021 +0200 + + Allow sending free-form reactions + + Signed-off-by: Tadeusz Sośnierz +--- + src/components/views/emojipicker/EmojiPicker.tsx | 15 +++++++++++++++ + .../views/emojipicker/ReactionPicker.tsx | 1 + + 2 files changed, 16 insertions(+) + +diff --git a/src/components/views/emojipicker/EmojiPicker.tsx b/src/components/views/emojipicker/EmojiPicker.tsx +index 4806ad4216..7d4a4353e2 100644 +--- a/src/components/views/emojipicker/EmojiPicker.tsx ++++ b/src/components/views/emojipicker/EmojiPicker.tsx +@@ -17,6 +17,7 @@ import Header from "./Header"; + import Search from "./Search"; + import Preview from "./Preview"; + import QuickReactions from "./QuickReactions"; ++import AccessibleButton from '../elements/AccessibleButton'; + import Category, { CategoryKey, ICategory } from "./Category"; + import { filterBoolean } from "../../../utils/arrays"; + import { +@@ -37,6 +38,7 @@ export const EMOJIS_PER_ROW = 8; + const ZERO_WIDTH_JOINER = "\u200D"; + + interface IProps { ++ allowUnlisted?: boolean; + selectedEmojis?: Set; + onChoose(unicode: string): boolean; + onFinished(): void; +@@ -341,6 +343,10 @@ class EmojiPicker extends React.Component { + } + }; + ++ private reactWith = (reaction: string): void => { ++ this.props.onChoose(reaction); ++ }; ++ + private static categoryHeightForEmojiCount(count: number): number { + if (count === 0) { + return 0; +@@ -396,6 +402,15 @@ class EmojiPicker extends React.Component { + return categoryElement; + })} + ++ { ++ (this.props.allowUnlisted && this.state.filter) && ++ this.reactWith(this.state.filter)} ++ > ++ { _t('React with "%(reaction)s"', { reaction: this.state.filter }) } ++ ++ } + {this.state.previewEmoji ? ( + + ) : ( +diff --git a/src/components/views/emojipicker/ReactionPicker.tsx b/src/components/views/emojipicker/ReactionPicker.tsx +index 2c2eb442a0..62bfd2ea0f 100644 +--- a/src/components/views/emojipicker/ReactionPicker.tsx ++++ b/src/components/views/emojipicker/ReactionPicker.tsx +@@ -123,6 +123,7 @@ class ReactionPicker extends React.Component { + public render(): React.ReactNode { + return ( + +Date: Sat, 22 Apr 2023 12:15:18 +0200 +Subject: Allow reactions to take more space + +--- + res/css/views/messages/_ReactionsRowButton.pcss | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/res/css/views/messages/_ReactionsRowButton.pcss b/res/css/views/messages/_ReactionsRowButton.pcss +index f2e3885de4..2a8bb9224e 100644 +--- a/res/css/views/messages/_ReactionsRowButton.pcss ++++ b/res/css/views/messages/_ReactionsRowButton.pcss +@@ -14,6 +14,7 @@ Please see LICENSE files in the repository root for full details. + background-color: $secondary-hairline-color; + user-select: none; + align-items: center; ++ max-width: calc(100% - 40px);; + + &:hover { + border-color: $quinary-content; +@@ -29,7 +30,6 @@ Please see LICENSE files in the repository root for full details. + } + + .mx_ReactionsRowButton_content { +- max-width: 100px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0012-On-space-switch-don-t-automatically-show-last-opened.patch b/patches/matrix-react-sdk/0012-On-space-switch-don-t-automatically-show-last-opened.patch new file mode 100644 index 0000000..b224046 --- /dev/null +++ b/patches/matrix-react-sdk/0012-On-space-switch-don-t-automatically-show-last-opened.patch @@ -0,0 +1,79 @@ +From b43bf7e8a183f36e30e9b79e3fc2dcd14afc6823 Mon Sep 17 00:00:00 2001 +From: su-ex +Date: Thu, 30 May 2024 14:35:16 +0200 +Subject: On space switch don't automatically show last opened room + +--- + src/components/structures/MatrixChat.tsx | 18 +++++++++++++++++- + src/settings/Settings.tsx | 6 ++++++ + src/stores/spaces/SpaceStore.ts | 1 + + 3 files changed, 24 insertions(+), 1 deletion(-) + +diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx +index 1726c8462d..150f29d0b8 100644 +--- a/src/components/structures/MatrixChat.tsx ++++ b/src/components/structures/MatrixChat.tsx +@@ -1448,7 +1448,15 @@ export default class MatrixChat extends React.PureComponent { + if (this.screenAfterLogin && this.screenAfterLogin.screen) { + this.showScreen(this.screenAfterLogin.screen, this.screenAfterLogin.params); + this.screenAfterLogin = undefined; +- } else if (localStorage && localStorage.getItem("mx_last_room_id")) { ++ } else if ( ++ !SettingsStore.getValue("Spaces.returnToPreviouslyOpenedRoom") && ++ localStorage && ++ localStorage.getItem("mx_active_space") && ++ localStorage.getItem("mx_active_space")[0] === "!" ++ ) { ++ // SC: Show the last viewed space ++ this.viewLastSpace(); ++ } else if (SettingsStore.getValue("Spaces.returnToPreviouslyOpenedRoom") && localStorage && localStorage.getItem("mx_last_room_id")) { + // Before defaulting to directory, show the last viewed room + this.viewLastRoom(); + } else { +@@ -1460,6 +1468,14 @@ export default class MatrixChat extends React.PureComponent { + } + } + ++ private viewLastSpace(): void { // SC ++ // SC-ToDo: Make this work for meta spaces ++ dis.dispatch({ ++ action: Action.ViewRoom, ++ room_id: localStorage.getItem("mx_active_space"), ++ }); ++ } ++ + private viewLastRoom(): void { + dis.dispatch({ + action: Action.ViewRoom, +diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx +index b668c65dfd..be4433e1bc 100644 +--- a/src/settings/Settings.tsx ++++ b/src/settings/Settings.tsx +@@ -203,6 +203,12 @@ export const SETTINGS: { [setting: string]: ISetting } = { + supportedLevels: LEVELS_ACCOUNT_SETTINGS, + default: true, + }, ++ "Spaces.returnToPreviouslyOpenedRoom": { ++ displayName: _td("Return to the room previously opened in a space"), ++ description: _td("If disabled, the space overview will be shown when switching to another space."), ++ supportedLevels: LEVELS_ACCOUNT_SETTINGS, ++ default: false, ++ }, + // SC settings end + "feature_video_rooms": { + isFeature: true, +diff --git a/src/stores/spaces/SpaceStore.ts b/src/stores/spaces/SpaceStore.ts +index 60df05478a..0be7ba190a 100644 +--- a/src/stores/spaces/SpaceStore.ts ++++ b/src/stores/spaces/SpaceStore.ts +@@ -265,6 +265,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { + // else if the last viewed room in this space is joined then view that + // else view space home or home depending on what is being clicked on + if ( ++ SettingsStore.getValue("Spaces.returnToPreviouslyOpenedRoom") && + roomId && + cliSpace?.getMyMembership() !== KnownMembership.Invite && + this.matrixClient.getRoom(roomId)?.getMyMembership() === KnownMembership.Join && +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0013-Exclude-spaces-from-breadcrumbs.patch b/patches/matrix-react-sdk/0013-Exclude-spaces-from-breadcrumbs.patch new file mode 100644 index 0000000..49b0d89 --- /dev/null +++ b/patches/matrix-react-sdk/0013-Exclude-spaces-from-breadcrumbs.patch @@ -0,0 +1,24 @@ +From 3aa2246c56ae3e5b7703003ef785d6e3ad77b844 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Tue, 9 Aug 2022 09:32:19 +0200 +Subject: Exclude spaces from breadcrumbs + +--- + src/stores/BreadcrumbsStore.ts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/stores/BreadcrumbsStore.ts b/src/stores/BreadcrumbsStore.ts +index 9859f24015..957b54286c 100644 +--- a/src/stores/BreadcrumbsStore.ts ++++ b/src/stores/BreadcrumbsStore.ts +@@ -137,6 +137,7 @@ export class BreadcrumbsStore extends AsyncStoreWithClient { + } + + private async appendRoom(room: Room): Promise { ++ if (room.isSpaceRoom()) return; + let updated = false; + const rooms = (this.state.rooms || []).slice(); // cheap clone + const msc3946ProcessDynamicPredecessor = SettingsStore.getValue("feature_dynamic_room_predecessors"); +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0014-Stop-the-search-bar-wobble.patch b/patches/matrix-react-sdk/0014-Stop-the-search-bar-wobble.patch new file mode 100644 index 0000000..e4b33fc --- /dev/null +++ b/patches/matrix-react-sdk/0014-Stop-the-search-bar-wobble.patch @@ -0,0 +1,24 @@ +From 288aa3cf8e56a4ca60810eac98fb6f692b154f61 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Mon, 19 Aug 2024 20:27:33 +0200 +Subject: Stop the search bar wobble + +--- + res/css/_common.pcss | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/res/css/_common.pcss b/res/css/_common.pcss +index 05a3dac067..7861af6381 100644 +--- a/res/css/_common.pcss ++++ b/res/css/_common.pcss +@@ -181,6 +181,7 @@ input[type="search"].mx_textinput_icon { + padding-left: 36px; + background-repeat: no-repeat; + background-position: 10px center; ++ min-height: 33px; + } + + /* FIXME THEME - Tint by CSS rather than referencing a duplicate asset */ +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0015-Import-SC-compound-theme-overrides.patch b/patches/matrix-react-sdk/0015-Import-SC-compound-theme-overrides.patch new file mode 100644 index 0000000..d823f0d --- /dev/null +++ b/patches/matrix-react-sdk/0015-Import-SC-compound-theme-overrides.patch @@ -0,0 +1,34 @@ +From a4bca41b7371c42499fd8c805482066514a9edc2 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Sun, 13 Oct 2024 11:23:54 +0200 +Subject: Import SC compound theme overrides + +--- + res/css/_common.pcss | 1 + + res/css/sc-cpd-overrides.css | 1 + + 2 files changed, 2 insertions(+) + create mode 120000 res/css/sc-cpd-overrides.css + +diff --git a/res/css/_common.pcss b/res/css/_common.pcss +index 7861af6381..f7a660a339 100644 +--- a/res/css/_common.pcss ++++ b/res/css/_common.pcss +@@ -11,6 +11,7 @@ Please see LICENSE files in the repository root for full details. + + @import url("@vector-im/compound-design-tokens/assets/web/css/compound-design-tokens.css") layer(compound); + @import url("@vector-im/compound-web/dist/style.css"); ++@import "./sc-cpd-overrides.css"; + @import "./_font-sizes.pcss"; + @import "./_animations.pcss"; + @import "./_spacing.pcss"; +diff --git a/res/css/sc-cpd-overrides.css b/res/css/sc-cpd-overrides.css +new file mode 120000 +index 0000000000..532e96fddc +--- /dev/null ++++ b/res/css/sc-cpd-overrides.css +@@ -0,0 +1 @@ ++../../../res/css/sc-cpd-overrides.css +\ No newline at end of file +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0016-No-damn-avatar-background-in-room-list.patch b/patches/matrix-react-sdk/0016-No-damn-avatar-background-in-room-list.patch new file mode 100644 index 0000000..2fa7d3a --- /dev/null +++ b/patches/matrix-react-sdk/0016-No-damn-avatar-background-in-room-list.patch @@ -0,0 +1,26 @@ +From fc577303d8c2d290f1c17e13deaf442822af68a1 Mon Sep 17 00:00:00 2001 +From: su-ex +Date: Tue, 7 Sep 2021 19:41:52 +0200 +Subject: No damn avatar background in room list + +--- + src/components/structures/BackdropPanel.tsx | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/components/structures/BackdropPanel.tsx b/src/components/structures/BackdropPanel.tsx +index 80c21235cc..a9c464f4b2 100644 +--- a/src/components/structures/BackdropPanel.tsx ++++ b/src/components/structures/BackdropPanel.tsx +@@ -13,6 +13,9 @@ interface IProps { + } + + export const BackdropPanel: React.FC = ({ backgroundImage, blurMultiplier }) => { ++ // SC: no damn avatar background in room list ++ return null; ++ + if (!backgroundImage) return null; + + const styles: CSSProperties = {}; +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0017-No-red-messages-in-1-1-chats-Close-SchildiChat-schil.patch b/patches/matrix-react-sdk/0017-No-red-messages-in-1-1-chats-Close-SchildiChat-schil.patch new file mode 100644 index 0000000..b81a35b --- /dev/null +++ b/patches/matrix-react-sdk/0017-No-red-messages-in-1-1-chats-Close-SchildiChat-schil.patch @@ -0,0 +1,29 @@ +From e4a7ea01c2fd9f7d67660402c20bfdc5969f28c4 Mon Sep 17 00:00:00 2001 +From: su-ex +Date: Tue, 22 Dec 2020 19:16:28 +0100 +Subject: No red messages in 1:1 chats Close SchildiChat/schildichat-desktop#13 + +--- + src/components/views/rooms/EventTile.tsx | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx +index 746cceabd8..3e5879f7ad 100644 +--- a/src/components/views/rooms/EventTile.tsx ++++ b/src/components/views/rooms/EventTile.tsx +@@ -685,6 +685,12 @@ export class UnwrappedEventTile extends React.Component + return false; + } + ++ // don't show highlights in 1:1 rooms ++ const room = cli.getRoom(this.props.mxEvent.getRoomId()); ++ if (room && room.currentState.getJoinedMemberCount() === 2) { ++ return false; ++ } ++ + return !!(actions?.tweaks.highlight || previousActions?.tweaks.highlight); + } + +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0018-Always-apply-corner-radius-to-all-edges-of-the-bubbl.patch b/patches/matrix-react-sdk/0018-Always-apply-corner-radius-to-all-edges-of-the-bubbl.patch new file mode 100644 index 0000000..76d5935 --- /dev/null +++ b/patches/matrix-react-sdk/0018-Always-apply-corner-radius-to-all-edges-of-the-bubbl.patch @@ -0,0 +1,61 @@ +From a37ca889b832578a9201a5b45b059f58eb781bc5 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Sun, 13 Oct 2024 13:26:16 +0200 +Subject: Always apply corner radius to all edges of the bubble + +--- + res/css/views/rooms/_EventBubbleTile.pcss | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/res/css/views/rooms/_EventBubbleTile.pcss b/res/css/views/rooms/_EventBubbleTile.pcss +index ec443c44de..8e0f3cf1b6 100644 +--- a/res/css/views/rooms/_EventBubbleTile.pcss ++++ b/res/css/views/rooms/_EventBubbleTile.pcss +@@ -277,6 +277,8 @@ Please see LICENSE files in the repository root for full details. + margin-inline: var(--EventTile_bubble_line-margin-inline-start) var(--EventTile_bubble_line-margin-inline-end); + border-top-left-radius: var(--cornerRadius); + border-top-right-radius: var(--cornerRadius); ++ border-bottom-left-radius: var(--cornerRadius); ++ border-bottom-right-radius: var(--cornerRadius); + + /* the selector here is quite weird because timestamps can appear linked & unlinked and in different places */ + /* in the DOM depending on the specific rendering context */ +@@ -371,7 +373,7 @@ Please see LICENSE files in the repository root for full details. + } + + &.mx_EventTile_continuation[data-self="false"] .mx_EventTile_line { +- border-top-left-radius: 0; ++ //border-top-left-radius: 0; + + .mx_MImageBody .mx_MImageBody_thumbnail_container, + .mx_MVideoBody .mx_MVideoBody_container, +@@ -379,7 +381,7 @@ Please see LICENSE files in the repository root for full details. + .mx_MediaBody, + .mx_MLocationBody_map, + .mx_MBeaconBody { +- border-top-left-radius: 0; ++ //border-top-left-radius: 0; + } + } + &.mx_EventTile_lastInSection[data-self="false"] .mx_EventTile_line { +@@ -396,7 +398,7 @@ Please see LICENSE files in the repository root for full details. + } + + &.mx_EventTile_continuation[data-self="true"] .mx_EventTile_line { +- border-top-right-radius: 0; ++ //border-top-right-radius: 0; + + .mx_MImageBody .mx_MImageBody_thumbnail_container, + .mx_MVideoBody .mx_MVideoBody_container, +@@ -404,7 +406,7 @@ Please see LICENSE files in the repository root for full details. + .mx_MediaBody, + .mx_MLocationBody_map, + .mx_MBeaconBody { +- border-top-right-radius: 0; ++ //border-top-right-radius: 0; + } + } + &.mx_EventTile_lastInSection[data-self="true"] .mx_EventTile_line { +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0019-Always-show-timestamps-by-default.patch b/patches/matrix-react-sdk/0019-Always-show-timestamps-by-default.patch new file mode 100644 index 0000000..8abccc6 --- /dev/null +++ b/patches/matrix-react-sdk/0019-Always-show-timestamps-by-default.patch @@ -0,0 +1,25 @@ +From 57942189da5f80069ee4b03dc2fbeb24ce6b4f7b Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Sun, 13 Oct 2024 13:53:07 +0200 +Subject: Always show timestamps by default + +--- + src/settings/Settings.tsx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx +index be4433e1bc..1052bca0c9 100644 +--- a/src/settings/Settings.tsx ++++ b/src/settings/Settings.tsx +@@ -662,7 +662,7 @@ export const SETTINGS: { [setting: string]: ISetting } = { + "alwaysShowTimestamps": { + supportedLevels: LEVELS_ACCOUNT_SETTINGS, + displayName: _td("settings|always_show_message_timestamps"), +- default: false, ++ default: true, + }, + "userTimezone": { + supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS, +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0021-Enable-custom-emote-rendering-by-default.patch b/patches/matrix-react-sdk/0021-Enable-custom-emote-rendering-by-default.patch new file mode 100644 index 0000000..2db22df --- /dev/null +++ b/patches/matrix-react-sdk/0021-Enable-custom-emote-rendering-by-default.patch @@ -0,0 +1,25 @@ +From 47bcb08e971256fe94a0b07fb553b75400e648ed Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Thu, 17 Oct 2024 19:40:51 +0200 +Subject: Enable custom emote rendering by default + +--- + src/settings/Settings.tsx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx +index 1052bca0c9..f5fcb5d7a5 100644 +--- a/src/settings/Settings.tsx ++++ b/src/settings/Settings.tsx +@@ -514,7 +514,7 @@ export const SETTINGS: { [setting: string]: ISetting } = { + description: _td("labs|render_reaction_images_description"), + supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED, + supportedLevelsAreOrdered: true, +- default: false, ++ default: true, + }, + /** + * With the transition to Compound we are moving to a base font size +-- +2.47.0 + diff --git a/patches/matrix-react-sdk/0022-Don-t-symlink-css-to-fix-Windows-native-build.patch b/patches/matrix-react-sdk/0022-Don-t-symlink-css-to-fix-Windows-native-build.patch new file mode 100644 index 0000000..124a69c --- /dev/null +++ b/patches/matrix-react-sdk/0022-Don-t-symlink-css-to-fix-Windows-native-build.patch @@ -0,0 +1,32 @@ +From 16fe0fe8d0068e4c5da3fa5516c5578d2ffaabc7 Mon Sep 17 00:00:00 2001 +From: SpiritCroc +Date: Sun, 20 Oct 2024 17:00:19 +0200 +Subject: Don't symlink css to fix Windows-native build + +--- + .gitignore | 2 ++ + res/css/sc-cpd-overrides.css | 1 - + 2 files changed, 2 insertions(+), 1 deletion(-) + delete mode 120000 res/css/sc-cpd-overrides.css + +diff --git a/.gitignore b/.gitignore +index 3137cd555b..5345301b97 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,3 +1,5 @@ ++res/css/sc-*.css ++ + /.npmrc + /*.log + package-lock.json +diff --git a/res/css/sc-cpd-overrides.css b/res/css/sc-cpd-overrides.css +deleted file mode 120000 +index 532e96fddc..0000000000 +--- a/res/css/sc-cpd-overrides.css ++++ /dev/null +@@ -1 +0,0 @@ +-../../../res/css/sc-cpd-overrides.css +\ No newline at end of file +-- +2.47.0 + diff --git a/publish_release.sh b/publish_release.sh deleted file mode 100755 index cd5874c..0000000 --- a/publish_release.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -set -e - -mydir="$(dirname "$(realpath "$0")")" - -pushd "$mydir" > /dev/null - -source ./merge_helpers.sh - -# Check branch -check_branch $branch -forall_repos check_branch $branch - -# Ensure clean git state -forall_repos check_clean_git - -git fetch origin -git branch -D master || true -git checkout -b master --track origin/master -git merge --ff-only sc -git push -git checkout sc -forall_repos git fetch origin -forall_repos git branch -D master || true -forall_repos git checkout -b master --track origin/master -forall_repos git merge --ff-only sc -forall_repos git push -forall_repos git checkout sc - -popd > /dev/null diff --git a/push_current_sc_branches.sh b/push_current_sc_branches.sh new file mode 100755 index 0000000..7a34314 --- /dev/null +++ b/push_current_sc_branches.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -e + +mydir="$(dirname "$(realpath "$0")")" +pushd "$mydir" > /dev/null + +source ./merge_helpers.sh + +get_branch_of() { + local repo="$1" + pushd "$repo" > /dev/null + local b=`git branch --show-current` + if [[ "$b" = sc_v* ]]; then + echo "$b" + else + >&2 echo "Unexpected branch name for $repo: $b" + exit 1 + fi + popd > /dev/null +} + +b_js=`get_branch_of matrix-js-sdk` +b_react=`get_branch_of matrix-react-sdk` +b_web=`get_branch_of element-web` +b_desktop=`get_branch_of element-desktop` + +if [ "$b_js" != "$b_react" ] || [ "$b_react" != "$b_web" ] || [ "$b_web" != "$b_desktop" ]; then + echo "Detected branch name mismatch!" + echo "js-sdk: $b_js" + echo "react-sdk: $b_react" + echo "element-web: $b_web" + echo "element-desktop: $b_desktop" + exit 1 +fi + +branch="$b_js" + +echo "Pushing to all repos: $branch" +forall_repos git push --set-upstream origin "$branch" "$@" diff --git a/res/css/sc-cpd-overrides.css b/res/css/sc-cpd-overrides.css new file mode 100644 index 0000000..a9987b0 --- /dev/null +++ b/res/css/sc-cpd-overrides.css @@ -0,0 +1,174 @@ +/* + * Upstream file for reference: + * - Dark: https://github.com/element-hq/compound-design-tokens/blob/main/assets/web/css/cpd-theme-dark-base.css + * - Light: https://github.com/element-hq/compound-design-tokens/blob/main/assets/web/css/cpd-theme-light-base.css + */ + +.cpd-theme-dark.cpd-theme-dark { + --cpd-color-text-primary: rgba(255, 255, 255, 0.9); + --cpd-color-text-secondary: rgba(255, 255, 255, 0.65); + /* TODO? + --cpd-color-alpha-green-1400: hsla(152, 88%, 94%, 0.96); + --cpd-color-alpha-green-1300: hsla(152, 93%, 88%, 0.91); + --cpd-color-alpha-green-1200: hsla(156, 97%, 76%, 0.83); + --cpd-color-alpha-green-1100: hsla(162, 98%, 57%, 0.74); + --cpd-color-alpha-green-1000: hsla(163, 99%, 55%, 0.65); + --cpd-color-alpha-green-900: hsla(164, 98%, 53%, 0.58); + --cpd-color-alpha-green-800: hsl(168, 100%, 24%, 1); + --cpd-color-alpha-green-700: hsl(165, 100%, 18%, 1); + --cpd-color-alpha-green-600: hsl(162, 100%, 14%, 1); + --cpd-color-alpha-green-500: hsl(160, 100%, 12%, 1); + --cpd-color-alpha-green-400: hsl(155, 100%, 9%, 1); + --cpd-color-alpha-green-300: hsl(151, 100%, 7%, 1); + --cpd-color-alpha-green-200: hsl(147, 100%, 6%, 1); + --cpd-color-alpha-green-100: hsl(144, 100%, 6%, 1); + + --cpd-color-alpha-gray-1400: hsla(214, 78%, 98%, 0.95); + --cpd-color-alpha-gray-1300: hsla(213, 73%, 97%, 0.89); + --cpd-color-alpha-gray-1200: hsla(215, 74%, 96%, 0.79); + --cpd-color-alpha-gray-1100: hsla(215, 92%, 95%, 0.68); + --cpd-color-alpha-gray-1000: hsla(213, 93%, 94%, 0.61); + --cpd-color-alpha-gray-900: hsla(211, 94%, 94%, 0.54); + --cpd-color-alpha-gray-800: hsla(216, 100%, 94%, 0.41); + --cpd-color-alpha-gray-700: hsla(213, 85%, 95%, 0.27); + --cpd-color-alpha-gray-600: hsla(225, 46%, 95%, 0.2); + --cpd-color-alpha-gray-500: hsla(214, 41%, 97%, 0.15); + --cpd-color-alpha-gray-400: hsla(270, 37%, 93%, 0.1); + --cpd-color-alpha-gray-200: hsla(286, 31%, 82%, 0.04); + --cpd-color-alpha-gray-100: hsla(214, 10%, 86%, 0.02); + */ + /* Hover of room list items, search bar bg, space icon bg */ + --cpd-color-alpha-gray-300: rgba(255, 255, 255, 0.06); + + /* TODO more accent variants? */ + --cpd-color-green-1400: #F1F8E9; + --cpd-color-green-1300: #DCEDC8; + --cpd-color-green-1200: #C5E1A5; + --cpd-color-green-1100: #AED581; + --cpd-color-green-1000: #9CCC65; + --cpd-color-green-900: #8BC34A; + --cpd-color-green-800: #8BC34A; + --cpd-color-green-700: #8BC34A; + --cpd-color-green-600: #8BC34A; + --cpd-color-green-500: #8BC34A; + --cpd-color-green-400: #689F38; + --cpd-color-green-300: #33691E; + --cpd-color-green-200: #33691E; + --cpd-color-green-100: #33691E; + + /* TODO + --cpd-color-red-1400: #ffe9e6; + --cpd-color-red-1300: #ffd4cd; + --cpd-color-red-1200: #ffaea4; + --cpd-color-red-1100: #ff877c; + --cpd-color-red-1000: #ff665d; + --cpd-color-red-900: #fd3e3c; + --cpd-color-red-800: #d1212a; + --cpd-color-red-700: #9f0d1e; + --cpd-color-red-600: #830009; + --cpd-color-red-500: #710000; + --cpd-color-red-400: #590000; + --cpd-color-red-300: #470000; + --cpd-color-red-200: #3e0000; + --cpd-color-red-100: #370000; + */ + + --cpd-color-gray-1400: #eeeeee; + --cpd-color-gray-1300: #e0e0e0; + --cpd-color-gray-1200: #b3b3b3; + --cpd-color-gray-1100: #aaaaaa; + --cpd-color-gray-1000: #9e9e9e; + --cpd-color-gray-900: #808080; + --cpd-color-gray-800: #757575; + --cpd-color-gray-700: #424242; + --cpd-color-gray-600: #424242; + --cpd-color-gray-500: #424242; + --cpd-color-gray-400: #303030; + --cpd-color-gray-300: #212121; + --cpd-color-gray-200: #212121; + --cpd-color-gray-100: #171717; + --cpd-color-theme-bg: #171717; +} + +.cpd-theme-light.cpd-theme-light { + /* TODO? + --cpd-color-alpha-gray-1400: hsla(223, 64%, 2%, 0.9); + --cpd-color-alpha-gray-1300: hsla(225, 57%, 3%, 0.84); + --cpd-color-alpha-gray-1200: hsla(213, 73%, 3%, 0.77); + --cpd-color-alpha-gray-1100: hsla(215, 74%, 5%, 0.71); + --cpd-color-alpha-gray-1000: hsla(218, 79%, 6%, 0.66); + --cpd-color-alpha-gray-900: hsla(213, 83%, 7%, 0.61); + --cpd-color-alpha-gray-800: hsla(213, 87%, 9%, 0.5); + --cpd-color-alpha-gray-700: hsla(215, 96%, 10%, 0.35); + --cpd-color-alpha-gray-600: hsla(212, 97%, 12%, 0.26); + --cpd-color-alpha-gray-500: hsla(212, 87%, 15%, 0.2); + --cpd-color-alpha-gray-400: hsla(213, 90%, 20%, 0.12); + --cpd-color-alpha-gray-300: hsla(216, 89%, 18%, 0.06); + --cpd-color-alpha-gray-200: hsla(200, 41%, 36%, 0.04); + --cpd-color-alpha-gray-100: hsla(210, 48%, 41%, 0.02); + + --cpd-color-alpha-green-1400: hsl(149, 100%, 7%, 1); + --cpd-color-alpha-green-1300: hsl(157, 100%, 10%, 1); + --cpd-color-alpha-green-1200: hsl(162, 100%, 14%, 1); + --cpd-color-alpha-green-1100: hsl(165, 100%, 18%, 1); + --cpd-color-alpha-green-1000: hsl(166, 100%, 21%, 1); + --cpd-color-alpha-green-900: hsl(168, 100%, 24%, 1); + --cpd-color-alpha-green-800: hsl(166, 100%, 30%, 1); + --cpd-color-alpha-green-700: hsla(163, 99%, 38%, 0.96); + --cpd-color-alpha-green-600: hsla(156, 99%, 36%, 0.56); + --cpd-color-alpha-green-500: hsla(154, 96%, 37%, 0.41); + --cpd-color-alpha-green-400: hsla(151, 93%, 37%, 0.23); + --cpd-color-alpha-green-300: hsla(150, 100%, 36%, 0.11); + --cpd-color-alpha-green-200: hsla(150, 79%, 41%, 0.06); + --cpd-color-alpha-green-100: hsla(156, 79%, 41%, 0.03); + */ + + /* TODO accent variants? */ + --cpd-color-green-1400: #33691E; + --cpd-color-green-1300: #33691E; + --cpd-color-green-1200: #33691E; + --cpd-color-green-1100: #33691E; + --cpd-color-green-1000: #33691E; + --cpd-color-green-900: #33691E; + --cpd-color-green-800: #33691E; + --cpd-color-green-700: #8BC34A; + --cpd-color-green-600: #8BC34A; + --cpd-color-green-500: #8BC34A; + --cpd-color-green-400: #8BC34A; + --cpd-color-green-300: #C5E1A5; + --cpd-color-green-200: #DCEDC8; + --cpd-color-green-100: #F1F8E9; + + /* TODO + --cpd-color-red-1400: #450000; + --cpd-color-red-1300: #620000; + --cpd-color-red-1200: #850006; + --cpd-color-red-1100: #a4041d; + --cpd-color-red-1000: #bc0f22; + --cpd-color-red-900: #d51928; + --cpd-color-red-800: #ff3d3d; + --cpd-color-red-700: #ff8c81; + --cpd-color-red-600: #ffafa5; + --cpd-color-red-500: #ffc5bc; + --cpd-color-red-400: #ffdfda; + --cpd-color-red-300: #ffefec; + --cpd-color-red-200: #fff7f6; + --cpd-color-red-100: #fffaf9; + */ + + --cpd-color-gray-1400: #212121; + --cpd-color-gray-1300: #212121; + --cpd-color-gray-1200: #424242; + --cpd-color-gray-1100: #424242; + --cpd-color-gray-1000: #616161; + --cpd-color-gray-900: #616161; + --cpd-color-gray-800: #808080; + --cpd-color-gray-700: #b3b3b3; + --cpd-color-gray-600: #b3b3b3; + --cpd-color-gray-500: #cdd3da; + --cpd-color-gray-400: #e0e0e0; + --cpd-color-gray-300: #f5f5f5; + --cpd-color-gray-200: #f5f5f5; + --cpd-color-gray-100: #fafafa; + --cpd-color-theme-bg: #ffffff; +} diff --git a/setup.sh b/setup.sh index 98aabe1..65e945a 100755 --- a/setup.sh +++ b/setup.sh @@ -25,9 +25,15 @@ popd pushd element-desktop $yarn install -ln -s ../element-web/webapp ./ || true +# Seshat: compare https://github.com/element-hq/element-desktop/blob/develop/docs/native-node-modules.md#adding-seshat-for-search-in-e2e-encrypted-rooms +$yarn add matrix-seshat +#$yarn add electron-build-env +#$yarn run electron-build-env -- --electron "$electron_version" -- neon build matrix-seshat --release popd pushd i18n-helper $yarn install popd + +# CSS overrides +cp res/css/* matrix-react-sdk/res/css/ diff --git a/theme.sh b/theme.sh new file mode 100755 index 0000000..2255068 --- /dev/null +++ b/theme.sh @@ -0,0 +1,189 @@ +#!/bin/bash + +set -e +shopt -s globstar + +mydir="$(dirname "$(realpath "$0")")" +automatic_commit="$1" + +pushd "$mydir/matrix-react-sdk" > /dev/null + +if [[ "$automatic_commit" == [Yy]* ]]; then + # Require clean git state + uncommitted=`git status --porcelain` + if [ ! -z "$uncommitted" ]; then + echo "Uncommitted changes are present, please commit first!" + exit 1 + fi +fi + +M_ACCENT="#8bc34a" +M_ACCENT_DEC="139, 195, 74" +M_ACCENT_DARK="#33691e" +M_ACCENT_LIGHT="#dcedc8" +M_ALERT="#e53935" +M_LINK="#368bd6" + +replace_colors() { + local f="$1" + if [[ "$f" =~ "dark" ]]; then + echo "Replacing colors (dark) for $f..." + BG_ACCENT="$M_ACCENT_DARK" + CODEBLOCK_BORDER_COLOR="#121212" + CODEBLOCK_BACKGROUND_COLOR="#121212" + PILL_COLOR="rgba(255, 255, 255, 0.15)" + PILL_HOVER_COLOR="rgba(255, 255, 255, 0.18)" + PRESENCE_OFFLINE="#e0e0e0" # not applied because not existing specifically for dark + MESSAGE_BUBBLE_BACKGROUND="#424242" + MESSAGE_BUBBLE_BACKGROUND_SELF="#303030" + MESSAGE_BUBBLE_BACKGROUND_SELECTED="#212121" + ROOMLIST_BG_COLOR="#303030" + SPACELIST_BG_COLOR="#424242" + else + echo "Replacing colors (light) for $f..." + BG_ACCENT="$M_ACCENT_LIGHT" + CODEBLOCK_BORDER_COLOR="#00000010" + CODEBLOCK_BACKGROUND_COLOR="#00000010" + PILL_COLOR="rgba(0, 0, 0, 0.13)" + PILL_HOVER_COLOR="rgba(0, 0, 0, 0.1)" + PRESENCE_OFFLINE="#bdbdbd" # for light this should actually be darker + MESSAGE_BUBBLE_BACKGROUND="#eeeeee" + MESSAGE_BUBBLE_BACKGROUND_SELF="#f1f8e9" + MESSAGE_BUBBLE_BACKGROUND_SELECTED="#e0e0e0" + ROOMLIST_BG_COLOR="#eeeeee" + SPACELIST_BG_COLOR="#fafafa" + fi + # Neutral colors + sed -i 's|#15171b|#212121|gi' "$f" + sed -i 's|#15191E|#212121|gi' "$f" + sed -i 's|#2e2f32|#212121|gi' "$f" + sed -i 's|#232f32|#212121|gi' "$f" + sed -i 's|#27303a|#212121|gi' "$f" + sed -i 's|#17191C|#212121|gi' "$f" + sed -i 's|#181b21|#303030|gi' "$f" + sed -i 's|#1A1D23|#303030|gi' "$f" + sed -i 's|#20252B|#303030|gi' "$f" + sed -i 's|#20252c|#303030|gi' "$f" + sed -i 's|#21262c|#383838|gi' "$f" # selection/hover color + sed -i 's|#238cf5|#303030|gi' "$f" + sed -i 's|#25271F|#303030|gi' "$f" + sed -i 's|#272c35|#303030|gi' "$f" + sed -i 's|#2a3039|#303030|gi' "$f" + sed -i 's|#343a46|#424242|gi' "$f" + sed -i 's|#3c4556|#424242|gi' "$f" + sed -i 's|#3d3b39|#424242|gi' "$f" + sed -i 's|#45474a|#424242|gi' "$f" + sed -i 's|#454545|#424242|gi' "$f" + sed -i 's|#2e3649|#424242|gi' "$f" + sed -i 's|#4e5054|#424242|gi' "$f" + sed -i 's|#394049|#424242|gi' "$f" + sed -i 's|#3e444c|#424242|gi' "$f" + sed -i 's|#61708b|#616161|gi' "$f" + sed -i 's|#616b7f|#616161|gi' "$f" + sed -i 's|#5c6470|#616161|gi' "$f" + sed -i 's|#545a66|#616161|gi' "$f" # pill hover bg color + sed -i 's|#737D8C|#757575|gi' "$f" + sed -i 's|#6F7882|#757575|gi' "$f" + sed -i 's|#91A1C0|#757575|gi' "$f" # icon in button color + sed -i 's|#8D99A5|#808080|gi' "$f" + sed -i 's|#8E99A4|#808080|gi' "$f" # maybe use #9e9e9e instead + sed -i 's|#8D97A5|#808080|gi' "$f" + sed -i 's|#a2a2a2|#9e9e9e|gi' "$f" + sed -i 's|#9fa9ba|#aaaaaa|gi' "$f" # maybe use #9e9e9e instead + sed -i 's|#acacac|#aaaaaa|gi' "$f" # maybe use #9e9e9e instead + sed -i 's|#B9BEC6|#b3b3b3|gi' "$f" # maybe use #bdbdbd instead + sed -i 's|#a1b2d1|#b3b3b3|gi' "$f" + sed -i 's|#A9B2BC|#b3b3b3|gi' "$f" + sed -i 's|#C1C6CD|#bdbdbd|gi' "$f" + sed -i 's|#c1c9d6|#bdbdbd|gi' "$f" + sed -i 's|#c8c8cd|#cccccc|gi' "$f" # maybe use #bdbdbd instead + # sed -i 's|#dddddd|#e0e0e0|gi' "$f" # really? + sed -i 's|#e7e7e7|#e0e0e0|gi' "$f" + sed -i 's|#e3e8f0|#e0e0e0|gi' "$f" + sed -i 's|#e9e9e9|#e0e0e0|gi' "$f" + sed -i 's|#e9edf1|#e0e0e0|gi' "$f" + sed -i 's|#e8eef5|#e0e0e0|gi' "$f" + sed -i 's|#deddfd|#e0e0e0|gi' "$f" # $location-live-secondary-color, what to use really? + sed -i 's|#edf3ff|#eeeeee|gi' "$f" + sed -i 's|#f4f6fa|#f5f5f5|gi' "$f" + sed -i 's|#f6f7f8|#f5f5f5|gi' "$f" + sed -i 's|#f2f5f8|#f5f5f5|gi' "$f" + sed -i 's|#f5f8fa|#f5f5f5|gi' "$f" + sed -i 's|#f3f8fd|#fafafa|gi' "$f" + sed -i 's|rgba(33, 38, 34,|rgba(48, 48, 48,|gi' "$f" + sed -i 's|rgba(33, 38, 44,|rgba(48, 48, 48,|gi' "$f" + sed -i 's|rgba(34, 38, 46,|rgba(48, 48, 48,|gi' "$f" + sed -i 's|rgba(38, 39, 43,|rgba(48, 48, 48,|gi' "$f" + sed -i 's|rgba(38, 40, 45,|rgba(48, 48, 48,|gi' "$f" + sed -i 's|rgba(46, 48, 51,|rgba(48, 48, 48,|gi' "$f" + sed -i 's|rgba(92, 100, 112,|rgba(97, 97, 97,|gi' "$f" + sed -i 's|rgba(141, 151, 165,|rgba(144, 144, 144,|gi' "$f" + sed -i 's|rgba(242, 245, 248,|rgba(248, 248, 248,|gi' "$f" + + sed -i "s|\\(\$event-highlight-bg-color: \\).*;|\\1transparent;|gi" "$f" + sed -i "s|\\(\$preview-widget-bar-color: \\).*;|\\1#bdbdbd;|gi" "$f" + sed -i "s|\\(\$blockquote-bar-color: \\).*;|\\1#bdbdbd;|gi" "$f" + sed -i "s|\\(\$pill-bg-color: \\).*;|\\1$PILL_COLOR;|gi" "$f" + sed -i "s|\\(\$pill-hover-bg-color: \\).*;|\\1$PILL_HOVER_COLOR;|gi" "$f" + + sed -i "s|\\(\$inlinecode-border-color: \\).*;|\\1$CODEBLOCK_BORDER_COLOR;|gi" "$f" + sed -i "s|\\(\$inlinecode-background-color: \\).*;|\\1$CODEBLOCK_BACKGROUND_COLOR;|gi" "$f" + sed -i "s|\\(\$codeblock-background-color: \\).*;|\\1$CODEBLOCK_BACKGROUND_COLOR;|gi" "$f" + + sed -i "s|\\(\$presence-offline: \\).*;|\\1$PRESENCE_OFFLINE;|gi" "$f" + + sed -i "s|\\(\$roomlist-bg-color: \\).*;|\\1$ROOMLIST_BG_COLOR;|gi" "$f" + sed -i "s|\\(\$spacePanel-bg-color: \\).*;|\\1$SPACELIST_BG_COLOR;|gi" "$f" + + # Accent colors + sed -i "s|#368bd6|$M_ACCENT|gi" "$f" + sed -i "s|#ac3ba8|$M_ACCENT|gi" "$f" + sed -i "s|#0DBD8B|$M_ACCENT|gi" "$f" + sed -i "s|#e64f7a|$M_ACCENT|gi" "$f" + sed -i "s|#ff812d|$M_ACCENT|gi" "$f" + sed -i "s|#2dc2c5|$M_ACCENT|gi" "$f" + sed -i "s|#5c56f5|$M_ACCENT|gi" "$f" + sed -i "s|#74d12c|$M_ACCENT|gi" "$f" + sed -i "s|#76CFA6|$M_ACCENT|gi" "$f" + sed -i "s|#03b381|$M_ACCENT|gi" "$f" + sed -i "s|rgba(3, 179, 129,|rgba($M_ACCENT_DEC,|gi" "$f" + sed -i "s|#03b381|$M_ACCENT|gi" "$f" + sed -i "s|#FF5B55|$M_ALERT|gi" "$f" + sed -i "s|\\(\$accent-alt: \\).*;|\\1$M_LINK;|gi" "$f" + #sed -i "s|\\(\$accent-darker: \\).*;|\\1$M_ACCENT_DARK;|gi" "$f" + sed -i "s|\\(\$roomtile-default-badge-bg-color: \\).*;|\\1$M_ACCENT;|gi" "$f" + #sed -i "s|\\(\$input-focused-border-color: \\).*;|\\1\$accent;|gi" "$f" # not existing anymore, need replacement? + sed -i "s|\\(\$reaction-row-button-selected-bg-color: \\).*;|\\1$BG_ACCENT;|gi" "$f" + + # e2e colors + sed -i "s|\\(\$e2e-verified-color: \\).*;|\\1$M_ACCENT;|gi" "$f" + sed -i "s|\\(\$e2e-unknown-color: \\).*;|\\1#ffc107;|gi" "$f" + sed -i "s|\\(\$e2e-unverified-color: \\).*;|\\1#ffc107;|gi" "$f" + sed -i "s|\\(\$e2e-warning-color: \\).*;|\\1$M_ALERT;|gi" "$f" + + # Message bubbles + sed -i "s|\\(\$eventbubble-self-bg: \\).*;|\$eventbubble-self-bg: $MESSAGE_BUBBLE_BACKGROUND_SELF;|gi" "$f" + sed -i "s|\\(\$eventbubble-others-bg: \\).*;|\$eventbubble-others-bg: $MESSAGE_BUBBLE_BACKGROUND;|gi" "$f" + sed -i "s|\\(\$eventbubble-bg-hover: \\).*;|\$eventbubble-bg-hover: $MESSAGE_BUBBLE_BACKGROUND_SELECTED;|gi" "$f" + #sed -i "s|\\(\$eventbubble-reply-color: \\).*;$||gi" "$f" +} + +replace_colors res/themes/light/css/light.pcss +replace_colors res/themes/light/css/_light.pcss +replace_colors res/themes/legacy-light/css/legacy-light.pcss +replace_colors res/themes/legacy-light/css/_legacy-light.pcss +replace_colors res/themes/dark/css/dark.pcss +replace_colors res/themes/dark/css/_dark.pcss +replace_colors res/themes/legacy-dark/css/legacy-dark.pcss +replace_colors res/themes/legacy-dark/css/_legacy-dark.pcss +for f in res/**/*.svg; do + replace_colors "$f" +done + +if [[ "$automatic_commit" == [Yy]* ]]; then + # see: https://devops.stackexchange.com/a/5443 + git add -A + git diff-index --quiet HEAD || git commit -m "Automatic theme update" +fi + +popd > /dev/null