Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog

### v0.4.1.0 (2026-10-16) — latest
### v0.4.1.1 (2026-10-21) — latest
**Patch release: CKEditor readable in light and dark mode, working "Log in as guest" button**
- **Fixed**: CKEditor fields (`text_field_widget = "ckeditor"`, `CKEditor5Widget`) had a transparent editor and toolbar, and in dark mode black text on the dark background. `base/css/ckeditor5.css` was Tailwind source served without a build, so browsers dropped its rules. It is now plain CSS that only overrides CKEditor's `--ck-*` variables with Unfold's colors, in light mode and in Unfold's dark mode (`html.dark`, also set by dark daisyUI themes). This covers the toolbar, dialogs, captions, todo checkboxes, code blocks and find & replace matches. Editor content uses Inter.
- **Fixed**: the login page's "Log in as guest" button had no background (`bg-secondary-600` was never compiled). It now uses Unfold's secondary button and appears only when an active staff `guest` account exists (new `{% guest_login_available %}` tag in the `wn_guest` library).
- **Fixed**: a failed guest login silently returned to the login page. `GuestLoginView` now shows "Guest login is not available." and keeps `?next`. It also works under Django's `LoginRequiredMiddleware` and lets any logged-in user switch to guest. A failed switch restores the previous session instead of returning a 500 (read-only database with DB-backed sessions). `?next` must have the same host and scheme.
- **Fixed**: `AutoGuestLoginMiddleware` raised `NoReverseMatch` for `?next=<path>` (it was resolved as a URL name) and hid errors. It now redirects to the URL and logs failures.
- **Changed**: Tailwind no longer scans its own output (`styles.css`), so rebuilds are reproducible.
- **Docs**: `docs/CKEDITOR5_CUSTOMIZATION.md` rewritten: there is no build step, and a project extends the packaged theme by `@import`ing it from its own `CKEDITOR_5_CUSTOM_CSS`.
- **Tests**: guest login button, view and middleware (13 tests); `ckeditor5.css` contains no Tailwind syntax and overrides every fixed CKEditor light color for dark mode, or lists it as reviewed, so a django-ckeditor-5 upgrade that adds one fails the suite.
- **Upgrade**: `pip install -U django-whiteneuron==0.4.1.1`, `collectstatic`. No migrations or new settings. Projects with their own `CKEDITOR_5_CUSTOM_CSS` are unaffected. Docker base images `v0.4.1.1` are published by the release workflow.

### v0.4.1.0 (2026-10-16)
**Feature release: admin About page (application / base versions and release dates)**
- **Added**: admin **About** page (`/admin/about/`, sidebar *System → About*, URL name `admin:about`). Every staff user sees the application name, version, release date and short build id (`VERSION`, `RELEASE_DATE`, `BUILD_ID` / `GIT_COMMIT`, cut to 12 characters) and the django-whiteneuron version and release date with a changelog link; superusers also see Python/Django/Unfold versions, database engine, debug mode, time zone, server time, process start and uptime.
- **Added**: `APP_INFO_CALLBACK` setting (`"path.to.func"`, `func(request) -> [(label, value), ...]`) for project rows on the About page; a failing callback is logged and skipped.
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,22 @@ A modern Django Admin extension focused on UI/UX, dashboard, feedback, file mana
![django-whiteneuron](https://raw.githubusercontent.com/White-Neuron/django-whiteneuron/main2.0/docs/images/main.png)

## Current Version
v0.4.1.0
v0.4.1.1

## Changelog

### Latest: v0.4.1.0 (2026-10-16)
### Latest: v0.4.1.1 (2026-10-21)
**Patch release: CKEditor readable in light and dark mode, working "Log in as guest" button**
- **Fixed**: CKEditor fields (`text_field_widget = "ckeditor"`, `CKEditor5Widget`) had a transparent editor and toolbar, and in dark mode black text on the dark background. `base/css/ckeditor5.css` was Tailwind source served without a build, so browsers dropped its rules. It is now plain CSS that only overrides CKEditor's `--ck-*` variables with Unfold's colors, in light mode and in Unfold's dark mode (`html.dark`, also set by dark daisyUI themes). This covers the toolbar, dialogs, captions, todo checkboxes, code blocks and find & replace matches. Editor content uses Inter.
- **Fixed**: the login page's "Log in as guest" button had no background (`bg-secondary-600` was never compiled). It now uses Unfold's secondary button and appears only when an active staff `guest` account exists (new `{% guest_login_available %}` tag in the `wn_guest` library).
- **Fixed**: a failed guest login silently returned to the login page. `GuestLoginView` now shows "Guest login is not available." and keeps `?next`. It also works under Django's `LoginRequiredMiddleware` and lets any logged-in user switch to guest. A failed switch restores the previous session instead of returning a 500 (read-only database with DB-backed sessions). `?next` must have the same host and scheme.
- **Fixed**: `AutoGuestLoginMiddleware` raised `NoReverseMatch` for `?next=<path>` (it was resolved as a URL name) and hid errors. It now redirects to the URL and logs failures.
- **Changed**: Tailwind no longer scans its own output (`styles.css`), so rebuilds are reproducible.
- **Docs**: `docs/CKEDITOR5_CUSTOMIZATION.md` rewritten: there is no build step, and a project extends the packaged theme by `@import`ing it from its own `CKEDITOR_5_CUSTOM_CSS`.
- **Tests**: guest login button, view and middleware (13 tests); `ckeditor5.css` contains no Tailwind syntax and overrides every fixed CKEditor light color for dark mode, or lists it as reviewed, so a django-ckeditor-5 upgrade that adds one fails the suite.
- **Upgrade**: `pip install -U django-whiteneuron==0.4.1.1`, `collectstatic`. No migrations or new settings. Projects with their own `CKEDITOR_5_CUSTOM_CSS` are unaffected. Docker base images `v0.4.1.1` are published by the release workflow.

### v0.4.1.0 (2026-10-16)
**Feature release: admin About page (application / base versions and release dates)**
- **Added**: admin **About** page (`/admin/about/`, sidebar *System → About*, URL name `admin:about`). Every staff user sees the application name, version, release date and short build id (`VERSION`, `RELEASE_DATE`, `BUILD_ID` / `GIT_COMMIT`, cut to 12 characters) and the django-whiteneuron version and release date with a changelog link; superusers also see Python/Django/Unfold versions, database engine, debug mode, time zone, server time, process start and uptime.
- **Added**: `APP_INFO_CALLBACK` setting (`"path.to.func"`, `func(request) -> [(label, value), ...]`) for project rows on the About page; a failing callback is logged and skipped.
Expand Down
132 changes: 132 additions & 0 deletions docs/reports/releases/2026-10-21-v0.4.1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Release Notes: v0.4.1.1

**Date**: 2026-10-21
**Type**: Patch release (no migrations, no new settings, no breaking changes)
**Scope**: CKEditor theme in light and dark mode; "Log in as guest" button and guest login errors

---

## Summary

v0.4.1.1 fixes two things that looked broken to admin users. CKEditor fields were transparent, and
in dark mode their text was black on a dark background. The guest login button had no background,
and when no guest account was usable it did nothing. Both now work in light mode, dark mode and
every daisyUI theme.

---

## Fixed

### CKEditor theme (PR #27)
`CKEDITOR_5_CUSTOM_CSS = "base/css/ckeditor5.css"` is linked as-is by django-ckeditor-5, but the
file was Tailwind source that no build step compiled. Browsers dropped 100 of its 108 rules, and the
`theme()` values made the `--ck-color-*` overrides invalid. The editor and toolbar became
transparent, and in dark mode the content kept CKEditor's black text.

The file is now plain CSS with no build step. It only overrides CKEditor's `--ck-*` variables, which
is CKEditor's documented theming method, so every editor feature keeps CKEditor's own styles.

| Mode | What follows Unfold's colors |
|---|---|
| Light | borders, text, focus border and glow, links, "on" buttons; content font Inter |
| Dark (`html.dark`) | the base colors most of CKEditor's UI derives from, plus every fixed light color that would be unreadable: buttons and inputs, placeholders, selection, links, shadows, captions and their highlight flash, the keyboard shortcuts dialog (Alt+0), the style panel, table border helpers, content text |
| Dark, rules | code block text, todo checkbox borders, find & replace matches (colors CKEditor sets without a variable) |

Dark mode follows Unfold's `dark` class on `<html>`, which dark daisyUI themes also set.

### "Log in as guest" (PR #26)
- The button used `bg-secondary-600`, which was never compiled into `styles.css`, so it read as plain
text. It now uses Unfold's secondary button, like the other login buttons.
- The button appears only when an active staff `guest` account exists. The check is the new
`{% guest_login_available %}` tag (`{% load wn_guest %}`), so it works on any admin site that
renders `admin/login.html`.
- `GuestLoginView`:
- shows "Guest login is not available." when the login fails, and returns to the login page with
the original `?next`
- is marked `login_not_required`, so it works with Django's `LoginRequiredMiddleware`
- lets any logged-in user on the login page switch to guest
- restores the previous session when the switch fails, instead of returning a 500 (read-only
database with DB-backed sessions). A read-only database that refuses only the `last_login`
write (demo mode) still logs the guest in, as before
- accepts `?next` only on the same host and scheme
- `AutoGuestLoginMiddleware` resolved `?next` as a URL name, so `?next=/admin/foo/` raised
`NoReverseMatch`. It now redirects to the URL, and logs failures instead of ignoring them.

---

## Changed
- Tailwind no longer scans its own output (`whiteneuron/static/base/css/styles.css`). Removed
utilities kept their theme variables alive, so rebuilds weren't reproducible.
- `docs/CKEDITOR5_CUSTOMIZATION.md` is rewritten. It described a build step and a JS file that
don't exist.

---

## Tests
- `GuestLoginButtonTests`, `AutoGuestLoginMiddlewareTests` (13 tests).
- `CKEditorCustomCssTests`:
- the packaged `ckeditor5.css` contains no Tailwind syntax (`@apply`, `theme(`, `@theme`,
`@utility`, `@variant`, ...)
- every fixed light color in CKEditor's CSS is overridden for dark mode or listed as reviewed
(accents, translucent overlays, badges). A django-ckeditor-5 upgrade that adds one fails the
suite instead of shipping light-on-dark text.

---

## Files changed

| File | Change |
|---|---|
| `whiteneuron/static/base/css/ckeditor5.css` | rewritten as plain CSS, `--ck-*` variables only |
| `docs/CKEDITOR5_CUSTOMIZATION.md` | rewritten |
| `whiteneuron/templates/admin/login_after.html` | guest button style and visibility |
| `whiteneuron/base/templatetags/wn_guest.py` | new `guest_login_available` tag |
| `whiteneuron/base/utils.py` | `get_guest_user`, `log_in_guest`, `safe_next_url` |
| `whiteneuron/base/views.py` | `GuestLoginView` error message, `?next`, session restore |
| `whiteneuron/base/middleware.py` | `AutoGuestLoginMiddleware` redirect and logging |
| `whiteneuron/locale/vi/LC_MESSAGES/django.po`, `.mo` | "Guest login is not available." |
| `styles.css`, `whiteneuron/static/base/css/styles.css` | Tailwind source exclusion, rebuilt CSS |
| `whiteneuron/base/tests_regressions.py` | tests above |
| `pyproject.toml`, `uv.lock`, `whiteneuron/__init__.py`, `CHANGELOG.md`, `README.md` | version 0.4.1.1 |

---

## Compatibility / Upgrade

```bash
pip install -U django-whiteneuron==0.4.1.1
python manage.py collectstatic
```

- No migrations, no new settings.
- Projects that set their own `CKEDITOR_5_CUSTOM_CSS` are unaffected. To build on the packaged theme
instead of replacing it, start your file with
`@import url("../../base/css/ckeditor5.css");` (path relative to your file) and override
variables after it. See `docs/CKEDITOR5_CUSTOMIZATION.md`.
- Projects that override `admin/login_after.html` keep their own button. To hide it when no guest
account exists, wrap it in `{% load wn_guest %}{% guest_login_available as can_guest %}{% if can_guest %}...{% endif %}`.
- Translators: new msgid `Guest login is not available.` (Vietnamese included).
- Docker base images `django-whiteneuron-{alpine,debian}:v0.4.1.1` are published by the release
workflow; WN-Sense can set `BASE=v0.4.1.1`.

### Known issues (unchanged)
- Unfold's preflight resets typography inside the editor (headings at body size, hidden list
bullets).
- `AutoGuestLoginMiddleware` is enabled when `SKIP_GUEST_LOGIN=True`, the opposite of what the name
suggests. It is kept as is because changing it would affect existing projects.

### Rollback
Revert to v0.4.1.0. There are no schema or settings changes.

---

## Validation
- [x] `manage.py test whiteneuron`: 75 tests pass
- [x] `check` clean; `makemigrations --check`: no changes
- [x] `msgfmt --check` on the Vietnamese catalog
- [x] Tailwind build reproducible (`bash scripts/tailwind.sh` leaves `styles.css` unchanged)
- [x] `uv build` produces the wheel and sdist; `twine check` passes
- [x] Chrome: CKEditor with Unfold's CSS and colors, light and dark (toolbar, content, find & replace,
Alt+0 dialog, todo list, code block, captions)
- [x] Chromium: guest button in light and dark, guest login, hidden button and error message with
the guest deactivated (PR #26)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "django-whiteneuron"
version = "0.4.1.0"
version = "0.4.1.1"
description = "A modern Django Admin extension with enhanced UI/UX, dashboard, feedback, file management, rate limiting, IP blacklisting, and advanced admin integrations built on django-unfold."
authors = [
{name = "White Neuron", email = "anhnt@whiteneuron.ai"}
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions whiteneuron/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Keep in sync with pyproject.toml and CHANGELOG.md (checked by the test suite)
__version__ = "0.4.1.0"
__release_date__ = "2026-10-16"
__version__ = "0.4.1.1"
__release_date__ = "2026-10-21"
Loading