Skip to content

fix(viewer): show the modal when it carries only an error - #23

Merged
skjnldsv merged 1 commit into
mainfrom
fix/error-without-file
Sep 10, 2026
Merged

fix(viewer): show the modal when it carries only an error#23
skjnldsv merged 1 commit into
mainfrom
fix/error-without-file

Conversation

@skjnldsv

Copy link
Copy Markdown
Contributor

The modal renders when there is an error and no file, which is what an open that never got as far as a file leaves behind: openFolder() on something that is not a folder, a listing that fails, an unknown handler id, open([]). Its show prop only followed currentFile though, and NcModal hides its content with v-show, so every one of those cases ended as a click that appeared to do nothing.

lib/views/Viewer.vue:9   v-if="!!currentFile || !!errorString"
lib/views/Viewer.vue:23  :show="!!currentFile"

The NcModalStub the viewer tests mount honoured show no more than the viewer did, which is why all of those paths looked reported. It mirrors the v-show now and errorText() only returns a visible error, so the ten existing error tests fail without the one-line fix. The test that asserted show === false for an unknown handler id now asserts that no handler was rendered instead.

Not verified in a browser, only in jsdom.

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

@skjnldsv skjnldsv added status: review Waiting for reviews type: bug 🐛 Something isn't working AI assisted labels Sep 10, 2026
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.91%. Comparing base (d2d8ebf) to head (e1e0232).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #23   +/-   ##
=======================================
  Coverage   84.91%   84.91%           
=======================================
  Files          36       36           
  Lines        2460     2460           
  Branches      501      502    +1     
=======================================
  Hits         2089     2089           
  Misses        368      368           
  Partials        3        3           

☔ 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.

The modal renders on an error with no file, which is what an open that
never got as far as a file leaves behind: `openFolder` on something that
is not a folder, a listing that fails, an unknown handler id. Its `show`
prop only followed the file though, and NcModal hides its content with
`v-show`, so all of those ended as a click that appeared to do nothing.

The stub the viewer tests mount honoured `show` no more than the viewer
did, which is why every one of those cases looked reported. It mirrors
the `v-show` now, and an error inside a hidden modal no longer counts.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv force-pushed the fix/error-without-file branch from 48b1104 to e1e0232 Compare September 10, 2026 17:05
@skjnldsv
skjnldsv merged commit 9e27a1c into main Sep 10, 2026
18 checks passed
@skjnldsv
skjnldsv deleted the fix/error-without-file branch September 10, 2026 18:26
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: bug 🐛 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant