Commit graph

1884 commits

Author SHA1 Message Date
Sylvain Boissel
4e54a53072
(backend) add resource server api
Adds a resource server API similar to the one that already
exists for Drive.
2026-03-18 16:06:29 +01:00
Charles Englebert
4f8aea7b80
Search feature flags (#1897)
## Purpose

For beta testing purposes we need to be able to activate Find hybrid
search to some users, Find full-text search to some others and leave
remaining users on basic DRF title search.

## Proposal

The solution proposed is based on [django-waffle
](https://waffle.readthedocs.io/en/stable/types/flag.html).

- [x] install waffle and activate the default app in settings.
- [x] implement `_get_search_type` in `DocumentViewset` to determine
which search type (title, hybrid or full-text) to use.
- [x] send the `search_type` in the search query. 

## External contributions

Thank you for your contribution! 🎉  

Please ensure the following items are checked before submitting your
pull request:
- [x] I have read and followed the [contributing
guidelines](https://github.com/suitenumerique/docs/blob/main/CONTRIBUTING.md)
- [x] I have read and agreed to the [Code of
Conduct](https://github.com/suitenumerique/docs/blob/main/CODE_OF_CONDUCT.md)
- [x] I have signed off my commits with `git commit --signoff` (DCO
compliance)
- [x] I have signed my commits with my SSH or GPG key (`git commit -S`)
- [x] My commit messages follow the required format: `<gitmoji>(type)
title description`
- [x] I have added a changelog entry under `## [Unreleased]` section (if
noticeable change)
- [x] I have added corresponding tests for new features or bug fixes (if
applicable)

---------

Signed-off-by: charles <charles.englebert@protonmail.com>
2026-03-18 15:04:55 +00:00
Cyril
1172fbe0b5
️(frontend) add nb accesses in share button aria-label
Expose nb_accesses_direct to screen readers when share button shows count.
2026-03-18 14:21:04 +01:00
Cyril
7cf144e0de
️(frontend) fix modal aria-label object Object
Add aria-label on modals with JSX title to avoid returning object Object
2026-03-18 13:39:50 +01:00
Anthony LC
54c15c541e
🐛(frontend) fix image resizing when caption
When the caption was present, the image resizing
handles were not working.
This was because we were adding a Figure element
around the resizing div instead of the image itself.
2026-03-18 12:17:06 +01:00
Cyril
8472e661f5
️(frontend) fix Copy link toast accessibility for screen readers
Add aria-live announcements so screen readers announce the toast feedback.
2026-03-18 11:51:15 +01:00
Cyril
1d819d8fa2
️(frontend) fix share modal heading hierarchy
Improve h struct in docShareModal use h2 for group names and link settings
2026-03-18 10:47:39 +01:00
Cyril
5020bc1c1a
️(frontend) fix share modal heading hierarchy
Render QuickSearchGroup names and link settings as h2 headings.
2026-03-18 10:02:24 +01:00
Cyril
4cd72ffa4f
️(frontend) ensure doc title is h1 for accessibility
Fix heading hierarchy when withTitle is false in production
2026-03-18 10:02:08 +01:00
Anthony LC
c1998a9b24
🙈(docker) add **/.next to .dockerignore
All the ".next" files are generated by the build
process and should not be included in the Docker
context.
2026-03-18 09:04:46 +01:00
Charles Englebert
0fca6db79c
Integrate Find (#1834)
## Purpose

integrate Find to Docs

## Proposal

- [x]  add a `useSeachDocs` hook in charged of calling the search
endpoint.
- [x]  add a optional `path` param to the `search` route. This param
represents the parent document path in case of a sub-documents
(descendants) search.
- [x] ️return Indexer results directly without DB calls to retrieve the
Document objects. All informations necessary for display are indexed in
Find. We can skip the DB calls and improve performance.
- [x] ♻️ refactor react `DocSearchContent` components.
`DocSearchContent` and `DocSearchSubContent` are now merged a unique
component handling all search scenarios and relying on the unique
`search` route.
- [x] 🔥remove pagination logic in the Indexer. Removing the DB calls
also removes the DRF queryset object which handles the pagination. Also
we consider pagination not to be necessary for search v1.
- [x] 🔥remove the `document/<document_id>/descendants` route. This route
is not used anymore. The logic of finding the descendants are moved to
the internal `_list_descendants` method. This method is based on the
parent `path` instead of the parent `id` which has some consequence
about the user access management. Relying on the path prevents the use
of the `self.get_object()` method which used to handle the user access
logic.
- [x] handle fallback logic on DRF based title search in case of
non-configured, badly configured or failing at run time indexer.
- [x] handle language extension in `title` field. Find returns titles
with a language extension (ex: `{ title.fr: "rapport d'activité" }`
instead of `{ "title": "rapport d'activité" }`.
- [x] 🔧 add a `common.test` file to allow running the tests without
docker
- [x] ♻️ rename `SearchIndexer` -> `FindDocumentIndexer`. This class has
to do with Find in particular and the convention is more coherent with
`BaseDocumentIndexer`
- [x] ♻️ rename `SEARCH_INDEXER_URL` -> `INDEXING_URL` and
`SEARCH_INDEXER_QUERY_URL` -> `SEARCH_URL`. I found the original names
very confusing.
- [x] 🔧 update the environment variables to activate the
FindDocumentIndexer.
- [x] automate the generation of encryption key during bootstrap.
OIDC_STORE_REFRESH_TOKEN_KEY is a mandatory secret key. We can not push
it on Github and we want any contributor to be able to run the app by
only running the `make bootstrap`. We chose to generate and wright it
into the `common.local` during bootstrap.

## External contributions

Thank you for your contribution! 🎉  

Please ensure the following items are checked before submitting your
pull request:
- [x] I have read and followed the [contributing
guidelines](https://github.com/suitenumerique/docs/blob/main/CONTRIBUTING.md)
- [x] I have read and agreed to the [Code of
Conduct](https://github.com/suitenumerique/docs/blob/main/CODE_OF_CONDUCT.md)
- [x] I have signed off my commits with `git commit --signoff` (DCO
compliance)
- [x] I have signed my commits with my SSH or GPG key (`git commit -S`)
- [x] My commit messages follow the required format: `<gitmoji>(type)
title description`
- [x] I have added a changelog entry under `## [Unreleased]` section (if
noticeable change)
- [x] I have added corresponding tests for new features or bug fixes (if
applicable)

---------

Signed-off-by: charles <charles.englebert@protonmail.com>
2026-03-17 17:32:03 +01:00
Manuel Raynaud
ad36210e45
🔖(patch) release 4.8.1
Added

- 🔧(backend) add DB_PSYCOPG_POOL_ENABLED settings

Changed

- ⬇️(backend) downgrade django-treebeard to version < 5.0.0
2026-03-17 13:29:05 +01:00
Manuel Raynaud
73a7c250b5
🔧(backend) add DB_PSYCOPG_POOL_ENABLED settings
The psycopg pool config was enabled by default forcing its usage. Using
psycopg pool can be difficult, finding the good configuration take time.
By default its usage should be disable and the maintainer of the
instance should decide to enable it or not.
2026-03-17 13:19:17 +01:00
Manuel Raynaud
0c17d76f60
⬇️(backend) downgrade django-treebeard to version < 5.0.0
Since we upgraded to django-treebeard version 5 we have anormal behavior
and a high error rate on the document.path property. We must downgrade
it and avoid future upgrade from renovate.
2026-03-17 13:17:05 +01:00
Manuel Raynaud
04c9dc3294
🔧(backend) allow to configure psycopg pool timeout
We want to allow the configuration of the psycopg pool timeout.
For this we created a new setting DB_PSYCOPG_POOL_TIMEOUT
2026-03-16 15:30:23 +01:00
Manuel Raynaud
32b2641fd8
(hub) increase max pool size
In order to run the tests we need to increase the max pool size. Only
having 4 connections in the pool is not enough and all the tests using a
transaction are failing with a tiemout error.
We have the same problem running locally so the same value is added to
the postgresql environment file
2026-03-16 15:30:23 +01:00
Manuel Raynaud
07966c5461
🔧(helm) update values.yaml annotations
The annotation in the values.yaml have not been updated since a while.
This commit update them and generate the readme using the generate-readme.sh
script
2026-03-16 15:30:23 +01:00
Manuel Raynaud
bcb50a5fce
🔧(helm) allow specific env var for the backend and celery deploy
We want the possibility to configure specific environment variables on
backend and celery deployment. Most of them are common but in the case
of the newly added settings DB_PSYCOPG_POOL_MIN_SIZE we want to
configure ot only on the backend deployment, not on the celery or with a
different value.
2026-03-16 15:30:22 +01:00
Manuel Raynaud
ba93bcf20b
🔧(backend) enable psycopg-pool allowing configuring min and max size
We enable the pool option on the DB configuration. We want to allow the
configuration of the min and max sixe in a first time. They can be
configured using the settings DB_PSYCOPG_POOL_MIN_SIZE and
DB_PSYCOPG_POOL_MAX_SIZE. They have their default value to 4 and None.
2026-03-16 15:30:22 +01:00
Manuel Raynaud
2e05aec303
(backend) install psycopg_pool
We want to use psycopg_pool, it can be installed as a psycopg extra
dependency.
2026-03-16 15:30:22 +01:00
Anthony LC
51e8332b95
🔖(minor) release 4.8.0
Added:
- (backend) add a is_first_connection flag to the User model
- (frontend) add onboarding modal with help menu button

Changed:
- (frontend) localize LaGaufre label fallback in Docs
- (backend) add a migration cleaning on-boarding
  document accesses
- ⬆️(frontend) upgrade Next.js to v16
- ️(frontend) fix aria-label and landmark on document
  banner state
- 🌐(i18n) add "new window" translation key for waffle
  aria-label

Fixed:
- 🐛(backend) create a link_trace record for on-boarding
  documents
- 🐛(backend) manage race condition when creating sandbox
  document
- 🐛(frontend) fix flickering left panel
- ️(frontend) improve doc tree keyboard navigation
2026-03-13 18:00:32 +01:00
AntoLC
eb2ee1bb7f
🌐(i18n) update translated strings
Update translated files with new translations
2026-03-13 18:00:32 +01:00
Anthony LC
d34f279455
📱(frontend) improve mobile design left panel
Improve the onboarding modal design for
mobile devices.
Improve as well the left panel on mobile devices
to fit more with the Figma design.
2026-03-13 17:22:55 +01:00
Anthony LC
3eed542800
(frontend) display onboarding modal when first connection
When the user connect for the first time, we
display a onboarding modal, that explains the
main functionnalities of Docs.
2026-03-13 17:22:54 +01:00
Anthony LC
5f2c472726
🌐(frontend) add currentLocale to CunninghamProvider
In order to have the text of components from the
Cunningham library translated, we need to pass the current
locale to the CunninghamProvider.
We need to create a new ThemeProvider component that
will wrap the CunninghamProvider in order to have
react-query fully loaded.
2026-03-13 17:22:54 +01:00
Cyril
9e313e30a7
(frontend) add e2e test for onboarding modal
Ensure onboarding entrypoint and modal navigation work end-to-end.
2026-03-13 17:22:54 +01:00
Cyril
6c493c24d5
(frontend) add onboarding modal with help menu button
integrate onboarding feature accessible from left panel help menu

(frontend) add docs onboarding and help memu

Introduce an onboarding to guide users through core features.
2026-03-13 16:27:21 +01:00
Anthony LC
c3acfe45d2
🐛(frontend) fix skeleton blocked on main page
If navigating quickly between documents, the
skeleton of the document page can be blocked
on the main page.
This commit fixes this issue by reseting the skeleton
state when unmounting the document page.
2026-03-13 11:10:13 +01:00
Anthony LC
a9d2517c7b
🐛(frontend) fix flickering left panel
In some cases, the left panel can flicker
when navigating from the index to a document page.
This is due to different state + a transition effect.
To fix this, we remove the transition effect
when mounting.
2026-03-13 10:34:56 +01:00
Cyril
a2ae41296d
️(frontend) fix doc tree keyboard navigation regressions
Shift+Tab from sub-doc returns focus to root item
2026-03-12 17:10:09 +01:00
Cyril
1016b1c25d
️(i18n) add "new window" translation key for waffle aria-label
Add key used by LaGaufreV2 for localized aria-label on external links.
2026-03-12 16:13:51 +01:00
Cyril
0c649a65b0
️(frontend) fix redundant a-label and improper landmark on public alert
Remove aria-label and region role to avoid duplicate screen reader announcement
2026-03-12 15:10:25 +01:00
Anthony LC
11d899437a
️(frontend) improve bundle size
Improve bundle size by improving tree shaking
and code splitting.
2026-03-12 14:34:23 +01:00
Anthony LC
27c5e0ce5a
(frontend) use eslint instead of next lint
Version 16 of Next.js stopped supporting eslint natively.
We need to implement it ourselves.
2026-03-12 14:34:23 +01:00
Anthony LC
9337c4b1d5
♻️(frontend) adapt emoji copying to turbopack build
We were previously copying the emoji assets
in a webpack plugin, but that doesn't run with
turbopack. This commit moves the copying to a
pre-build script, which runs regardless of the
bundler used.
2026-03-12 14:34:23 +01:00
Anthony LC
679b29e2e0
⬆️(frontend) upgrade Next.js to v16
Upgrade Next.js to v16, which includes Turbopack
support by default. It improves dev and build
performance considerably.
2026-03-12 14:34:23 +01:00
Manuel Raynaud
3cad1b8a39
(backend) add a migration for cleaning onboarding document accesses
We change the strategy on how the new users have access to the
onboarding documents. We should remove all created accesses we don't
want to have anymore. There is no need to add them in the link_trace
table, they are already present in the favorites and user have already
access to it.
2026-03-12 13:52:23 +01:00
Manuel Raynaud
2eb2641d2c
🐛(backend) manage race condition when creating sandbox document
When a user is created and a sandbox document should be created, we can
have a race condition on the document creation leading to an error for
the user. To avoid this we have to manage this part in a transaction and
locking the document table
2026-03-12 13:51:41 +01:00
Manuel Raynaud
e36366b293
🐛(backend) create a link_trace record for onboarded documents
When a user is created, we created accesses to a list of onboarding
documents. Doing this have side effect on the proximity search feature.
Instead of creating access, we should create link_reach
2026-03-12 13:51:41 +01:00
Cyril
6d73fb69b0
️(frontend) localize LaGaufre label fallback in Docs
We pass a translated fallback label so the waffle follows the app locale.
2026-03-12 11:07:24 +01:00
Sylvain Boissel
b708c8b352
(backend) add a is_first_connection flag to the User model
Backend part of #1796.

This changes allows to display an onboarding modal the first time that
the get_me() API view is called.
I originally tried to check if `User.last_login` was `None`, but it is
updated as soon as the user is logged, so I chose to create a flag on
the model.
2026-03-11 14:34:55 +00:00
Manuel Raynaud
36c6762026
⬇️(backend) downgrade langfuse to version 3.11.2
We to keep in sync the version of the sdk client and the version of the
langfuse server. For now we can't upgrade langfuse See
https://github.com/langfuse/langfuse/issues/11564
2026-03-11 09:54:26 +00:00
Hadrien Blanc
4637d6f1fe
📝 Fix documentation and comment typos (#1977)
Fix typos found in documentation and code comments across the codebase.
2026-03-11 09:29:57 +00:00
Anthony LC
167375231b
🔖(minor) release 4.7.0
Added:
- (helm) allow all keys in configMap as env var

Changed:
- 📝(docs) improve README and add documentation hub
- ️(frontend) restore focus to triggers after closing menus and modals
- 🚸(frontend) change position elements toolbar
- ️(frontend) add focus on open to modals

Fixed:
- 🐛(frontend) analytic feature flags problem
- 🐛(frontend) fix home collapsing panel
- 🐛(frontend) fix disabled color on icon Dropdown
- 🐛(frontend) fix zIndex table of content
- 🐛(frontend) fix bug when language not supported by BN
- 🐛 (backend) prevent privileged users from requesting access
2026-03-10 10:25:11 +01:00
Anthony LC
c17fb3e6cc
🩹(frontend) fix small ui issue
- Better position of close icon modal
- Fix some z-index issues with the floating bar
- Fix translation not made
2026-03-10 10:25:11 +01:00
AntoLC
1be89180fe
🌐(i18n) update translated strings
Update translated files with new translations
2026-03-09 18:27:30 +01:00
Manuel Raynaud
6a3b33ec32
⬇️(backend) downgrade pydantic-ai-slim to version 1.58.0
We upgrade pydantic-ai-slim to version 1.63.0, we have an error when
Docs is run in preprod environment.
We have to investigate why and we decided to downgrade to a working
version
2026-03-09 18:27:30 +01:00
Anthony LC
29f2c2ebdf
💄(frontend) fix flickering tree title
The title was flickering because the icons were
loading and pushing the div to the left. We do not
need the icons part if we are not hovering the tree
item, so we can hide it until we hover the item.
2026-03-09 14:43:38 +01:00
Anthony LC
9d320092df
⬆️(frontend) bump blocknote to 0.47.1
Bump BlockNote to 0.47.1 to fix the issues with
the ai selections.
2026-03-09 14:43:38 +01:00
Anthony LC
77535b0292
🚸(frontend) change position elements toolbar
The AI and comment toolbar buttons are now
positioned at the end of the toolbar.
They were taking too much space on the left
which was not ideal for user experience.
2026-03-09 14:43:38 +01:00