Skip to content

Refactor asset provider interface#386

Merged
taldekar merged 2 commits intofeature/viewRefactorfrom
taldekar/AssetProviderInterface
Mar 5, 2025
Merged

Refactor asset provider interface#386
taldekar merged 2 commits intofeature/viewRefactorfrom
taldekar/AssetProviderInterface

Conversation

@taldekar
Copy link
Copy Markdown
Contributor

@taldekar taldekar commented Mar 4, 2025

Issue #314

Description of changes:

  • Refactor asset provider interface to make the functionality explicit.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines +60 to +62
content = resolveContent();
Activator.getEventBroker().post(ChatWebViewAssetState.class,
content.isPresent() ? ChatWebViewAssetState.RESOLVED : ChatWebViewAssetState.DEPENDENCY_MISSING);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only be assigned once - after which calling this method again should be a no-op.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, I'll make the change

@taldekar taldekar merged commit d298503 into feature/viewRefactor Mar 5, 2025
@taldekar taldekar deleted the taldekar/AssetProviderInterface branch March 5, 2025 18:49
taldekar added a commit that referenced this pull request Mar 12, 2025
…382)

* improved handling of lsp failure state (#309)

* Introduce ViewRouter Component (#337)

* improved handling of lsp failure state

* add static mock to lsp connection test case

* Integrate Event Broker in LspStatusManager

* Add ViewRouter POC

* Fix code formatting bug

* Add method to retrieve observables

* Add listeners for combined state streams and view update request

* Add listeners for combined state streams and view update request

* Add listeners for combined state streams and view update request

* Add functionality for hot event streams that track latest event (#340)

* Add functionality for hot subscribers that track latest event

* Add test to ensure event stream isolation

* Fix missing subscription disposal in test

* Use autoConnect to implicitly manage stream connection

* Remove active view update request listener

* Add ViewRouter tests

* Remove public constructor

* Remove public constructor and unused event in tests

* Add comments

* Add documentation for EventBroker

* Remove ViewRouter initialization

* Remove LspInitializingView from ID enum

* Add documentation for ViewRouter

* Refactor and enhance EventBroker tests

* Refactor ViewRouter tests for clarity

* Remove PluginState class into separate file

* Add documentation to subscription management logic

* Add support for notifying  multiple late-subscribers over time of latest state (#342)

* Remove CODE_REFERENCE_VIEW

* Rename newActiveViewId to newActiveView

* Rename ViewId class to AmazonQViewType

* Revert "Integrate Event Broker in LspStatusManager"

This reverts commit 374e549.

* Revert "improved handling of lsp failure state"

This reverts commit 13c55ac.

* Refactor EventBroker and enhance tests (#343)

---------

Co-authored-by: Nicolas Borges <nickdb@amazon.com>

* Introduce View Container and base view components (#338)

* Add Browser Provider component (#357)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Add webview dependency missing logic to ViewRouter

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Add Webview Asset Providers (#358)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Add webview dependency missing logic to ViewRouter

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

* Rebase changes from Browser Provider PR

* Fix ViewRouter

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Integrate browser based views in ViewContainer (#359)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

* Rebase changes from Browser Provider PR

* Fix ViewRouter

* Integrate browser based views in ViewContainer

* Fix checkstyle issues

* Fix AmazonQBrowserProvider tests

* Fix bug due to display sync exec call

* Add semaphore locking to container to prevent race conditions

* Add browser focus handling

* Add state checking methods to LspState

* Clean up code

* Remove unnecessary parent assignment from chat webview

* Refactor ViewVisibilityManager to default to one view

* Add accidentally removed telemetry emissions

* Update plugin descriptor (#360)

* Move semaphore locking/unlocking to try/finally block

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Separate Chat and Toolkit Login web view asset state event stream (#361)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

* Rebase changes from Browser Provider PR

* Fix ViewRouter

* Integrate browser based views in ViewContainer

* Fix checkstyle issues

* Fix AmazonQBrowserProvider tests

* Fix bug due to display sync exec call

* Add semaphore locking to container to prevent race conditions

* Add browser focus handling

* Separate Chat and Toolkit Login webview asset event stream

* Separate Chat and Toolkit Login webview asset event stream

* Add state checking methods to LspState

* Clean up code

* Remove unnecessary parent assignment from chat webview

* Refactor ViewVisibilityManager to default to one view

* Add accidentally removed telemetry emissions

* Fix issue in a comment due to stash

* Update AssetProviders to publish state everytime content is fetched

* Update plugin descriptor (#360)

* Remove business logic from asset provider constructors

* Remove redundant methods to check state

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Refactor view actions and move setup code to base view (#370)

* Refactor actions and move to base view

* Improve disposal logic

* Fix minor bugs

* Fix minor bugs

* Remove unnecessary BaseView class (#371)

* Remove LspStatusManager (#365)

* Remove LspStatusManager

* Refactor browser provider (#366)

* Move publishing browser status to Activator

* Fix potential memory visibility bug (#367)

* Fix thread visibility bug

* Fix thread visibility bug

* Remove chat asset provider (#368)

* Fix thread visibility bug

* Remove ChatAssetProvider

* Fix bugs in ViewRefactor feature branch (#362)

* Remove redundant state check method

* Fix bugs in view refactor branch

* Fix checkstyle issues

* Make webview asset provider disposal more selective

* Reset content on dispose

* Redirect old views to point to the ViewContainer (#380)

* Redirect old view IDs to point to ViewContainer

* Redirect old view IDs to point to ViewContainer

* Auto detection of proxy settings

* Make keystore custom cert injection additive

* Introduce ViewRouter Component (#337)

* improved handling of lsp failure state

* add static mock to lsp connection test case

* Integrate Event Broker in LspStatusManager

* Add ViewRouter POC

* Fix code formatting bug

* Add method to retrieve observables

* Add listeners for combined state streams and view update request

* Add listeners for combined state streams and view update request

* Add listeners for combined state streams and view update request

* Add functionality for hot event streams that track latest event (#340)

* Add functionality for hot subscribers that track latest event

* Add test to ensure event stream isolation

* Fix missing subscription disposal in test

* Use autoConnect to implicitly manage stream connection

* Remove active view update request listener

* Add ViewRouter tests

* Remove public constructor

* Remove public constructor and unused event in tests

* Add comments

* Add documentation for EventBroker

* Remove ViewRouter initialization

* Remove LspInitializingView from ID enum

* Add documentation for ViewRouter

* Refactor and enhance EventBroker tests

* Refactor ViewRouter tests for clarity

* Remove PluginState class into separate file

* Add documentation to subscription management logic

* Add support for notifying  multiple late-subscribers over time of latest state (#342)

* Remove CODE_REFERENCE_VIEW

* Rename newActiveViewId to newActiveView

* Rename ViewId class to AmazonQViewType

* Revert "Integrate Event Broker in LspStatusManager"

This reverts commit 374e549.

* Revert "improved handling of lsp failure state"

This reverts commit 13c55ac.

* Refactor EventBroker and enhance tests (#343)

---------

Co-authored-by: Nicolas Borges <nickdb@amazon.com>

* Add Browser Provider component (#357)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Add webview dependency missing logic to ViewRouter

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Add Webview Asset Providers (#358)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Add webview dependency missing logic to ViewRouter

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

* Rebase changes from Browser Provider PR

* Fix ViewRouter

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Integrate browser based views in ViewContainer (#359)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

* Rebase changes from Browser Provider PR

* Fix ViewRouter

* Integrate browser based views in ViewContainer

* Fix checkstyle issues

* Fix AmazonQBrowserProvider tests

* Fix bug due to display sync exec call

* Add semaphore locking to container to prevent race conditions

* Add browser focus handling

* Add state checking methods to LspState

* Clean up code

* Remove unnecessary parent assignment from chat webview

* Refactor ViewVisibilityManager to default to one view

* Add accidentally removed telemetry emissions

* Update plugin descriptor (#360)

* Move semaphore locking/unlocking to try/finally block

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Merge main into feature/viewRefactor

* Refactor asset providers (#383)

* Refactor asset provider to handle JS asset setup

* Move progress listener for flicker bug out of asset providers

* Pre-fetch assets to publish asset state on event broker

* Consolidate events into their own package (#385)

* Refactor asset provider to handle JS asset setup

* Move events to their own package

* Move progress listener for flicker bug out of asset providers

* Clean up code

* Refactor asset provider interface (#386)

* Refactor asset provider interface

* Update initialize method to only fire once

* Trigger LSP configuration pull on preference update (#388)

* Open Flare version constraint (#389)

* Bump version to 1.0.4-SNAPSHOT

* Add dropdown menu on top level Q toolbar icon

* Add item for opening Q Chat

* Introduce ViewRouter Component (#337)

* improved handling of lsp failure state

* add static mock to lsp connection test case

* Integrate Event Broker in LspStatusManager

* Add ViewRouter POC

* Fix code formatting bug

* Add method to retrieve observables

* Add listeners for combined state streams and view update request

* Add listeners for combined state streams and view update request

* Add listeners for combined state streams and view update request

* Add functionality for hot event streams that track latest event (#340)

* Add functionality for hot subscribers that track latest event

* Add test to ensure event stream isolation

* Fix missing subscription disposal in test

* Use autoConnect to implicitly manage stream connection

* Remove active view update request listener

* Add ViewRouter tests

* Remove public constructor

* Remove public constructor and unused event in tests

* Add comments

* Add documentation for EventBroker

* Remove ViewRouter initialization

* Remove LspInitializingView from ID enum

* Add documentation for ViewRouter

* Refactor and enhance EventBroker tests

* Refactor ViewRouter tests for clarity

* Remove PluginState class into separate file

* Add documentation to subscription management logic

* Add support for notifying  multiple late-subscribers over time of latest state (#342)

* Remove CODE_REFERENCE_VIEW

* Rename newActiveViewId to newActiveView

* Rename ViewId class to AmazonQViewType

* Revert "Integrate Event Broker in LspStatusManager"

This reverts commit 374e549.

* Revert "improved handling of lsp failure state"

This reverts commit 13c55ac.

* Refactor EventBroker and enhance tests (#343)

---------

Co-authored-by: Nicolas Borges <nickdb@amazon.com>

* Add Browser Provider component (#357)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Add webview dependency missing logic to ViewRouter

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Add Webview Asset Providers (#358)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Add webview dependency missing logic to ViewRouter

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

* Rebase changes from Browser Provider PR

* Fix ViewRouter

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Integrate browser based views in ViewContainer (#359)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

* Rebase changes from Browser Provider PR

* Fix ViewRouter

* Integrate browser based views in ViewContainer

* Fix checkstyle issues

* Fix AmazonQBrowserProvider tests

* Fix bug due to display sync exec call

* Add semaphore locking to container to prevent race conditions

* Add browser focus handling

* Add state checking methods to LspState

* Clean up code

* Remove unnecessary parent assignment from chat webview

* Refactor ViewVisibilityManager to default to one view

* Add accidentally removed telemetry emissions

* Update plugin descriptor (#360)

* Move semaphore locking/unlocking to try/finally block

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Refactor view actions and move setup code to base view (#370)

* Refactor actions and move to base view

* Improve disposal logic

* Fix minor bugs

* Fix minor bugs

* Auto detection of proxy settings

* Integrate browser based views in ViewContainer (#359)

* Pass populated AWS_CA_BUNDLE env var to Flare (#341)

* Add UI notification to alert user of deprecated manifest version (#312)

* Revert commit 'Add UI notification to alert user of deprecated manifest version'

* Revert 'Pass populated AWS_CA_BUNDLE env var to Flare'

* Rebase changes from Browser Provider PR

* Fix ViewRouter

* Integrate browser based views in ViewContainer

* Fix checkstyle issues

* Fix AmazonQBrowserProvider tests

* Fix bug due to display sync exec call

* Add semaphore locking to container to prevent race conditions

* Add browser focus handling

* Add state checking methods to LspState

* Clean up code

* Remove unnecessary parent assignment from chat webview

* Refactor ViewVisibilityManager to default to one view

* Add accidentally removed telemetry emissions

* Update plugin descriptor (#360)

* Move semaphore locking/unlocking to try/finally block

---------

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Nicolas <nborges.aws@gmail.com>

* Refactor asset providers (#383)

* Refactor asset provider to handle JS asset setup

* Move progress listener for flicker bug out of asset providers

* Pre-fetch assets to publish asset state on event broker

* Integrate AmazonQCommonActions change

* Integrate AmazonQCommonActions change

* Remove duplicate events

* Fix global drop-down visibility bug

* Fix UdateUtil bug

* Fix UdateUtil bug

* Fix missing imports

* Improve timing of early startup activity (#393) (#394)

* Improve timing of early startup activity

* Fix unit test

Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: Ishan Taldekar <taldekar@amazon.com>

* Remove unused imports

* Fix Event Broker subscription disposal bug (#392) (#395)

* Fix Event Broker subscription disposal bug

* Add null check

Co-authored-by: Ishan Taldekar <taldekar@amazon.com>

* Remove dispose method

* Remove redundant classes

---------

Co-authored-by: Nicolas <nborges.aws@gmail.com>
Co-authored-by: Nicolas Borges <nickdb@amazon.com>
Co-authored-by: Jonathan Breedlove <breedloj@amazon.com>
Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com>
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.

2 participants