Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4b701b5
Module API experiments
dbkr Sep 23, 2025
9129c35
Move ResizerNotifier into SDKContext
dbkr Sep 24, 2025
e4dee7a
Add the MultiRoomViewStore
dbkr Sep 24, 2025
a02a5ac
Make RoomViewStore able to take a roomId prop
dbkr Sep 24, 2025
9ae447f
Different interface to add space panel items
dbkr Sep 25, 2025
66bf1dd
Allow space panel items to be updated
dbkr Sep 25, 2025
7ac4a4a
Merge branch 'develop' into dbkr/module_experiments
dbkr Sep 26, 2025
afa340e
Remove fetchRoomFn from SpaceNotificationStore
dbkr Sep 26, 2025
b6b1658
Merge remote-tracking branch 'origin/develop' into dbkr/module_experi…
dbkr Oct 2, 2025
809b41a
Merge remote-tracking branch 'origin/develop' into dbkr/module_experi…
dbkr Oct 13, 2025
de5a757
Merge remote-tracking branch 'origin/develop' into dbkr/module_experi…
dbkr Oct 15, 2025
ced886a
Merge remote-tracking branch 'origin/develop' into dbkr/module_experi…
dbkr Oct 16, 2025
2dd743d
Switch to using module api via .instance
dbkr Oct 16, 2025
738eac9
Fairly awful workaround
dbkr Oct 17, 2025
1ebead1
Add test for multiroomviewstore
dbkr Oct 17, 2025
51499fa
add test
dbkr Oct 17, 2025
206905c
Make room names deterministic
dbkr Oct 17, 2025
a5f3876
Add test for builtinsapi
dbkr Oct 17, 2025
c31d4fe
Merge branch 'develop' into dbkr/module_experiments
dbkr Oct 21, 2025
4d7d06b
Merge remote-tracking branch 'origin/develop' into dbkr/module_experi…
dbkr Oct 29, 2025
a94328a
Update module api
dbkr Oct 29, 2025
0e8a617
RVS is not needed as prop anymore
MidhunSureshR Oct 30, 2025
b8c79f4
Add roomId to prop
MidhunSureshR Oct 30, 2025
302b656
Remove RoomViewStore from state
MidhunSureshR Oct 30, 2025
da11cff
Fix test
MidhunSureshR Oct 30, 2025
6f6b3bd
No need to pass RVS from LoggedInView
MidhunSureshR Oct 30, 2025
2b05d51
Add RoomContextType
MidhunSureshR Oct 30, 2025
c78461d
Implement new builtins api
MidhunSureshR Oct 29, 2025
1c0738b
Add tests
MidhunSureshR Oct 29, 2025
f2104b5
Fix import
MidhunSureshR Oct 29, 2025
620ba92
Fix circular dependency issue
MidhunSureshR Oct 29, 2025
8a875e8
Fix import
MidhunSureshR Oct 30, 2025
a9fed64
Add more tests
MidhunSureshR Oct 30, 2025
61306a1
Improve comment
MidhunSureshR Oct 30, 2025
ebc9e3a
room-id is optional
MidhunSureshR Oct 30, 2025
eebf227
Update license
MidhunSureshR Oct 30, 2025
2449557
Add implementation for AccountDataApi
MidhunSureshR Oct 30, 2025
335491e
Add implementation for Room
MidhunSureshR Oct 30, 2025
3be766d
Add implementation for ClientApi
MidhunSureshR Oct 30, 2025
c2d68f8
Create ClientApi in Api.ts
MidhunSureshR Oct 30, 2025
b94d40f
Write tests
MidhunSureshR Oct 30, 2025
507eaa0
Use nullish coalescing assignment
MidhunSureshR Oct 30, 2025
f4e8e79
Implement openRoom in NavigationApi
MidhunSureshR Oct 30, 2025
6dc1431
Write tests
MidhunSureshR Oct 30, 2025
044a275
Add implementation for StoresApi
MidhunSureshR Oct 30, 2025
353609c
Write tests
MidhunSureshR Oct 30, 2025
fdbe414
Fix circular dependency
MidhunSureshR Oct 30, 2025
d433a6b
Add comments in lieu of type
dbkr Oct 31, 2025
6fc6df6
Merge pull request #31141 from element-hq/midhun/module-impl/stores
MidhunSureshR Nov 4, 2025
8a59a16
Merge pull request #31140 from element-hq/midhun/module-impl/navigation
MidhunSureshR Nov 4, 2025
5f8aa32
Change to class field
MidhunSureshR Nov 4, 2025
124f52b
Merge remote-tracking branch 'origin/develop' into dbkr/module_experi…
dbkr Nov 4, 2025
f688a06
Merge pull request #31138 from element-hq/midhun/module-impl/client
MidhunSureshR Nov 4, 2025
8c772f3
Merge pull request #31132 from element-hq/midhun/module-impl/builtin
MidhunSureshR Nov 4, 2025
70e6382
WIP
MidhunSureshR Nov 4, 2025
206e4bf
WIP
MidhunSureshR Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/tests-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Tests - 2
on:
pull_request: {}
merge_group:
types: [checks_requested]
push:
branches: [develop, master]
repository_dispatch:
types: [element-web-notify]
workflow_call:
inputs:
disable_coverage:
type: boolean
required: false
description: "Specify true to skip generating and uploading coverage for tests"
matrix-js-sdk-sha:
type: string
required: false
description: "The matrix-js-sdk SHA to use"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

env:
ENABLE_COVERAGE: ${{ github.event_name != 'merge_group' && inputs.disable_coverage != 'true' }}
# fetchdep.sh needs to know our PR number
PR_NUMBER: ${{ github.event.pull_request.number }}

permissions: {}

jobs:
jest_ew:
name: Jest (Element Web)
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
# Run multiple instances in parallel to speed up the tests
runner: [1, 2, 3, 4, 5, 6]
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
repository: ${{ inputs.matrix-js-sdk-sha && 'element-hq/element-web' || github.repository }}

- name: Yarn cache
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: "lts/*"
cache: "yarn"

- name: Install Deps
run: "./scripts/layered.sh"
env:
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}

- name: Jest Cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: /tmp/jest_cache
key: ${{ hashFiles('**/yarn.lock') }}

- name: Get number of CPU cores
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2

- name: Run tests
run: |
yarn test \
--ci \
./test/unit-tests/components/views/dialogs/ManualDeviceKeyVerificationDialog-test.tsx
env:
JEST_SONAR_UNIQUE_OUTPUT_NAME: true

# tell jest to use coloured output
FORCE_COLOR: true


complete:
name: jest-tests
needs: jest_ew
if: always()
runs-on: ubuntu-24.04
permissions:
statuses: write
steps:
- if: needs.jest_ew.result != 'skipped' && needs.jest_ew.result != 'success'
run: exit 1

- name: Skip SonarCloud in merge queue
if: github.event_name == 'merge_group' || inputs.disable_coverage == 'true'
uses: guibranco/github-status-action-v2@5530c593759f489bba08272e96986ffc571c1ea1
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
state: success
description: SonarCloud skipped
context: SonarCloud Code Analysis
sha: ${{ github.sha }}
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@element-hq/element-web-module-api": "1.4.1",
"@element-hq/element-web-module-api": "1.5.0",
"@element-hq/web-shared-components": "file:packages/shared-components",
"@fontsource/inconsolata": "^5",
"@fontsource/inter": "^5",
Expand Down
4 changes: 4 additions & 0 deletions res/css/structures/_SpacePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ Please see LICENSE files in the repository root for full details.
}
}

&.mx_SpaceButton_withIcon .mx_SpaceButton_icon {
background-color: $panel-actions;
}

&.mx_SpaceButton_home .mx_SpaceButton_icon::before {
mask-image: url("@vector-im/compound-design-tokens/icons/home-solid.svg");
}
Expand Down
6 changes: 3 additions & 3 deletions src/PosthogTrackers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const notLoggedInMap: Record<Exclude<Views, Views.LOGGED_IN>, ScreenName> = {
[Views.LOCK_STOLEN]: "SessionLockStolen",
};

const loggedInPageTypeMap: Record<PageType, ScreenName> = {
const loggedInPageTypeMap: Record<PageType | string, ScreenName> = {
[PageType.HomePage]: "Home",
[PageType.RoomView]: "Room",
[PageType.UserView]: "User",
Expand All @@ -48,10 +48,10 @@ export default class PosthogTrackers {
}

private view: Views = Views.LOADING;
private pageType?: PageType;
private pageType?: PageType | string;
private override?: ScreenName;

public trackPageChange(view: Views, pageType: PageType | undefined, durationMs: number): void {
public trackPageChange(view: Views, pageType: PageType | string | undefined, durationMs: number): void {
this.view = view;
this.pageType = pageType;
if (this.override) return;
Expand Down
41 changes: 27 additions & 14 deletions src/components/structures/LoggedInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ import { monitorSyncedPushRules } from "../../utils/pushRules/monitorSyncedPushR
import { type ConfigOptions } from "../../SdkConfig";
import { MatrixClientContextProvider } from "./MatrixClientContextProvider";
import { Landmark, LandmarkNavigation } from "../../accessibility/LandmarkNavigation";
import { SDKContext, SdkContextClass } from "../../contexts/SDKContext.ts";
import { ModuleApi } from "../../modules/Api.ts";
import { SDKContext } from "../../contexts/SDKContext.ts";

// We need to fetch each pinned message individually (if we don't already have it)
// so each pinned message may trigger a request. Limit the number per room for sanity.
Expand Down Expand Up @@ -679,6 +680,10 @@ class LoggedInView extends React.Component<IProps, IState> {
public render(): React.ReactNode {
let pageElement;

const moduleRenderer = this.props.page_type
? ModuleApi.instance.navigation.locationRenderers.get(this.props.page_type)
: undefined;

switch (this.props.page_type) {
case PageTypes.RoomView:
pageElement = (
Expand All @@ -690,7 +695,6 @@ class LoggedInView extends React.Component<IProps, IState> {
key={this.props.currentRoomId || "roomview"}
justCreatedOpts={this.props.roomJustCreatedOpts}
forceTimeline={this.props.forceTimeline}
roomViewStore={SdkContextClass.instance.roomViewStore}
/>
);
break;
Expand All @@ -706,6 +710,13 @@ class LoggedInView extends React.Component<IProps, IState> {
);
}
break;
default: {
if (moduleRenderer) {
pageElement = moduleRenderer();
} else {
console.warn(`Couldn't render page type "${this.props.page_type}"`);
}
}
}

const wrapperClasses = classNames({
Expand Down Expand Up @@ -747,20 +758,22 @@ class LoggedInView extends React.Component<IProps, IState> {
)}
<SpacePanel />
{!useNewRoomList && <BackdropPanel backgroundImage={this.state.backgroundImage} />}
<div
className="mx_LeftPanel_wrapper--user"
ref={this._resizeContainer}
data-collapsed={shouldUseMinimizedUI ? true : undefined}
>
<LeftPanel
pageType={this.props.page_type as PageTypes}
isMinimized={shouldUseMinimizedUI || false}
resizeNotifier={this.context.resizeNotifier}
/>
</div>
{!moduleRenderer && (
<div
className="mx_LeftPanel_wrapper--user"
ref={this._resizeContainer}
data-collapsed={shouldUseMinimizedUI ? true : undefined}
>
<LeftPanel
pageType={this.props.page_type as PageTypes}
isMinimized={shouldUseMinimizedUI || false}
resizeNotifier={this.context.resizeNotifier}
/>
</div>
)}
</div>
</div>
<ResizeHandle passRef={this.resizeHandler} id="lp-resizer" />
{!moduleRenderer && <ResizeHandle passRef={this.resizeHandler} id="lp-resizer" />}
<div className="mx_RoomView_wrapper">{pageElement}</div>
</div>
</div>
Expand Down
11 changes: 7 additions & 4 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ import { ShareFormat, type SharePayload } from "../../dispatcher/payloads/ShareP
import Markdown from "../../Markdown";
import { sanitizeHtmlParams } from "../../Linkify";
import { isOnlyAdmin } from "../../utils/membership";
import { ModuleApi } from "../../modules/Api.ts";

// legacy export
export { default as Views } from "../../Views";
Expand Down Expand Up @@ -175,9 +176,11 @@ interface IProps {
interface IState {
// the master view we are showing.
view: Views;
// What the LoggedInView would be showing if visible
// What the LoggedInView would be showing if visible.
// A member of the enum for standard pages or a string for those provided by
// a module.
// eslint-disable-next-line camelcase
page_type?: PageType;
page_type?: PageType | string;
// The ID of the room we're viewing. This is either populated directly
// in the case where we view a room by ID or by RoomView when it resolves
// what ID an alias points at.
Expand Down Expand Up @@ -1921,8 +1924,8 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
userId: userId,
subAction: params?.action,
});
} else {
logger.info(`Ignoring showScreen for '${screen}'`);
} else if (ModuleApi.instance.navigation.locationRenderers.get(screen)) {
this.setState({ page_type: screen });
}
}

Expand Down
Loading
Loading