diff --git a/README.md b/README.md index 51bd9fe..9b8855e 100644 --- a/README.md +++ b/README.md @@ -9,17 +9,18 @@ your `ModelAdmin` classes drive everything. No React code on your side. INSTALLED_APPS = [ # ... "django.contrib.admin", - "django_admin_rest_api", # the JSON REST API (sibling package — pulled in as a dependency) - "django_admin_react", # this package — the React SPA on top of it + "django_admin_react", # the React SPA — includes the JSON API for you ] # urls.py urlpatterns = [ path("admin/", admin.site.urls), - path("admin-react/", include("django_admin_react.urls")), # SPA + its API include + path("admin-react/", include("django_admin_react.urls")), # SPA + API in one include ] ``` +**One `INSTALLED_APPS` line + one URL include is the entire integration.** `pip install django-admin-react` transitively pulls in the [JSON API](https://pypi.org/project/django-admin-rest-api/) and the [MCP adapter](https://pypi.org/project/django-admin-mcp-api/); `django_admin_react.urls` includes the API endpoints at `/api/v1/…`, so the SPA finds its wire surface with zero configuration. (Mount the API a second time at your own prefix only if a non-SPA client also needs it.) + > **Beta — v1.0.0.** Available on PyPI; the SPA + the API > ([`django-admin-rest-api`](https://pypi.org/project/django-admin-rest-api/)) > + the MCP adapter diff --git a/django_admin_react/__init__.py b/django_admin_react/__init__.py index dbc36c8..ef855a4 100644 --- a/django_admin_react/__init__.py +++ b/django_admin_react/__init__.py @@ -1,10 +1,25 @@ -"""django-admin-react — a React single-page admin for Django. +"""django-admin-react — the React SPA super-layer for the Django admin. -The actual implementation lands across PRs #2-#7. This package is -currently a skeleton that defines the layout and the Django AppConfig -entry point only. See `ARCHITECTURE.md` for the design contract. +A drop-in single-page admin: same `pip install`, same `INSTALLED_APPS`, +same `urls.py include()` — and your `ModelAdmin` classes drive everything. +The JSON wire surface lives in the sibling +[`django-admin-rest-api`](https://pypi.org/project/django-admin-rest-api/) +package (pulled in as a dependency); the MCP exposure of the same surface +lives in +[`django-admin-mcp-api`](https://pypi.org/project/django-admin-mcp-api/). + +See `README.md` for install + the consumer wiring, and `ARCHITECTURE.md` +for what lives in this repo vs. the API / MCP siblings. """ -__version__ = "0.0.0" +from importlib.metadata import PackageNotFoundError +from importlib.metadata import version as _pkg_version + +try: + # Read the version directly from the installed distribution metadata + # so this constant never drifts from `pyproject.toml` after a release. + __version__ = _pkg_version("django-admin-react") +except PackageNotFoundError: # pragma: no cover — editable / source install + __version__ = "0.0.0" default_app_config = "django_admin_react.apps.DjangoAdminReactConfig" diff --git a/frontend/packages/sidebar/src/Sidebar.tsx b/frontend/packages/sidebar/src/Sidebar.tsx index a9434f3..9012f69 100644 --- a/frontend/packages/sidebar/src/Sidebar.tsx +++ b/frontend/packages/sidebar/src/Sidebar.tsx @@ -252,7 +252,11 @@ export function Sidebar() { }} placeholder="Filter models…" aria-label="Filter models" - className="w-full rounded border border-gray-700 bg-gray-800 px-2 py-1 text-sm text-gray-100 placeholder-gray-500 focus:outline-none focus-visible:ring-1 focus-visible:ring-gray-500" + // Bumped one step lighter than the sidebar surface (bg-gray-900) + // so the input reads as a distinct field, not as part of the + // sidebar (#556). `bg-gray-700` + `border-gray-600` gives the + // same two-step contrast the rest of the app's inputs have. + className="w-full rounded border border-gray-600 bg-gray-700 px-2 py-1 text-sm text-gray-100 placeholder-gray-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-gray-500" /> )} @@ -262,8 +266,10 @@ export function Sidebar() { grouped-nav style. */} {/* `border-t` draws the line above the FIRST section (the filter field sits above it); `divide-y` handles the lines between the - rest. */} -