pyvelm v0.19.0¶
Release date: 2026-05-28
A Drive-style upgrade to the bundled file_manager module: the
Library is now a three-column shell with folders, multi-select, bulk
actions, a slide-over Properties panel, and a company-scoped,
folder-navigable file picker.
Highlights¶
Drive-style File library (file_manager 0.3.0)¶
Files → Library (/web/files/library) is now a three-column shell
modelled on Nautilus / Windows Explorer / Google Drive:
| Column | What's there |
|---|---|
| Left | Folder tree (All files, Unfiled, nested folders). Collapsible branches — only the active working-directory path is expanded on load. |
| Centre | Subfolder tiles + files, rendered client-side by the pvFileLibrary Alpine component. Three view modes (Grid / Tiles / Details), a breadcrumb, an Up button, and folder-create affordances. |
| Right | Slide-over Properties panel (same body as the full Properties page). |
- Selection — click selects + opens the panel; shift-click range; ctrl/cmd-click toggles. A sticky action bar exposes Download, Move to, Copy to, Toggle public, Delete.
- View modes — Grid (tight thumbnails), Tiles (icon + name +
meta), Details (row list), persisted to
localStorage. Non-image files get a tinted type glyph (pdf / doc / xls / ppt / json / text / zip / audio / video / fallback). On small screens every grid collapses to a single column. - Folders — new
res.attachment.foldermodel (hierarchical via self-parent_id,ondelete="RESTRICT");ir.attachment.folder_idlinks rows (NULL= Unfiled). Create from a header New folder button, a dashed grid tile, or the right-click menu — all open a modal dialog. Rename / delete from the context menu (delete is guarded: 409 unless the folder is empty). - Drag-and-drop — native HTML5; drop tiles onto a tree node (or
Unfiled) to move via
POST /web/files/move.
Company-scoped library¶
The library is per-company. res.attachment.folder is
_company_scoped (auto company_id + per-company search filter).
ir.attachment stays cross-company (avatars / mail / reports) but
gains a nullable company_id that the library / picker / tree
queries scope to via _library_company_domain, and that uploads and
copies stamp with env.company_id. Company-less system attachments
simply don't surface in a company-scoped library view.
Properties page¶
/web/files/{id}/properties is a two-column page: a large preview
(image bytes for image MIMEs, MIME-family icon otherwise) and a
metadata grid — Name, Filename, Type, Size (human-readable),
Dimensions (images), Created, Updated, linked record, folder
breadcrumb, Public toggle — plus Download / Open linked record /
Delete. The same body renders as the right-panel fragment at
/web/files/{id}/properties_panel.
Image dimensions come from pyvelm.image_meta.read_image_dimensions
— a stdlib-only header parser for PNG / JPEG / GIF / WebP, no Pillow
dependency.
File-picker widgets¶
widget="file"/widget="files"— Many2one / Many2many pickers toir.attachment, now with a folder-navigable dialog (breadcrumb- drill-in, same as the Library) backed by
/web/files/pickerand the/web/files/picker/browseJSON endpoint. widget="file_url"— aChar-backed picker that stores/api/attachment/{id}/download(flipping the row public). Wired into company branding (logo_url,logo_url_dark,favicon_url).
Upgrade¶
- base bumps to 0.30.0 — two migrations add the nullable
ir_attachment.folder_id(0_28_to_0_29.py) andir_attachment.company_id(0_29_to_0_30.py) columns. Both are belt-and-bracesALTER … ADD COLUMN IF NOT EXISTSfor databases that upgrade base before re-installing file_manager; schema autogen covers fresh installs. - Apps → re-install / Sync
file_manager(0.3.0) so the newres.attachment.foldertable, ACL grants, and the repointed Library menu (/web/files/library) land. - No data backfill: existing attachments stay in Unfiled
(
folder_id IS NULL) and company-less attachments stay out of company-scoped library views. - Hard-refresh the browser to pick up the new shell + assets.
Also in this release¶
pyvelm/file_size.py(human_size, registered as a Jinja filter),pyvelm/file_icons.py(file_icon_key), andpyvelm/image_meta.pyship as top-level helpers so unit tests import them without going through thepyvelm.modulesnamespace._render_kanban_content/_kanban_fetchgained anextra_domain=kwarg;card(image=…)documents its thumbnail slot for reuse.- New tests:
test_image_meta.py,test_file_size.py, and an extendedtest_file_manager.py(library shell, picker, folder-create dialog,file_urlwidget).