Skip to content

feat(esign): list signed files, show them in OneDrive and delete them - #218

Merged
lorenzocorallo merged 1 commit into
mainfrom
feat/esign-signed-files
Dec 5, 2026
Merged

lorenzocorallo merged 1 commit into
mainfrom
feat/esign-signed-files

Conversation

@lorenzocorallo

Copy link
Copy Markdown
Member

What

Signatures › Signed files (/dashboard/esign/files) shows every completed request's signed PDF and where it was saved, with actions on the file in OneDrive or SharePoint.

  • Columns: document (title, then Drive › folder/file.pdf, or "Kept in the dashboard only"), Saved (Saved · Saving… · Not saved · Email failed · Deleted · Dashboard only, with the delivery error as a tooltip), Signed by, Signed on. A row opens its request.
  • Toolbar: Mine/Everyone for managers (as on Requests), search (title, path, drive, signers, requester), when it was signed (any time, last 30 days, this year) and drive (shown when there is more than one). Filters live in the URL (?scope=&period=&drive=). Pagination from 20 rows.
  • Actions:
    • Download PDF: the request's current, signed version. Anyone who can see the request.
    • Show in folder and Open in OneDrive: managers allowed on the drive. They open the folder's and the file's webUrl, read from the drive at the click (esign.requests.locateFile), so a file moved or renamed inside the shared folder is still found. A file no longer there gets a toast instead. The tab opens during the click, so popup blockers allow it, then goes to the address once the drive answers.
    • Delete…: managers. The dialog spells out what each choice deletes:
      • From OneDrive only: the file goes to the drive's recycle bin, restorable for 93 days, and the request stays.
      • From the dashboard only: the existing request delete, for good; the OneDrive copy stays.
      • From both. If deleting the request fails after the file is gone, the dialog says so and offers the request delete alone.
  • The request page says "Deleted from {drive}: …" instead of linking a deleted copy. Its activity shows "{name} deleted {file} from {drive}", and its Delete request dialog no longer claims a deleted copy stays.

Why a section of its own, not Requests' "Signed" filter

Requests is about who still has to sign, with a status, turn and progress column. This list is about the outputs: where each PDF is in OneDrive, whether it got there, and what to do with it there. It needs its own columns, filters (drive, signing date) and row actions. Requests' "Signed" filter is unchanged.

"Show in folder" and file highlighting

The folder's Graph webUrl opens the folder in OneDrive for Business or SharePoint. Microsoft documents no URL parameter that opens a folder view with one file selected. The community-known Forms/AllItems.aspx?id=<file path>&parent=<folder path> opens the file's preview over the folder instead, needs the library's view URL and isn't documented, so it isn't used. "Open in OneDrive" opens the file itself.

Conventions

  • New section in nav.ts (esign-files). New server functions: getEsignSignedFiles and getEsignSignedPdf (esignReadMiddleware), locateEsignFile and deleteEsignFile (esignRequestsManageMiddleware). Each has an MCP operation (esign.files.list, .content, .locate, .delete).
  • tests/server-security.test.mjs lists files-page.tsx with esign:requests:manage and its mutations (deleteEsignFile, deleteEsignRequest).
  • The pure helpers (signed-files.ts) are covered by tests/esign-signed-files.test.mjs.
  • docs/esign/contracts.md and TRACKER.md are updated.

Verification

  • pnpm check, pnpm typecheck, pnpm test and pnpm build pass locally against the backend branch's types, linked into node_modules, which is not committed.
  • Checked in agent mode (AGENT_BACKEND_TOKEN against a local backend from the backend branch, with its mock drive and seeded completed requests), at desktop and phone widths:
    • the list and the filters;
    • Delete → From OneDrive: the row becomes Deleted, the toast appears, and the request page shows the deleted line and the activity entry;
    • Show in folder against the mock drive, which has no web addresses: it reports that.

Merge order

  1. feat(esign): find and delete a completed request's saved file backend#197 first, then release @polinetwork/backend and deploy the backend.
  2. Bump @polinetwork/backend here to that release. Until then CI typecheck fails on esign.requests.locateFile, deleteFile, delivery.fileDeleted and outputDriveLabel. Then merge this PR.

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbf3b50b-54d3-40c8-8fe4-da904b493021
Commits

Reviewing files that changed from the base of the PR and between 02dd9c3 and 3cdbd66.

Files selected for processing: 15

  • docs/esign/TRACKER.md
  • docs/esign/contracts.md
  • src/components/shell/nav.ts
  • src/features/esign/esign.functions.ts
  • src/features/esign/files-page.tsx
  • src/features/esign/request-card.ts
  • src/features/esign/request-page.tsx
  • src/features/esign/requests.functions.ts
  • src/features/esign/signed-files.ts
  • src/lib/api/types.ts
  • src/mcp/operations/esign.ts
  • src/routeTree.gen.ts
  • src/routes/dashboard/esign/files.tsx
  • tests/esign-signed-files.test.mjs
  • tests/server-security.test.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Signatures › Signed files (/dashboard/esign/files) lists every completed
request's signed PDF: title, where it was saved (drive › folder/file), whether
it was saved (Saved, Saving…, Not saved, Email failed, Deleted, Dashboard
only), who signed and when. Search by title, file or signer; filter by when
everyone signed (any time, last 30 days, this year) and by drive; Mine or
Everyone for managers, as on Requests. A row opens its request.

Actions:
- Download PDF: the request's current version, for everyone who sees it.
- Show in folder and Open in OneDrive (managers allowed on the drive): the
  folder's and the file's webUrl, read from the drive at the click, so a file
  moved or renamed inside the shared folder is still found. The tab opens in
  the click and follows once the drive answered, so popup blockers allow it.
  SharePoint documents no address that opens a folder with one file
  selected, so Show in folder opens the folder.
- Delete… says what it deletes: the copy in OneDrive or SharePoint (to the
  recycle bin, restorable for 93 days; the request stays), the request in the
  dashboard (for good; the copy stays), or both.

Why a section rather than Requests' Signed filter: Requests is about who
still has to sign; this list is about the files, their place in OneDrive and
what happens to them there, with its own columns, filters and actions.

The request page says when the copy was deleted from OneDrive, and its
activity names who did it.

Server functions getEsignSignedFiles, getEsignSignedPdf (esignReadMiddleware),
locateEsignFile and deleteEsignFile (esignRequestsManageMiddleware), each with
an MCP operation (esign.files.list, .content, .locate, .delete).

Needs the @polinetwork/backend release with esign.requests.locateFile and
deleteFile (PoliNetworkOrg/backend feat/esign-signed-files): until then
typecheck fails on the missing procedures.
@lorenzocorallo
lorenzocorallo force-pushed the feat/esign-signed-files branch from 34f2f6a to 3cdbd66 Compare December 5, 2026 19:46
@lorenzocorallo
lorenzocorallo merged commit cc4580b into main Dec 5, 2026
@lorenzocorallo
lorenzocorallo deleted the feat/esign-signed-files branch December 5, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant