Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 07ed1ad

Browse files
author
Alun Turner
committed
Merge remote-tracking branch 'origin/develop' into alunturner/add-bullet-list
2 parents 553a2c0 + 3874314 commit 07ed1ad

File tree

5 files changed

+48
-25
lines changed

5 files changed

+48
-25
lines changed

.github/workflows/cypress.yaml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,16 @@ jobs:
8484
actions: read
8585
issues: read
8686
pull-requests: read
87-
environment:
88-
Cypress
89-
#strategy:
90-
# fail-fast: false
91-
# matrix:
92-
# # Run 4 instances in Parallel
93-
# runner: [1, 2, 3, 4]
87+
environment: Cypress
88+
strategy:
89+
fail-fast: false
90+
matrix:
91+
# Run 4 instances in Parallel
92+
runner: [1, 2, 3, 4]
9493
steps:
94+
- uses: browser-actions/setup-chrome@latest
95+
- run: echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV
96+
9597
- uses: tecolicom/actions-use-apt-tools@v1
9698
with:
9799
# Our test suite includes some screenshot tests with unusual diacritics, which are
@@ -121,14 +123,12 @@ jobs:
121123
with:
122124
# The built-in Electron runner seems to grind to a halt trying
123125
# to run the tests, so use chrome.
124-
browser: chrome
126+
browser: "${{ env.BROWSER_PATH }}"
125127
start: npx serve -p 8080 webapp
126128
wait-on: "http://localhost:8080"
127-
record:
128-
true
129-
#parallel: true
130-
#command-prefix: 'yarn percy exec --parallel --'
131-
command-prefix: "yarn percy exec --"
129+
record: true
130+
parallel: true
131+
command-prefix: "yarn percy exec --parallel --"
132132
config: '{"reporter":"cypress-multi-reporters", "reporterOptions": { "configFile": "cypress-ci-reporter-config.json" } }'
133133
ci-build-id: ${{ needs.prepare.outputs.uuid }}
134134
env:
@@ -159,9 +159,8 @@ jobs:
159159
# tell Percy more details about the context of this run
160160
PERCY_BRANCH: ${{ github.event.workflow_run.head_branch }}
161161
PERCY_COMMIT: ${{ github.event.workflow_run.head_sha }}
162-
PERCY_PULL_REQUEST:
163-
${{ needs.prepare.outputs.pr_id }}
164-
#PERCY_PARALLEL_TOTAL: ${{ strategy.job-total }}
162+
PERCY_PULL_REQUEST: ${{ needs.prepare.outputs.pr_id }}
163+
PERCY_PARALLEL_TOTAL: ${{ strategy.job-total }}
165164
PERCY_PARALLEL_NONCE: ${{ needs.prepare.outputs.uuid }}
166165

167166
- name: Upload Artifact

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
"dependencies": {
5858
"@babel/runtime": "^7.12.5",
59-
"@matrix-org/analytics-events": "^0.3.0",
59+
"@matrix-org/analytics-events": "^0.4.0",
6060
"@matrix-org/matrix-wysiwyg": "^0.16.0",
6161
"@matrix-org/react-sdk-module-api": "^0.0.3",
6262
"@sentry/browser": "^7.0.0",

src/stores/RoomViewStore.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,11 @@ export class RoomViewStore extends EventEmitter {
335335
this.reset();
336336
break;
337337
case "reply_to_event":
338-
// If currently viewed room does not match the room in which we wish to reply then change rooms
339-
// this can happen when performing a search across all rooms. Persist the data from this event for
340-
// both room and search timeline rendering types, search will get auto-closed by RoomView at this time.
341-
if ([TimelineRenderingType.Room, TimelineRenderingType.Search].includes(payload.context)) {
338+
// Thread timeline view handles its own reply-to-state
339+
if (TimelineRenderingType.Thread !== payload.context) {
340+
// If currently viewed room does not match the room in which we wish to reply then change rooms this
341+
// can happen when performing a search across all rooms. Persist the data from this event for both
342+
// room and search timeline rendering types, search will get auto-closed by RoomView at this time.
342343
if (payload.event && payload.event.getRoomId() !== this.state.roomId) {
343344
this.dis.dispatch<ViewRoomPayload>({
344345
action: Action.ViewRoom,

test/stores/RoomViewStore-test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
*/
1616

1717
import { Room } from "matrix-js-sdk/src/matrix";
18+
import { sleep } from "matrix-js-sdk/src/utils";
1819

1920
import { RoomViewStore } from "../../src/stores/RoomViewStore";
2021
import { Action } from "../../src/dispatcher/actions";
@@ -245,6 +246,28 @@ describe("RoomViewStore", function () {
245246
expect(roomViewStore.getRoomId()).toEqual(roomId2);
246247
});
247248

249+
it("should ignore reply_to_event for Thread panels", async () => {
250+
expect(roomViewStore.getQuotingEvent()).toBeFalsy();
251+
const replyToEvent = {
252+
getRoomId: () => roomId2,
253+
};
254+
dis.dispatch({ action: "reply_to_event", event: replyToEvent, context: TimelineRenderingType.Thread });
255+
await sleep(100);
256+
expect(roomViewStore.getQuotingEvent()).toBeFalsy();
257+
});
258+
259+
it.each([TimelineRenderingType.Room, TimelineRenderingType.File, TimelineRenderingType.Notification])(
260+
"Should respect reply_to_event for %s rendering context",
261+
async (context) => {
262+
const replyToEvent = {
263+
getRoomId: () => roomId,
264+
};
265+
dis.dispatch({ action: "reply_to_event", event: replyToEvent, context });
266+
await untilDispatch(Action.ViewRoom, dis);
267+
expect(roomViewStore.getQuotingEvent()).toEqual(replyToEvent);
268+
},
269+
);
270+
248271
it("removes the roomId on ViewHomePage", async () => {
249272
dis.dispatch({ action: Action.ViewRoom, room_id: roomId });
250273
await untilDispatch(Action.ActiveRoomChanged, dis);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,10 +1579,10 @@
15791579
resolved "https://registry.yarnpkg.com/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz#497c67a1cef50d1a2459ba60f315e448d2ad87fe"
15801580
integrity sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==
15811581

1582-
"@matrix-org/analytics-events@^0.3.0":
1583-
version "0.3.0"
1584-
resolved "https://registry.yarnpkg.com/@matrix-org/analytics-events/-/analytics-events-0.3.0.tgz#a428f7e3f164ffadf38f35bc0f0f9a3e47369ce6"
1585-
integrity sha512-f1WIMA8tjNB3V5g1C34yIpIJK47z6IJ4SLiY4j+J9Gw4X8C3TKGTAx563rMcMvW3Uk/PFqnIBXtkavHBXoYJ9A==
1582+
"@matrix-org/analytics-events@^0.4.0":
1583+
version "0.4.0"
1584+
resolved "https://registry.yarnpkg.com/@matrix-org/analytics-events/-/analytics-events-0.4.0.tgz#ec75400ac41272cd2d47774da433437aba789bcf"
1585+
integrity sha512-tLeak2pYiyxn431o7EdOJGwRjj2DApybOLZ0YtFMuhv87pBQhc3lz+IKCJ2c8NwV6e7kf4YNaTdXeygBvFPGFw==
15861586

15871587
"@matrix-org/matrix-sdk-crypto-js@^0.1.0-alpha.2":
15881588
version "0.1.0-alpha.2"

0 commit comments

Comments
 (0)