forgejo/web_src/css
Beowulf 28e0af23fa
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
feat(ui): replace Monaco with CodeMirror (#10559)
- Replace the [Monaco Editor](https://microsoft.github.io/monaco-editor/)
with [CodeMirror 6](https://codemirror.net/). This editor is used to
facilitate the 'Add file' and 'Edit file' functionality.
- Rationale:
  - Monaco editor is a great and powerful editor, however for Forgejo's
  purpose it acts more like a small IDE than a code editor and is doing
  too much. In my limited user research the usage of editing files via
  the web UI is largely for small changes that does not need the
  features that Monaco editor provides.
  - Monaco editor has no mobile support, Codemirror is very usable on mobile.
  - Monaco editor pulls in large dependencies (for language support) and
  by replacing it with Codemirror the amount of time that webpack needs
  to build the frontend is reduced by 50% (~30s -> ~15s).
  - The binary of Forgejo (build with `bindata` tag) is reduced by 2MiB.
  - Codemirror is much more lightweight and should be more usable on
  less powerful hardware, most notably the lazy loading is much faster
  as codemirror uses less javascript.
  - Because Codemirror is modular it is much easier to change the
  behavior of the code editor if we wish to.
- Drawbacks:
  - Codemirror is quite modular and as seen in `package.json` and in
  `codeeditor.ts` we have to supply a lot more of its features to have
  feature parity with Monaco editor.
  - Monaco editor has great integrated language support (features that
  an lsp would provide), Codemirror only has such language support to an
  extend.
  - Monaco editor has its famous command palette (known by many as its
  also available in VSCode), this is not available in code mirror.
- Good to note:
  - All features that was added on top of the monaco editor (such as
  dynamically changing language  support depending on the filename)
  still works and the theme is based on the VSCode colors which largely
  resembles the monaco editor.
  - The code editor is still lazy-loaded (this is painfully clear by
  reading how imports are passed around in `codeeditor.ts`).
  - This change was privately tested by a few people, a few bugs were
  found (and fixed) but no major drawbacks were noted for their usage of
  the web editor.
  - There's a "search" button in the top bar, so that search can be used
  on mobile. It is otherwise only accessible via
  <kbd>Ctrl</kbd>+<kbd>f</kbd>.

Co-authored-by: Beowulf <beowulf@beocode.eu>

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10559
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2026-01-04 23:52:33 +01:00
..
chroma [Port] gitea#30014: Various code view improvements 2024-03-28 16:43:14 +01:00
codemirror Remove EasyMDE focus outline on text (#25328) 2023-06-18 04:10:07 +00:00
editor fix(ui/mde): fix switch height and buttons alignment (#9545) 2025-10-08 17:53:50 +02:00
features feat(ui): replace Monaco with CodeMirror (#10559) 2026-01-04 23:52:33 +01:00
markup feat(ui): render ordered checkbox lists with numbers (#9184) 2025-09-06 16:23:06 +02:00
modules chore: remove obsolete code from button-legacy.css (#10581) 2025-12-31 03:13:05 +01:00
repo ui: improve release editing (#9940) 2025-11-30 05:08:24 +01:00
shared fix(ui): improve milestone/project header consistency (#7174) 2025-03-09 16:24:52 +00:00
standalone Add toasts to UI (#25449) 2023-06-27 02:45:24 +00:00
themes chore: remove obsolete code from button-legacy.css (#10581) 2025-12-31 03:13:05 +01:00
actions.css fix: in-progress job icon doesn't rotate on repo's action list (#10656) 2026-01-01 17:36:20 +01:00
admin.css feat: move more modals to native dialogs (#9636) 2025-10-13 17:48:49 +02:00
base.css feat: Prioritize Noto Sans over Roboto and Noto Sans Hebrew over Arial (#6931) 2025-10-17 14:40:51 +02:00
dashboard.css feat(ui): welcome screen for user dashboard (#7030) 2025-02-23 08:41:31 +00:00
explore.css [Port] gitea#29982 Introduce .secondary-nav and handle .page-content spacing universally 2024-03-28 16:43:09 +01:00
font_i18n.css Fix @font-face overrides (#24855) 2023-05-24 01:48:51 +00:00
form.css chore(ui): remove unused css of id create-page-form (#9933) 2025-11-03 13:45:51 +01:00
helpers.css Merge pull request 'Replace gt-word-break with tw-break-anywhere' (#4102) from 0ko/forgejo:ui-replace-gt-word-break into forgejo 2024-06-11 10:39:03 +00:00
home.css fix(ui): center footer links (#7925) 2025-05-22 15:27:00 +02:00
index.css feat(ui): implement new buttons for better cohesiveness (#9359) 2025-10-05 05:22:32 +02:00
install.css UI improvements to optional sections in installation page (#4062) 2024-06-07 17:57:54 +00:00
migrate.css feat(ui): redesign migration selection screen (#6795) 2025-04-19 13:51:35 +00:00
org.css chore(ui): remove unused css of id create-page-form (#9933) 2025-11-03 13:45:51 +01:00
repo.css chore: remove obsolete code from button-legacy.css (#10581) 2025-12-31 03:13:05 +01:00
review.css chore(ui): cleanup reviews css, improve consistency (#10268) 2025-12-01 01:30:25 +01:00
user.css chore(ui): improve dropdown opener visibility (#9317) 2025-09-17 20:29:52 +02:00