Skip to content

Commit e28188c

Browse files
fix: double-click word selection and pending request URL display
B1: Skip accidental-selection prevention for double/triple clicks (event.detail >= 2) so CodeMirror's native word/line selection works. B4: Eagerly hydrate the request URL when building activeRequestInfo so the pending request modal shows the resolved URL instead of {{placeholder}} syntax. Falls back to responseData.processedUrl once the request completes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5eaf512 commit e28188c

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

frontend/src/app/app.component.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ import {
7878
import { buildStopActiveRunTickPatch } from './logic/active-run/active-run-stop.logic';
7979
import { decideActiveRunTickActions } from './logic/active-run/active-run-tick.logic';
8080
import { buildActiveRequestInfo, buildInitialLoadRunUiState } from './logic/request/active-request.logic';
81+
import { getCombinedVariablesForFile, getActiveEnvNameForFile } from './components/request-manager/env-vars';
82+
import { hydrateText } from './services/http/hydration';
8183
import { consumeQueuedRequest } from './logic/request/request-queue.logic';
8284
import { buildPendingRequestResetPatch } from './logic/request/pending-request-reset.logic';
8385
import { buildCancelActiveRequestErrorPatch, decideCancelActiveRequest } from './logic/request/cancel-active-request.logic';
@@ -537,6 +539,18 @@ export class AppComponent implements OnInit, OnDestroy {
537539
this.activeRequestInfo = buildActiveRequestInfo(activeFile.id, requestIndex, request, now);
538540
this.isCancellingActiveRequest = false;
539541

542+
// Eagerly hydrate the URL so the pending modal shows the resolved URL
543+
const variables = getCombinedVariablesForFile(activeFile, this.currentEnvSignal());
544+
const envName = getActiveEnvNameForFile(activeFile, this.currentEnvSignal());
545+
const capturedId = this.activeRequestInfo.id;
546+
hydrateText(request.url, variables, envName, (text, env) => this.secretService.replaceSecrets(text, env))
547+
.then(resolved => {
548+
if (this.activeRequestInfo?.id === capturedId) {
549+
this.activeRequestInfo = { ...this.activeRequestInfo, processedUrl: resolved };
550+
}
551+
})
552+
.catch(() => {});
553+
540554
const loadRun = buildInitialLoadRunUiState(this.loadUsersSeriesMaxPoints, this.loadRpsSeriesMaxPoints);
541555
this.activeRunProgress = loadRun.activeRunProgress;
542556

@@ -891,7 +905,8 @@ export class AppComponent implements OnInit, OnDestroy {
891905
getActiveRequestPreview(): string {
892906
const request = this.getActiveRequestDetails();
893907
const processedUrl = this.activeRequestInfo
894-
? this.currentFile.responseData?.[this.activeRequestInfo.requestIndex]?.processedUrl
908+
? (this.currentFile.responseData?.[this.activeRequestInfo.requestIndex]?.processedUrl
909+
?? this.activeRequestInfo.processedUrl)
895910
: undefined;
896911
return buildActiveRequestPreview(request, processedUrl);
897912
}
@@ -903,7 +918,8 @@ export class AppComponent implements OnInit, OnDestroy {
903918
getActiveRequestMeta(): string {
904919
const request = this.getActiveRequestDetails();
905920
const processedUrl = this.activeRequestInfo
906-
? this.currentFile.responseData?.[this.activeRequestInfo.requestIndex]?.processedUrl
921+
? (this.currentFile.responseData?.[this.activeRequestInfo.requestIndex]?.processedUrl
922+
?? this.activeRequestInfo.processedUrl)
907923
: undefined;
908924
return buildActiveRequestMeta({
909925
activeRequestInfo: this.activeRequestInfo,

frontend/src/app/components/editor/editor.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,9 @@ export class EditorComponent implements AfterViewInit, OnDestroy {
348348
}
349349
}
350350

351-
if (!event.shiftKey && !event.ctrlKey && !event.metaKey && !event.altKey) {
351+
// Skip accidental-selection prevention for double/triple clicks
352+
// (event.detail >= 2) so word/line selection works naturally.
353+
if (!event.shiftKey && !event.ctrlKey && !event.metaKey && !event.altKey && event.detail < 2) {
352354
const scrollTop = view.scrollDOM.scrollTop;
353355
const hadSelection = !view.state.selection.main.empty;
354356
const downX = event.clientX;

frontend/src/app/logic/request/active-request.logic.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export type ActiveRequestInfo = {
1010
canCancel: boolean;
1111
type: 'single' | 'chain' | 'load';
1212
startedAt: number;
13+
processedUrl?: string;
1314
};
1415

1516
export type LoadRunUiState = {

0 commit comments

Comments
 (0)