minderlabs / demo

Minder Demo App
1 stars 0 forks source link

ContextManager updates Finder's List #70

Closed richburdon closed 7 years ago

richburdon commented 7 years ago

1). Injects transient (local) Items for context into Finder List. 2). Clones item on mutation (e.g., add Task). 3). Threads together queries and mutations to keep context item cache up-to-date.

Start with the diagram?

adamberenzweig commented 7 years ago

I'm hitting this already with the Slack injector. The slack bot is already connected to the channel in the background, so there's not much need to do any client-side extraction. We just need to extract the channel name from the URL (e.g. https://minderlabs.slack.com/messages/eng-news/details).

something like:

Note that in the Slack case, even if we wanted to extract Person cards in the client, we don't even have email addresses or the user's full name -- just their Slack nickname (e.g. @rich) and Slack user ID. So we'd have to send that and do a Slack API call on the server anyway.

On Sun, Mar 19, 2017 at 2:21 PM, Rich Burdon notifications@github.com wrote:

@richburdon commented on this pull request.

In sub/app/src/client/common/context.js https://github.com/minderlabs/demo/pull/70#discussion_r106814120:

*/
  • get context() {
  • return this._context;
  • getFilter() {

Good point.

I was thinking the DOM processing itself might become: a) more complex; b) brittle compared to Web site changes, so might be dynamically loaded. That still leaves the question regarding how much logic to put here.

I was emphasizing client-based processing because of the client's need to create a transient item, but realize that could be pushed to the server also. In fact, better to push all of this since the server can start to augment the "transient" item in the background.

Added TODO.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/minderlabs/demo/pull/70#discussion_r106814120, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWAUV4fppU6EslIwhG2ZIp5NtNMhe_Yks5rnXIagaJpZM4MdLto .

richburdon commented 7 years ago

Got it.

Ok the content script -> sidebar "protocol" is open (just then window messenger then redux action). Anything else is graphql specific (currently finder's context query which is just an email filter).

Should this be a gql "query" (e.g., new new verb with an arbitrary dom/text payload?) What should be the response (tentative items I think). Try something out for the slack use case and let's take a look. The browser action is another potentially unbounded use case.

On Sun, Mar 19, 2017, 6:53 PM adamberenzweig notifications@github.com wrote:

I'm hitting this already with the Slack injector. The slack bot is already connected to the channel in the background, so there's not much need to do any client-side extraction. We just need to extract the channel name from the URL (e.g. https://minderlabs.slack.com/messages/eng-news/details).

something like:

  • Inspectors can add arbitrary key-val pairs (or entire json object?) to the context object, in addition to items.
  • The context object is sent wholesale to the server as part of the query filter -- or as an additional top-level param to search()?

Note that in the Slack case, even if we wanted to extract Person cards in the client, we don't even have email addresses or the user's full name -- just their Slack nickname (e.g. @rich) and Slack user ID. So we'd have to send that and do a Slack API call on the server anyway.

On Sun, Mar 19, 2017 at 2:21 PM, Rich Burdon notifications@github.com wrote:

@richburdon commented on this pull request.

In sub/app/src/client/common/context.js https://github.com/minderlabs/demo/pull/70#discussion_r106814120:

*/

  • get context() {
  • return this._context;
  • getFilter() {

Good point.

I was thinking the DOM processing itself might become: a) more complex; b) brittle compared to Web site changes, so might be dynamically loaded. That still leaves the question regarding how much logic to put here.

I was emphasizing client-based processing because of the client's need to create a transient item, but realize that could be pushed to the server also. In fact, better to push all of this since the server can start to augment the "transient" item in the background.

Added TODO.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/minderlabs/demo/pull/70#discussion_r106814120, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAWAUV4fppU6EslIwhG2ZIp5NtNMhe_Yks5rnXIagaJpZM4MdLto

.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/minderlabs/demo/pull/70#issuecomment-287654921, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXDG6z-ldb9pKWAoENZm7JRtGGO33UHks5rnbHbgaJpZM4MdLto .

adamberenzweig commented 7 years ago

cool. I was adding a field FilterInput { context: [KeyValue] } -- I'll let you know how it works out.

On Sun, Mar 19, 2017 at 10:02 PM, Rich Burdon notifications@github.com wrote:

Got it.

Ok the content script -> sidebar "protocol" is open (just then window messenger then redux action). Anything else is graphql specific (currently finder's context query which is just an email filter).

Should this be a gql "query" (e.g., new new verb with an arbitrary dom/text payload?) What should be the response (tentative items I think). Try something out for the slack use case and let's take a look. The browser action is another potentially unbounded use case.

On Sun, Mar 19, 2017, 6:53 PM adamberenzweig notifications@github.com wrote:

I'm hitting this already with the Slack injector. The slack bot is already connected to the channel in the background, so there's not much need to do any client-side extraction. We just need to extract the channel name from the URL (e.g. https://minderlabs.slack.com/messages/eng-news/details).

something like:

  • Inspectors can add arbitrary key-val pairs (or entire json object?) to the context object, in addition to items.
  • The context object is sent wholesale to the server as part of the query filter -- or as an additional top-level param to search()?

Note that in the Slack case, even if we wanted to extract Person cards in the client, we don't even have email addresses or the user's full name -- just their Slack nickname (e.g. @rich) and Slack user ID. So we'd have to send that and do a Slack API call on the server anyway.

On Sun, Mar 19, 2017 at 2:21 PM, Rich Burdon notifications@github.com wrote:

@richburdon commented on this pull request.

In sub/app/src/client/common/context.js https://github.com/minderlabs/demo/pull/70#discussion_r106814120:

*/

  • get context() {
  • return this._context;
  • getFilter() {

Good point.

I was thinking the DOM processing itself might become: a) more complex; b) brittle compared to Web site changes, so might be dynamically loaded. That still leaves the question regarding how much logic to put here.

I was emphasizing client-based processing because of the client's need to create a transient item, but realize that could be pushed to the server also. In fact, better to push all of this since the server can start to augment the "transient" item in the background.

Added TODO.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/minderlabs/demo/pull/70#discussion_r106814120, or mute the thread < https://github.com/notifications/unsubscribe-auth/ AAWAUV4fppU6EslIwhG2ZIp5NtNMhe_Yks5rnXIagaJpZM4MdLto

.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/minderlabs/demo/pull/70#issuecomment-287654921, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXDG6z- ldb9pKWAoENZm7JRtGGO33UHks5rnbHbgaJpZM4MdLto .

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/minderlabs/demo/pull/70#issuecomment-287666366, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWAUTU_Mec0AfSrKdzfQEiMeOoEcM3Fks5rnd4ogaJpZM4MdLto .