Skip to content

feat(viewer): let a caller turn the sidebar off - #13

Merged
skjnldsv merged 3 commits into
mainfrom
feat/enable-sidebar-option
Sep 9, 2026
Merged

feat(viewer): let a caller turn the sidebar off#13
skjnldsv merged 3 commits into
mainfrom
feat/enable-sidebar-option

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The Files sidebar resolves a file by its dav source, so it can only be opened for a file the Files app can find there. An old version of a file is served from the versions endpoint and is not one of those — the button shows and does nothing.

enableSidebar, defaulting to true, is what the old OCA.Viewer API had for exactly this, and the versions sidebar in the server needs it back to port off that global (nextcloud/server#63954).

Stacked on #12, which is stacked on #11.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

Registering the built-in handlers on import made the entry call into
lib/models, which imports registerHandler back from the entry. Entering
the graph through a model rather than through the entry then reached the
entry mid-evaluation and called a handler module that had not run yet:

    Cannot access '__vite_ssr_import_2__' before initialization

The registry, the file actions and IHandler move to lib/handlers.ts,
which the models import instead. The entry keeps its exports and is now
only what it does on import: offer this copy, hold the service, register
the defaults.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The modal title, the document title, the comparison header, the image
alt text and the editor label all read the basename. A node can carry a
display name that differs from it — a file version is served under its
version id and reads as the date it was taken — and then every one of
those showed a number.

Node.displayname falls back to the basename, so nothing changes for a
node without one. Renaming still works on the basename, which is what
it edits.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
The Files sidebar resolves a file by its dav source, so it can only be
opened for a file the Files app can find there. An old version of a
file is served from the versions endpoint and is not one of those: the
button is offered and does nothing.

enableSidebar, defaulting to true, is what the old OCA.Viewer API had
for this, and the versions sidebar in the server needs it back to port.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added the status: review Waiting for reviews label Sep 9, 2026
@skjnldsv skjnldsv added type: enhancement 🚀 New feature or request AI assisted labels Sep 9, 2026
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.03226% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.41%. Comparing base (37e69a1) to head (33dbf43).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
lib/handlers.ts 88.97% 14 Missing and 1 partial ⚠️
lib/views/Viewer.vue 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   72.03%   72.41%   +0.38%     
==========================================
  Files          33       34       +1     
  Lines        2285     2302      +17     
  Branches      377      382       +5     
==========================================
+ Hits         1646     1667      +21     
+ Misses        633      629       -4     
  Partials        6        6              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skjnldsv
skjnldsv merged commit d2ce196 into main Sep 9, 2026
16 checks passed
@skjnldsv
skjnldsv deleted the feat/enable-sidebar-option branch September 9, 2026 09:49
@skjnldsv skjnldsv mentioned this pull request Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted status: review Waiting for reviews type: enhancement 🚀 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants