Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: welcome tour ending on page refresh #16079

Merged
merged 18 commits into from Sep 2, 2022
Merged

Conversation

akash-codemonk
Copy link
Contributor

@akash-codemonk akash-codemonk commented Aug 17, 2022

Description

We want to still have the guided tour running when the current page is refreshed. Note that we don't restore at the initial screen where we show the start building cta. Also we don't restore all states like for e.g focused inputs, if the widget sidebar was open we don't reopen it on refresh etc. but the tour continues to be usable. We also go back a few steps in cases where we cannot resume with the latest step on refresh.

Code changes

  • To do this have moved the tour related store values to a separate reducer, which is then synced with session storage at every step.
  • Minor refactor to make reuse code for both localstorage and sessionstorage.
  • Refresh the page in cypress while running the tour test.

Release

release-reload.mov

Post fix

load-from-storage.mov

Fixes #10923

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Cypress

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@vercel
Copy link

vercel bot commented Aug 17, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
appsmith ✅ Ready (Inspect) Visit Preview Sep 2, 2022 at 7:46AM (UTC)

@github-actions github-actions bot added Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Needs Triaging Needs attention from maintainers to triage New Developers Pod Issues that new developers face while exploring the IDE Onboarding Issues related to onboarding new developers Regressed Scenarios that were working before but have now regressed labels Aug 17, 2022
@akash-codemonk
Copy link
Contributor Author

/ok-to-test sha=ca9f077

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2876180813.
Workflow: Appsmith External Integration Test Workflow.
Commit: ca9f077.
PR: 16079.

@akash-codemonk
Copy link
Contributor Author

/ok-to-test sha=c606b61

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2880017916.
Workflow: Appsmith External Integration Test Workflow.
Commit: c606b61.
PR: 16079.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2880017916.
Commit: c606b61.
Results:

Click to view performance test results

Median (ms) Mean (ms) Range (%) SD.Sample (%) SD.Population (%)

app/client/src/pages/Editor/GuidedTour/utils.ts Outdated Show resolved Hide resolved
@@ -16,23 +16,41 @@ class LocalStorageNotSupportedError extends Error {
}
}

export const getLocalStorage = () => {
const storage = window.localStorage;
type WebStorageType = "local" | "session";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a new WebStorage or Session storage class instead? Lets not combine these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created two classes LocalStorage and SessionStorage which extends WebStorage as both local and session storage have the same api. https://github.com/appsmithorg/appsmith/pull/16079/files#diff-1e9a43b2c64f5b85db74f40be876df6d9ab7e63b4660387f7330978f050b6d4bR111

@akash-codemonk
Copy link
Contributor Author

/ok-to-test sha=fd6c6ca

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2919016127.
Workflow: Appsmith External Integration Test Workflow.
Commit: fd6c6ca.
PR: 16079.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2919016127.
Commit: fd6c6ca.
Results:

Click to view performance test results

Run 1 (ms) Run 2 (ms) Run 3 (ms) Run 4 (ms) Run 5 (ms) Median (ms) Mean (ms) Range (%) SD.Sample (%) SD.Population (%)
SELECT_CATEGORY
scripting 302.23 297.9 297.81 291.43 329.36 297.9 303.75 12.49 4.88 4.37
painting 4.1 2.89 5.07 4.42 7.52 4.42 4.8 96.46 35.63 31.88
rendering 106.08 105.76 107.75 106.1 116.28 106.1 108.39 9.71 4.13 3.69
BIND_TABLE_DATA
scripting 1490.42 1521.13 1553.38 1501.02 1439.6 1501.02 1501.11 7.58 2.79 2.50
painting 8.43 18.59 11.64 18.64 10.31 11.64 13.52 75.52 35.43 31.66
rendering 412.34 439.45 411.3 434 409.21 412.34 421.26 7.18 3.39 3.03
CLICK_ON_TABLE_ROW
scripting 766.58 882.63 825.89 868.64 1095.21 868.64 887.79 37.02 14.02 12.54
painting 8.73 8.82 15.3 9.58 9.19 9.19 10.32 63.66 27.13 24.32
rendering 299.51 280.3 326.53 300.51 291.14 299.51 299.6 15.43 5.71 5.11
UPDATE_POST_TITLE
scripting 1405.86 1313.52 1325.01 1390.68 1285.44 1325.01 1344.1 8.96 3.85 3.45
painting 17.96 13.11 14.49 14.96 17 14.96 15.5 31.29 12.65 11.29
rendering 462.51 431.4 437.14 451.5 447.36 447.36 445.98 6.98 2.74 2.45
OPEN_MODAL
scripting 470.48 492.84 457.36 501.64 488.22 488.22 482.11 9.18 3.71 3.32
painting 17.25 17.93 23.89 7.74 12.24 17.25 15.81 102.15 38.71 34.60
rendering 359.03 354.31 354.1 373.55 371.91 359.03 362.58 5.36 2.62 2.34
CLOSE_MODAL
scripting 291.44 312.92 293.04 311.48 290.3 293.04 299.84 7.54 3.78 3.38
painting 6.85 14.71 11.67 7.9 4.69 7.9 9.16 109.39 43.67 39.08
rendering 595.14 613.46 597.01 641.9 601.02 601.02 609.71 7.67 3.18 2.84
SELECT_WIDGET_MENU_OPEN
scripting 1100.67 1133.49 1075.07 1032.28 1055.52 1075.07 1079.41 9.38 3.64 3.26
painting 6.29 5.95 5.29 9.75 6.39 6.29 6.73 66.27 25.85 23.18
rendering 654.73 626.4 598.1 581.64 590.08 598.1 610.19 11.98 4.92 4.41
SELECT_WIDGET_SELECT_OPTION
scripting 164.44 149.48 141.05 135.38 136.1 141.05 145.29 20.00 8.32 7.45
painting 2.24 5.16 3.62 3.46 4.22 3.62 3.74 78.07 28.61 25.67
rendering 317 305.02 301.26 305.25 297.71 305.02 305.25 6.32 2.38 2.13

@akash-codemonk
Copy link
Contributor Author

/ok-to-test sha=62d40d1

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2925444224.
Workflow: Appsmith External Integration Test Workflow.
Commit: 62d40d1.
PR: 16079.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2925444224.
Commit: 62d40d1.
Results:

Click to view performance test results

Run 1 (ms) Run 2 (ms) Run 3 (ms) Run 4 (ms) Run 5 (ms) Median (ms) Mean (ms) Range (%) SD.Sample (%) SD.Population (%)
SELECT_WIDGET_MENU_OPEN
scripting 1295.15 1453.11 1384.79 1326.91 1329.23 1329.23 1357.84 11.63 4.59 4.10
painting 10.42 13.74 12.62 13.45 9.4 12.62 11.93 36.38 16.09 14.42
rendering 762.32 819.97 835.87 819.42 881 819.97 823.72 14.41 5.16 4.62
SELECT_WIDGET_SELECT_OPTION
scripting 181.48 190.08 175.21 169.18 177.14 177.14 178.62 11.70 4.36 3.90
painting 10.31 11.76 6.56 9.25 3.02 9.25 8.18 106.85 42.30 37.78
rendering 342.22 348.29 356.39 346.06 363.65 348.29 351.32 6.10 2.45 2.19
SELECT_CATEGORY
scripting 405.9 385.74 351.07 347.88 379.71 379.71 374.06 15.51 6.54 5.85
painting 6.43 4.48 3.87 4.7 5.52 4.7 5 51.20 19.80 17.80
rendering 134.64 124.65 118.49 119.58 128.07 124.65 125.09 12.91 5.28 4.72
BIND_TABLE_DATA
scripting 1313.95 1378.88 1274.17 1432.79 1273.43 1313.95 1334.64 11.94 5.22 4.67
painting 30.92 33.08 27.79 28.27 30.57 30.57 30.13 17.56 7.14 6.37
rendering 596.56 633.04 535.57 569.16 584.19 584.19 583.7 16.70 6.13 5.49
CLICK_ON_TABLE_ROW
scripting 1241.98 1152.64 1132.81 1134.65 1411.27 1152.64 1214.67 22.92 9.77 8.74
painting 15.37 12.24 20.44 28.44 19.27 19.27 19.15 84.60 31.96 28.62
rendering 366.96 357.94 357.83 343.12 433.28 357.94 371.83 24.25 9.52 8.51
UPDATE_POST_TITLE
scripting 2034.52 1706.89 1712.33 1935.6 1877.85 1877.85 1853.44 17.68 7.70 6.89
painting 25.76 19.25 21.2 29.31 24.03 24.03 23.91 42.07 16.44 14.68
rendering 744.57 548.54 550.34 602.02 597.55 597.55 608.6 32.21 13.16 11.77
OPEN_MODAL
scripting 712.66 854.95 782.1 864.86 737.69 782.1 790.45 19.25 8.63 7.72
painting 19.01 15.26 15.5 13.32 25.78 15.5 17.77 70.12 27.69 24.76
rendering 454.91 445.71 506.84 451.75 518.68 454.91 475.58 15.34 7.22 6.46
CLOSE_MODAL
scripting 512.2 377.56 502.17 377.27 550.03 502.17 463.85 37.24 17.44 15.60
painting 8.44 7.11 7.02 5.63 8.07 7.11 7.25 38.76 15.03 13.52
rendering 806.7 698.44 735.55 698.24 839.73 735.55 755.73 18.72 8.54 7.64

@akash-codemonk
Copy link
Contributor Author

/ok-to-test sha=8567a37

@github-actions
Copy link

github-actions bot commented Sep 2, 2022

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2977834107.
Workflow: Appsmith External Integration Test Workflow.
Commit: 8567a37.
PR: 16079.

@github-actions
Copy link

github-actions bot commented Sep 2, 2022

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2977834107.
Commit: 8567a37.
Results:

Click to view performance test results

Run 1 (ms) Run 2 (ms) Run 3 (ms) Run 4 (ms) Run 5 (ms) Median (ms) Mean (ms) Range (%) SD.Sample (%) SD.Population (%)
SELECT_CATEGORY
scripting 312 306.82 284.23 288.54 278.88 288.54 294.09 11.26 4.93 4.41
painting 5.08 6.25 3.55 4.23 2.82 4.23 4.39 78.13 30.52 27.11
rendering 110.79 110.16 104.83 106.52 109.3 109.3 108.32 5.50 2.34 2.10
BIND_TABLE_DATA
scripting 1551.86 1487.54 1530.49 1459.14 1496.51 1496.51 1505.11 6.16 2.42 2.17
painting 19.31 14.36 14.81 14.04 14.53 14.53 15.41 34.20 14.28 12.78
rendering 438.14 447.4 424.25 423.81 417.28 424.25 430.18 7.00 2.85 2.55
CLICK_ON_TABLE_ROW
scripting 722.78 880.07 827 912.09 838.8 838.8 836.15 22.64 8.59 7.68
painting 9.21 9.11 10.08 16.37 8.5 9.21 10.65 73.90 30.42 27.23
rendering 291.36 295.71 295.68 330.25 305.54 295.71 303.71 12.80 5.18 4.63
UPDATE_POST_TITLE
scripting 1277.83 1394.81 1306.21 1280.79 1323.99 1306.21 1316.73 8.88 3.62 3.23
painting 12.94 20.38 12.87 14.8 16.89 14.8 15.58 48.20 20.22 18.10
rendering 433.47 478.13 444.92 439.7 460.48 444.92 451.34 9.89 3.99 3.57
OPEN_MODAL
scripting 510.01 502.06 495.62 483.09 1036.75 502.06 605.51 91.44 39.85 35.64
painting 10.2 18.15 12.83 18.23 14.65 14.65 14.81 54.22 23.43 20.93
rendering 382.47 373.64 364.62 401.61 420.27 382.47 388.52 14.32 5.77 5.16
CLOSE_MODAL
scripting 302.91 343.85 290.18 306.8 336.08 306.8 315.96 16.99 7.25 6.49
painting 11.7 11.23 9.89 11.79 12.59 11.7 11.44 23.60 8.65 7.78
rendering 614.91 674.71 596.84 643.39 655.26 643.39 637.02 12.22 4.90 4.38
SELECT_WIDGET_MENU_OPEN
scripting 1070.11 1116.46 1029.3 1059.13 1088.25 1070.11 1072.65 8.13 3.03 2.71
painting 5.45 11.82 5.23 7.07 10.99 7.07 8.11 81.26 38.22 34.28
rendering 624.17 630.4 593.55 596.12 591.21 596.12 607.09 6.46 3.07 2.75
SELECT_WIDGET_SELECT_OPTION
scripting 137.05 139.41 138.65 147.15 143.13 139.41 141.08 7.16 2.88 2.57
painting 9.58 4.75 3.94 1.95 11.64 4.75 6.37 152.12 63.89 57.14
rendering 310.44 318.23 307.88 301.76 304.22 307.88 308.51 5.34 2.07 1.85

@akash-codemonk akash-codemonk merged commit 9bb1ad6 into release Sep 2, 2022
@akash-codemonk akash-codemonk deleted the fix/onboarding-refresh branch September 2, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Needs Triaging Needs attention from maintainers to triage New Developers Pod Issues that new developers face while exploring the IDE Onboarding Issues related to onboarding new developers Regressed Scenarios that were working before but have now regressed Verified When issue is retested post its fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]-[700]:Welcome tutorial ends on page refresh
2 participants