Rebrand as HealthChat and pin the account provider to healthchat.ch

Applies the HealthChat product identity through the fork seams upstream already
provides, so no upstream logic files are touched and merges stay clean.

- Variants/HealthChat/healthchat.yml holds the identity scalars (display name,
  bundle id ch.healthchat.element, app group, development team) and is included
  permanently from project.yml. APP_NAME stays ElementX so the module name and
  @testable import ElementX keep working.
- ElementX/Sources/AppHooks/HealthChat/ registers an AppSettings hook pinning
  accountProviders to healthchat.ch with other providers disabled, push through
  sygnal.healthchat.ch and a custom-scheme OIDC redirect; plus a Compound hook
  recolouring the accent token family to the HealthChat blue.
- Entitlements are edited directly in ElementX/SupportingFiles/target.yml rather
  than in the variant, because XcodeGen concatenates arrays on include-merge and
  a variant can override scalars but cannot remove array entries. Drops the
  Element Classic app group and keychain group, and narrows associated domains
  to app.healthchat.ch, keeping matrix.to for permalinks.
- Info.plist CFBundleName now follows APP_DISPLAY_NAME — it, not
  CFBundleDisplayName, is what the web authentication sign-in alert shows.
- App logo and app icon assets swapped in place; the onboarding welcome title
  moves to a new screen_onboarding_welcome_title_ios untranslated string.
This commit is contained in:
2026-07-15 08:46:31 +02:00
committed by Sedat Qaja
parent c6d21dcd7f
commit 3d1fa27a4b
19 changed files with 405 additions and 477 deletions
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

After

Width:  |  Height:  |  Size: 265 KiB

@@ -1,15 +1,23 @@
{
"images" : [
{
"filename" : "app-logo.pdf",
"idiom" : "universal"
"filename" : "app-logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "app-logo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "app-logo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

@@ -1,4 +1,5 @@
"screen_home_tab_search" = "Search";
"screen_onboarding_welcome_title_ios" = "Welcome to HealthChat";
"screen_search_empty_state_message" = "Search for chats and messages";
"screen_search_empty_state_title" = "Start searching...";
"screen_search_no_results_message" = "There are no results for “%1$@.” Try a new search term.";
@@ -0,0 +1,21 @@
//
// Copyright 2026 Novaloop AG
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
/// Registers the HealthChat hooks.
///
/// `AppHooks` is a concrete type and `AppCoordinator` calls `setUp()` on it directly, so this method
/// wins over the empty `AppHooksProtocol` default via static dispatch — mirroring how Element's own
/// Enterprise fork provides its `setUp()`. This file is compiled only into the main app; the NSE and
/// Share Extension keep the empty default (they never drive authentication).
extension AppHooks {
func setUp() {
#if IS_MAIN_APP
registerAppSettingsHook(HealthChatAppSettingsHook())
registerCompoundHook(HealthChatCompoundHook())
#endif
}
}
@@ -0,0 +1,40 @@
//
// Copyright 2026 Novaloop AG
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import Foundation
/// Pins HealthChat's server, OIDC and push configuration by overriding `AppSettings` at startup.
///
/// - `accountProviders` / `allowOtherAccountProviders` lock every user to `healthchat.ch` (the server name;
/// `.well-known` delegates to `matrix.healthchat.ch`) and hide the change-server / create-account UI.
/// - `oAuthRedirectURL` uses the app's own URL scheme so the OIDC/MAS callback needs no associated domain.
/// - Legacy `element.io` help/encryption/copyright URLs are passed through unchanged for now.
struct HealthChatAppSettingsHook: AppSettingsHookProtocol {
func configure(_ appSettings: AppSettings) -> AppSettings {
appSettings.override(accountProviders: ["healthchat.ch"],
allowOtherAccountProviders: false,
hideBrandChrome: false,
pushGatewayBaseURL: "https://sygnal.healthchat.ch",
oAuthRedirectURL: "ch.healthchat.element:/oauth/callback",
websiteURL: "https://healthchat.ch",
logoURL: "https://app.healthchat.ch/themes/element/img/logos/element-logo.png",
copyrightURL: appSettings.copyrightURL,
acceptableUseURL: "https://www.healthchat.ch/datenschutz",
privacyURL: "https://www.healthchat.ch/datenschutz",
encryptionURL: appSettings.encryptionURL,
deviceVerificationURL: appSettings.deviceVerificationURL,
chatBackupDetailsURL: appSettings.chatBackupDetailsURL,
identityPinningViolationDetailsURL: appSettings.identityPinningViolationDetailsURL,
historySharingDetailsURL: appSettings.historySharingDetailsURL,
elementWebHosts: ["app.healthchat.ch"],
accountProvisioningHost: appSettings.accountProvisioningHost,
bugReportApplicationID: appSettings.bugReportApplicationID,
analyticsTermsURL: appSettings.analyticsTermsURL,
mapTilerConfiguration: AppSettings.bundledMapTilerConfiguration)
return appSettings
}
}
@@ -0,0 +1,33 @@
//
// Copyright 2026 Novaloop AG
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import UIKit
/// HealthChat brand palette, ported from the legacy Element iOS client.
/// These light/dark values are applied to Compound's accent token family by `HealthChatCompoundHook`.
///
/// **Note:** `nonisolated` is required. This target defaults to `MainActor` isolation, but UIKit resolves
/// the dynamic colour providers below on SwiftUI's render thread, which traps on an isolated closure.
nonisolated enum HealthChatBrandColors {
/// Primary brand blue — light `#1F4D85`, dark `#376A91`.
static let brand = dynamic(light: hex(0x1F4D85), dark: hex(0x376A91))
/// Pressed state — a slightly darker brand blue.
static let brandPressed = dynamic(light: hex(0x17385F), dark: hex(0x2A5171))
/// Subtle accent background / tint — light `#EBF0F7`, dark `#1A2D47`.
static let tint = dynamic(light: hex(0xEBF0F7), dark: hex(0x1A2D47))
private static func dynamic(light: UIColor, dark: UIColor) -> UIColor {
UIColor { $0.userInterfaceStyle == .dark ? dark : light }
}
private static func hex(_ value: Int, alpha: CGFloat = 1) -> UIColor {
UIColor(red: CGFloat((value >> 16) & 0xFF) / 255,
green: CGFloat((value >> 8) & 0xFF) / 255,
blue: CGFloat(value & 0xFF) / 255,
alpha: alpha)
}
}
@@ -0,0 +1,84 @@
//
// Copyright 2026 Novaloop AG
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import Compound
import SwiftUI
import UIKit
/// Recolours Compound's accent token family to the HealthChat brand.
/// Applied once at startup from `AppCoordinator` via `AppHooks.compoundHook`. Because the override
/// runs at app startup (not in previews), preview snapshots keep the default Compound colours.
struct HealthChatCompoundHook: CompoundHookProtocol {
func override(colors: CompoundColors, uiColors: CompoundUIColors) {
let brand = HealthChatBrandColors.brand
let tint = HealthChatBrandColors.tint
// Solid accent → brand blue (primary + send buttons, links, accent icons, badges, borders).
// NB: bgAccentRest is a SOLID fill (behind a white icon on the send button), not a subtle tint.
let solidColorTokens: [KeyPath<CompoundColorTokens, Color>] = [
\.bgActionPrimaryRest,
\.bgAccentRest,
\.iconAccentPrimary,
\.iconAccentTertiary,
\.textActionPrimary,
\.textActionAccent,
\.textLinkExternal,
\.borderInteractivePrimary,
\.textBadgeAccent
]
let solidUIColorTokens: [KeyPath<CompoundUIColorTokens, UIColor>] = [
\.bgActionPrimaryRest,
\.bgAccentRest,
\.iconAccentPrimary,
\.iconAccentTertiary,
\.textActionPrimary,
\.textActionAccent,
\.textLinkExternal,
\.borderInteractivePrimary,
\.textBadgeAccent
]
for keyPath in solidColorTokens {
colors.override(keyPath, with: Color(brand))
}
for keyPath in solidUIColorTokens {
uiColors.override(keyPath, with: brand)
}
// Primary button pressed state. The disabled state stays Compound's neutral grey.
colors.override(\.bgActionPrimaryPressed, with: Color(HealthChatBrandColors.brandPressed))
uiColors.override(\.bgActionPrimaryPressed, with: HealthChatBrandColors.brandPressed)
// Gradient "super"/action buttons → brand blue (SwiftUI-only concept).
let gradientTokens: [KeyPath<CompoundColorTokens, Color>] = [
\.gradientActionStop1,
\.gradientActionStop2,
\.gradientActionStop3,
\.gradientActionStop4
]
for keyPath in gradientTokens {
colors.override(keyPath, with: Color(brand))
}
// Subtle accent backgrounds (paired with accent-coloured foregrounds) → brand tint.
let tintColorTokens: [KeyPath<CompoundColorTokens, Color>] = [
\.bgAccentSelected,
\.bgBadgeAccent,
\.borderAccentSubtle
]
let tintUIColorTokens: [KeyPath<CompoundUIColorTokens, UIColor>] = [
\.bgAccentSelected,
\.bgBadgeAccent,
\.borderAccentSubtle
]
for keyPath in tintColorTokens {
colors.override(keyPath, with: Color(tint))
}
for keyPath in tintUIColorTokens {
uiColors.override(keyPath, with: tint)
}
}
}
@@ -12,6 +12,8 @@ import Foundation
internal nonisolated enum UntranslatedL10n {
/// Search
internal static var screenHomeTabSearch: String { return UntranslatedL10n.tr("Untranslated", "screen_home_tab_search") }
/// Welcome to HealthChat
internal static var screenOnboardingWelcomeTitleIos: String { return UntranslatedL10n.tr("Untranslated", "screen_onboarding_welcome_title_ios") }
/// Search for chats and messages
internal static var screenSearchEmptyStateMessage: String { return UntranslatedL10n.tr("Untranslated", "screen_search_empty_state_message") }
/// Start searching...
@@ -76,7 +76,7 @@ struct AuthenticationStartScreen: View {
if !context.viewState.hideBrandChrome {
VStack(spacing: 8) {
Text(L10n.screenOnboardingWelcomeTitle)
Text(UntranslatedL10n.screenOnboardingWelcomeTitleIos)
.font(.compound.headingLGBold)
.foregroundColor(.compound.textPrimary)
.multilineTextAlignment(.center)
@@ -6,13 +6,9 @@
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:element.io</string>
<string>applinks:app.element.io</string>
<string>applinks:staging.element.io</string>
<string>applinks:develop.element.io</string>
<string>applinks:mobile.element.io</string>
<string>applinks:app.healthchat.ch</string>
<string>applinks:matrix.to</string>
<string>webcredentials:*.element.io</string>
<string>webcredentials:*.healthchat.ch</string>
</array>
<key>com.apple.developer.usernotifications.communication</key>
<true/>
@@ -21,14 +17,12 @@
<key>com.apple.security.application-groups</key>
<array>
<string>$(APP_GROUP_IDENTIFIER)</string>
<string>$(CLASSIC_APP_GROUP_IDENTIFIER)</string>
</array>
<key>com.apple.security.network.client</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(KEYCHAIN_ACCESS_GROUP_IDENTIFIER)</string>
<string>$(CLASSIC_APP_KEYCHAIN_ACCESS_GROUP_IDENTIFIER)</string>
</array>
</dict>
</plist>
+1 -1
View File
@@ -31,7 +31,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<string>$(APP_DISPLAY_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
+8 -9
View File
@@ -51,6 +51,9 @@ targets:
UILaunchScreen:
UIColorName: colors/background-color
CFBundleDisplayName: $(APP_DISPLAY_NAME)
# HealthChat: without this CFBundleName defaults to $(PRODUCT_NAME) (ElementX, kept for the module
# name), which is what the web authentication session's sign-in alert shows — not CFBundleDisplayName.
CFBundleName: $(APP_DISPLAY_NAME)
CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
CFBundleURLTypes: [
@@ -119,23 +122,19 @@ targets:
properties:
aps-environment: development
com.apple.developer.associated-domains:
- applinks:element.io
- applinks:app.element.io
- applinks:staging.element.io
- applinks:develop.element.io
- applinks:mobile.element.io
# HealthChat: app.healthchat.ch universal links + webcredentials (OAuth/autofill). matrix.to kept for permalinks.
- applinks:app.healthchat.ch
- applinks:matrix.to
# - applinks:localhost?mode=developer # developer mode only works with https (but self-signed is fine).
- webcredentials:*.element.io
- webcredentials:*.healthchat.ch
com.apple.developer.usernotifications.communication: true
com.apple.security.app-sandbox: true
com.apple.security.application-groups:
# HealthChat: dropped $(CLASSIC_APP_GROUP_IDENTIFIER) (group.im.vector) — owned by Element's team, not provisionable here.
- $(APP_GROUP_IDENTIFIER)
- $(CLASSIC_APP_GROUP_IDENTIFIER)
com.apple.security.network.client: true
keychain-access-groups:
# HealthChat: dropped $(CLASSIC_APP_KEYCHAIN_ACCESS_GROUP_IDENTIFIER) (im.vector.app.*) — not provisionable here.
- $(KEYCHAIN_ACCESS_GROUP_IDENTIFIER)
- $(CLASSIC_APP_KEYCHAIN_ACCESS_GROUP_IDENTIFIER)
settings:
base:
+13
View File
@@ -0,0 +1,13 @@
# HealthChat product identity.
# Included permanently from project.yml (this fork always builds as HealthChat).
# Only build-setting scalars belong here — XcodeGen concatenates arrays on include-merge,
# so entitlement arrays (associated-domains, app-groups, keychain-groups) are edited directly
# in ElementX/SupportingFiles/target.yml instead.
# NB: APP_NAME (internal PRODUCT_NAME / module name) is intentionally left as ElementX so that
# `@testable import ElementX` and $(PRODUCT_MODULE_NAME) keep working.
settings:
APP_DISPLAY_NAME: HealthChat
PRODUCTION_APP_NAME: HealthChat
APP_GROUP_IDENTIFIER: group.ch.healthchat
BASE_BUNDLE_IDENTIFIER: ch.healthchat.element
DEVELOPMENT_TEAM: 6G37K72W82
+1 -1
View File
@@ -69,7 +69,7 @@ include:
- path: Components/MapLibre/MapLibreInterface/SupportingFiles/target.yml
- path: Components/MapLibre/MapLibreShim/SupportingFiles/target.yml
- path: Components/SDKMocks/SupportingFiles/target.yml
# - path: MyAppVariant/override.yml
- path: Variants/HealthChat/healthchat.yml
packages:
# Element/Matrix dependencies