Skip to content

Conversation

@samholmes
Copy link
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

The lint cleanups in app.js need to go a bit deeper. I haven't reviewed the second commit, since I'm not the assigned reviewer.

Comment on lines +141 to +143
const nativePerformanceNow = (): number => {
// @ts-expect-error - this is a hack to get around the fact that window is not typed
return window.performance.now()
Copy link
Contributor

Choose a reason for hiding this comment

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

Take all this performance stuff, and move it to its own file. Do not attach it to the global scope, but instead export const pnow = and so forth for each performance function. If we want to do performance analysis in the future, we can just import { pstart, pend, ... } from '../../perf.ts' or whatever you call the new file, rather than grabbing it from the global scope.

Copy link
Member

Choose a reason for hiding this comment

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

The reason why this is in global scope was for the convenience in putting it in any repo like login-ui. Admittedly since most of our code is in the webview, this doesn't help much although it would be nice to have some equivalent in there as well.

console.log('***********************')

// @ts-expect-error
// @ts-expect-error - this needs an explanation
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, it does need an explanation.

This is needed for our logging integration. When we replace console.log with our own custom logging, we use global.clog to keep forwarding logs to the normal place.

This is dumb. Instead, our logging infrastructure should use named variable like export const realLog = console.log, and then call realLog() in the logging system. That avoids polluting the global scope, and makes it clear where this is being used (TypeScript becomes aware of what's going on).

Comment on lines +272 to +275
setInterval(() => {
intervalCallback().catch((err: unknown) => {
console.error(err)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional: This should really be makePeriodicTask, since that avoids overlapping work in cases where the async function takes more that 3s.

@samholmes samholmes self-assigned this Sep 23, 2025
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.

4 participants