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

New Sql Preview webview implementation with multi-doc PRQL Sql Preview support #110

Merged
merged 32 commits into from
Feb 19, 2023

Conversation

RandomFractals
Copy link
Collaborator

with new ActivePrqlDocumentUri key we'll use to save prql doc. reference to restore sql preview
…nt changes

and clear it when sql preview is no longer active, so we can use it for sql preview restore on vscode reload later
and don't clear it for sql preview restore to work on vscode reload
- rename it to sqlPreview.ts
- and delete old src/sql_ouput folder
and make extension code imports, multi-line statements, function args, etc. more compact and readable
- rename sql_ouput webview files to sql preivew
- add new SqlPreviewSerializer implementation
- create new SqlPreview class with most of the setup for multi-instance sql document previews
- add view init, refresh and update view state to upated sqlPreview.js
- add open sql preview command to commands
- use new SqlPreview.render to render those views
- remove getResourceUri() from src/views/utils.ts
- and document html template and resource uri methods
when there is no active prql text editor and sql preview is being restored on vscode reload
- add new command field to all the webview messages
- finish wring refresh with storing of document url in view state for the view restore on vscode reload
- check if prql file exists prior to loading it in restored sql previews
the other favicon.ico image doesn't get restored for the open sql previews when vscode is reloaded
we now show sql filename instead, so it should be clear it's an sql preview panel.
- add text editor change handler to extension.ts
- add SqlPreview.reveal(documentUri)
- preserve active editor focus on sql preview reveal
- reorg webview html template construction
in sql preview to show it again in webview panel reveal, and use it for active sql preview sql copy to clipboard
when there is no corepsonding open sql preview for a given prql document uri in an active text editor.
and show virtual prql sql document name in copied to clipboard notification
show last valid sql html output even when errors are encountered
and added a note about UI theme neutral html/css in sql preview webview
@RandomFractals RandomFractals merged commit 8d02886 into main Feb 19, 2023
@RandomFractals RandomFractals deleted the sql-preview-webview-refactor branch February 19, 2023 16:01
@aljazerzen
Copy link
Member

Damn, this is an impressive list of commits, kudos!

@RandomFractals
Copy link
Collaborator Author

Would have been better to see them in main branch too. Maybe we can do that next time.

Most of those changes were new web view implementation related, and I patched some of the questionable display issues and behavior in other parts of extension related to sql preview webview.

@aljazerzen
Copy link
Member

But they reached main? Would you want to see them not squashed?

@RandomFractals
Copy link
Collaborator Author

yes. as I mentioned in discord, refactors like this I'd rather see individual commits in main.

We should enable that option in this repo Settings for such occasions.

@max-sixty
Copy link
Member

We should enable that option in this repo Settings for such occasions.

Done!

@max-sixty
Copy link
Member

Really looking forward to trying this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants