Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sam/logbox #5748

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

Open
samholmes wants to merge 2 commits into develop
base: develop
Choose a base branch
Loading
from sam/logbox
Open

Sam/logbox #5748

samholmes wants to merge 2 commits into develop from sam/logbox

Conversation

@samholmes
Copy link
Contributor

@samholmes samholmes commented Sep 22, 2025

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

@swansontec swansontec Sep 22, 2025

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

@paullinator paullinator Sep 22, 2025

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

@swansontec swansontec Sep 22, 2025

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

@swansontec swansontec Sep 22, 2025

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

Reviewers

@paullinator paullinator paullinator left review comments

@cursor cursor[bot] cursor[bot] left review comments

@swansontec swansontec swansontec requested changes

Requested changes must be addressed to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /