message: warn user before switching tests and unsafely ending the recording
diff: @@ -96,13 +96,31 @@ class UiState {
  return this.navigationHover ? this._navigationWidth : this.minNavigationWidth;
  }
  - @action.bound changeView(view, ignoreCache) {
  + @action.bound _changeView(view, ignoreCache) {
  this.lastViewSelection.set(this.selectedView, this.selectedTest);
  - this.selectedView = view;
  - const lastSelection = this.lastViewSelection.get(this.selectedView);
  + const lastSelection = this.lastViewSelection.get(view);
  if (!ignoreCache && lastSelection) {
  this.selectTest(lastSelection.test, lastSelection.suite, lastSelection.stack);
  }
  + this.selectedView = view;
  + }
  +
  + @action.bound async changeView(view, ignoreCache) {
  + if (this.isRecording && view !== this.selectedView) {
  + ModalState.showAlert({
  + title: "Stop recording",
  + description: "Are you sure you would like to stop recording, and change views?",
  + confirmLabel: "Stop recording",
  + cancelLabel: "cancel"
  + }, async (choseChange) => {
  + if (choseChange) {
  + await this.stopRecording();
  + this._changeView(view, ignoreCache);
  + }
  + });
  + } else {
  + this._changeView(view, ignoreCache);
  + }
  }
  @action.bound clearViewCache() {
  @@ -126,7 +144,7 @@ class UiState {
  this.selectedTest.test;
  }
  - @action.bound selectTest(test, suite, stack, override) {
  + @action.bound _selectTest(test, suite, stack, override) {
  if (!PlaybackState.isPlaying || PlaybackState.paused || override) {
  const _test = (stack !== undefined && stack >= 0) ? PlaybackState.callstack[stack].callee : test;
  if (_test !== this.displayedTest) {
  @@ -144,6 +162,24 @@ class UiState {
  }
  }
  + @action.bound selectTest(test, suite, stack, override) {
  + if (this.isRecording && test !== this.selectedTest.test) {
  + ModalState.showAlert({
  + title: "Stop recording",
  + description: "Are you sure you would like to stop recording, and select a different test?",
  + confirmLabel: "Stop recording",
  + cancelLabel: "cancel"
  + }, async (choseSelect) => {
  + if (choseSelect) {
  + await this.stopRecording();
  + this._selectTest(test, suite, stack, override);
  + }
  + });
  + } else {
  + this._selectTest(test, suite, stack, override);
  + }
  + }
  +
  @action.bound selectTestByIndex(index, suite) {
  const selectTestInArray = (index, tests) => (
  (index >= 0 && index < tests.length) ? tests[index] : undefined
  @@ -205,6 +241,9 @@ class UiState {
  await (this.isRecording ? this.stopRecording() : this.startRecording());
  }
  + @action.bound beforeRecording() {
  + }
  +
  @action.bound async startRecording() {
  try {
  await recorder.attach(this.baseUrl);
  