playwright/packages/recorder/src
Max Schmitt 6d7d37061d
fix(recorder): Locator picker had wrong initial language in language bindings (#27706)
**Description**

When a language port was using Inspector with the "Locator Picker"
feature, it only recognised JavaScript as a language by default. As a
workaround the user was able to click record, interact with the page and
then the language would be correctly used -> csharp e.g. would work in
the "Locator Picker".

**Why?**

Our language bindings are setting `PW_LANG_NAME=<sdkLanguage>` env var
-> good. Our recorder harness also uses this along its internal state
here:


b9b289b641/packages/playwright-core/src/server/recorder.ts (L369)

and it gets used here (no parameter means: we use the first language
aka. primary language):


b9b289b641/packages/playwright-core/src/server/recorder.ts (L95)

The only issue is that the Inspector frontend in the beginning does not
know which language it should use and pass over to the server side, it
then falls back to JavaScript.

**Proposed fix**

Instead of passing it over from the frontend to the server side, we just
always use it from the server side, aka. "currentLanguage". When the
user switches languages in the frontend, "currentLanguage" already gets
updated properly via the "fileChanged" event.

https://github.com/microsoft/playwright-dotnet/issues/2718

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
2023-10-22 13:02:14 +02:00
..
callLog.css feat(ui): render all console / network messages in trace (#24115) 2023-07-10 12:56:56 -07:00
callLog.tsx chore: migrate to useRef take 2 (#21552) 2023-03-09 19:34:05 -08:00
DEPS.list chore: render typed locators in the recorder (#18162) 2022-10-18 16:39:58 -07:00
index.tsx chore: migrate trace-viewer and recorder to vite (#13076) 2022-03-25 14:12:00 -07:00
main.tsx chore: migrate codegen to controller events (#17450) 2022-09-20 14:32:21 -07:00
recorder.css chore: align recorder drawer with trace viewer (#26922) 2023-09-06 17:13:25 -07:00
recorder.tsx fix(recorder): Locator picker had wrong initial language in language bindings (#27706) 2023-10-22 13:02:14 +02:00
recorderTypes.ts chore(internal): generate code in jsonl (#23124) 2023-05-20 10:15:33 -07:00
vite-env.d.ts chore: migrate trace-viewer and recorder to vite (#13076) 2022-03-25 14:12:00 -07:00