-
Notifications
You must be signed in to change notification settings - Fork 13
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
chore: add tracker to editor's paste and OTel config load through URL #138
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -77,6 +78,9 @@ export default function Editor({ locked, setLocked }: { locked: boolean; setLock | |||
// /restore page. Without this we ran into return URL problems with GitHub | |||
// and Google as our return URL can be **very** long. | |||
localStorage.setItem("config-restore", config); | |||
if (config !== editorBinding.fallback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: We must only report this event once on the initial page load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial page load even with default config? I assumed load the page with different config that stored in URL. @bripkens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed load the page with different config that stored in URL.
Yes, correct. It should be both conditions: Initial load and when the config is different from the default one.
src/contexts/EditorContext.tsx
Outdated
@@ -240,6 +241,10 @@ export const EditorProvider = ({ children }: { children: ReactNode }) => { | |||
}; | |||
findSymbols(docObject, "", wordAtCursor.word, cursorOffset); | |||
}); | |||
|
|||
editorRef.current.onDidPaste(() => { | |||
track("Paste", { location: "Editor" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have just been thinking about this event. This is likely too fine-grained tracking and it is hard to interpret. Let's delete this event (sorry for the back and forth).
src/contexts/EditorContext.tsx
Outdated
@@ -240,6 +241,10 @@ export const EditorProvider = ({ children }: { children: ReactNode }) => { | |||
}; | |||
findSymbols(docObject, "", wordAtCursor.word, cursorOffset); | |||
}); | |||
|
|||
editorRef.current.onDidPaste(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see how this works. We can make use of this handler for function for this task :)
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
No description provided.