A newbie here: how can I track/capture user iteraction?

Context: I have a dockerized theia container and I want to be able to track file modifications/opening and closing of a file etc.
Could someone please point me to the right direction?

[original thread by sanakanchha]

MonacoWorkspace can provide you with events when a file is opened, closed, changed, saved or about to be saved: https://github.com/theia-ide/theia/blob/8896f7cfe5c4142ea6ec442d33f08b7e83b427b8/packages/monaco/src/browser/monaco-workspace.ts#L66-L79

Are you interested also to filesystem changes, i.e. not opened files? You can use FileSystemWatcher (https://github.com/theia-ide/theia/blob/8896f7cfe5c4142ea6ec442d33f08b7e83b427b8/packages/filesystem/src/browser/filesystem-watcher.ts#L90-L97) to watch changes to fs generally, it watches an opened workspace by default, but you can watch more files by calling watchFileChanges.

[sanakanchha]

awesome, thank you @anton-kosyakov mostly interested on the opened file changes, will give it a try.

[sanakanchha]

@anton-kosyakov a problem a bit different than the original question I am trying to tackle this time. Is there a documentation somewhere on how I can embed an existing page content into theia? I found(https://github.com/eclipse-theia/theia/issues/1045) where the requirement is embedding theia into an existing page. My requirement is to be able to display page content on the mid panel of theia by lets say clicking on one of the menu/nav items. Is this possible using iframes/other options?

Yes, in such cases you need an iframe widget, look for example how it is done for the the mini-browser.

[sanakanchha]

great, thank you. will look into it.

[sanakanchha]

@anton-kosyakov was able to achieve it using the webview vs-code extension

[sanakanchha]

As I am moving on to the next step, I was looking to see if there a way to serve theia without the top-panel(#theia-top-panel), left panel(#theia-left-content-panel) and the right panel(#theia-right-content-panel)? i.e. be able to render theia without these 3 components rather than removing them after rendering on the client side?

@sanakanchha You will need to rebind ApplicationShell, remove rendering of these components and adjust methods like addWidget to always render in the main area.

there is https://github.com/eclipse-theia/theia/issues/479, please comment there if you have ideas how to make it more staighforward

webview is valid choice for custom widget as well

[sanakanchha]

great, thank you. will look into it.