Commit Graph
27 Commits
Author SHA1 Message Date
Ofek b75542bfac Fix #3264: move emitShortLinkEvent from editor-pane to main window (#7163)
When settings are set to emit-short-link upon ctrl+S, managing the logic
in `Editor` is problematic since the editor may lose focus and not
receive the event.

Also logically this is a cross-site event, and doesn't belong in any
particular editor (there can be multiple).
2024-12-02 10:41:12 +02:00
Ofek 20b8ccaa6f Remove ICompiler, other minor type fixes (#7079) 2024-11-25 18:36:20 +02:00
Ofek caca3ea6c7 Eliminate all google-analytics dead code (#6954)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-10-10 21:21:43 +03:00
Ofek Shilon bce3a65d6d Add full-url capture for sentry messages triggered in front end 2024-06-03 22:11:52 +03:00
Ofek Shilon 0741ec2fdc Fix: page refresh restores default code 2024-05-11 17:29:11 +03:00
Ofek 44d48dca16 Fix #6464: defend against empty saved layout (#6465)
Fix #6464, following the discord discussion.

2 protections are added here:

(1) Make the first code editor non-closable, to avoid an empty layout,
(2) If a loaded config has empty layout - fallback to the default
config.
2024-05-10 11:24:11 +03:00
Jeremy db3076e0ab Rescue users from real dark mode 2024-04-09 20:20:18 -05:00
Jeremy Rifkin c2fa676a8e Create the real dark mode (#6309) 2024-03-31 19:41:51 -05:00
Matt Godbolt e4b791ce92 Use session _then_ local storage for saved state (#5277)
In conversation with @mknejp he pointed out that it can be frustating
when having a browser loaded up with many tabs of CE links, then
reloading the browser (e.g. a reboot, or open/closing the tabs), that
upon reload all the tabs will have the same, shared state (corresponding
to whichever saved to local storage last).

This change:
- stores state in _both_ session and local storage
- removes from both on UI reset
- loads first from session storage and then falls back to local storage

The net result is:
- tabs reopened with "ctrl-shift T" will regain their prior state, as do
any other tabs for which the browser thinks are part of the same session
(like on a "reopen tabs" plugins etc)
- newly-opened tabs still have the prior behaviour of using whatever the
most recently opened tab had as its starting state

Some more info on session vs local storage
[here](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)
2023-07-23 18:08:33 -05:00
Patrick Quist 0e85d8c388 Fix link datetime layout (#5263) 2023-07-18 02:26:35 +02:00
Patrick Quist 9b983d6965 Load and show creation_date of shortlink (#5236) 2023-07-17 23:36:36 +02:00
Jeremy Rifkin 4260313e13 Common utilities and type work (#5200)
This PR refactors some common utilities out of lib/ and into shared/ and
eliminates some use of underscore.js, as well as general type
improvements done along the way.
2023-06-28 20:13:10 -04:00
Jeremy Rifkin 9b69146add Move all styles to static/styles (#5210) 2023-06-28 08:06:45 -04:00
Jeremy Rifkin e2ee803598 Improve sentry capturing of unhandled promise rejections (#5190) 2023-06-21 15:40:40 -04:00
Jeremy Rifkin e267286553 Support user site templates (#5180)
Long overdue
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/d8a56216-d6b0-459a-8539-9f519c023b92)
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/133da5e6-2717-464a-a5fc-5983a3f75014)
2023-06-19 22:33:40 -04:00
Jeremy Rifkin c779507000 Create a print view (#5161)
This PR adds a print view for CE

Closes #4617


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/92e5ceab-10cc-4289-a742-592e379627ef)

At the moment syntax highlighting isn't working. I think we need a way
to get style definitions from monaco. I've opened an issue at
https://github.com/microsoft/monaco-editor/issues/4031. For the CFG
pane, using the monaco classes "just works", but for some reason when
@media print is applied those definitions go away. We'd want to always
use light mode colors anyway.
2023-06-19 22:13:45 -04:00
Jeremy 653e9a6899 Lint fixes 2023-06-11 17:38:38 -04:00
Jeremy Rifkin acdd5ad45c Capture errors in sentry better (#5128)
Fixes #5127 and similar issues.

Rationale: Whenever something that is not an Error object is passed to
Sentry.captureException we get pretty much no useful information in
sentry

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/c7345449-f7a0-46cb-a198-abe0bd80a8b1)
(usually not even a stacktrace)
2023-06-11 17:31:51 -04:00
Jeremy Rifkin 0bc22f8883 Egregiously overengineered fix for a niche UI bug (#5074)
Fixes #4714
2023-05-30 21:11:21 -05:00
Jeremy Rifkin 55b82bb12c Turn off april fools mode (#4927)
This PR has the changes to remove the pink banner once we are ready to do so
2023-04-02 19:31:46 -05:00
Jeremy Rifkin 5d8d39f136 Pink (#4916) 2023-04-01 00:52:27 -04:00
Jeremy Rifkin 01935ecb2a Ensure a default language is provided for new editor panes (#4890)
Fixes #4889
2023-03-20 17:03:42 -04:00
Jeremy Rifkin bbabd514a5 Update error alert styling (#4860)
![image](https://user-images.githubusercontent.com/51220084/224565888-e0b98abf-6e1c-4914-8695-b31a2275b364.png)
2023-03-12 17:03:36 -04:00
Mats Jun LarsenandMatt Godbolt 633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Jeremy Rifkin 384c297906 Fix trailing comma issue (#4775)
Make trailing commas more consistent throughout the project, fixes
config conflict between eslint and prettier. Resolves an oversight in
#4766.
2023-02-26 12:21:35 -05:00
Jeremy Rifkin 3f9813a3bb Rison error handling (#4594) 2023-01-13 23:50:36 -05:00
Jeremy Rifkin 33167a3024 Tsify main (#4520) 2023-01-13 19:52:00 -05:00