Skip to content

refactor(objects): share Files helpers and the relation row of ObjectDetails - #7541

Merged
rubenvdlinde merged 4 commits into
mainfrom
cloud/k35-object-details
Nov 9, 2026
Merged

rubenvdlinde merged 4 commits into
mainfrom
cloud/k35-object-details

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What changed

  • src/composables/nextcloudFiles.js: openFolder, openFile, formatFileSize — the Nextcloud Files links and size formatting ObjectDetails carried (and UploadFiles carried openFolder of), byte-identical bodies. Each component lists them in methods from a namespace import (import * as nextcloudFiles), so the templates call them unchanged. The namespace import matters in UploadFiles: in an SFC that also has <script setup>, a named import with the method's name becomes a setup binding and shadows the method in the dev/test template build (checked with compileScript: openFolder stays an options binding).
  • src/views/object/ObjectRelationItem.vue: the NcListItem row (cube icon, title, relation label) the Uses and Used by tabs both inlined. Root element is the same NcListItem with the same props, so the DOM is unchanged.

Tests first: ObjectDetails.relations.dom.golden.spec.js records the Uses / Used by markup (rows with titles and labels, and the empty state) on the old markup, committed before the change; it passes unchanged after it.

What ran

  • npx jest src/views/object src/modals/file: all passed, snapshots unchanged.
  • eslint on changed files: 0 errors. npm run build: succeeds.
  • No live browser check in a cloud lane. A person should look at: object detail, Uses / Used by tabs (rows, labels, Used by paging), Files tab (open folder, open file, sizes), and the upload-files modal's "go to the folder" link for files ≥ 512MB.

Numbers (lane_measure.py, K35 vue_red)

This PR alone on development: 319 → 286. With #7493 and #7498 and the upload PR merged together: see lane report.

AI-assisted: written by Claude Code (claude-opus-5-5) in cloud lane K35.


Generated by Claude Code

openFolder, openFile and formatFileSize move from ObjectDetails and
UploadFiles into src/composables/nextcloudFiles.js, listed in each
component's methods so the templates call them unchanged.

Assisted-by: ClaudeCode:claude-opus-5-5
A named import that matches a method name becomes a setup binding in an
SFC that also has <script setup>, shadowing the method in the dev/test
template build; the namespace import keeps openFolder an options binding.

Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
The two tabs carried the same NcListItem with cube icon and relation
label; ObjectRelationItem renders it once. The relations DOM golden
passes unchanged.

Assisted-by: ClaudeCode:claude-opus-5-5

Copy link
Copy Markdown
Contributor Author

Newman API Test Suite failing: not this PR's.

The same check (and quality / Integration Tests (Newman)) is red on development's head a1fd993f8. The failing job is the PHP unit stage: FileVersioningHandlerGoldenTest fails with "Cannot declare interface OCA\Files_Versions\Versions\IVersionManager", and the FileTextExtractionJob/ObjectTextExtractionJob goldens fail on log arrays. This PR only changes Vue/JS under src/ (ObjectDetails, UploadFiles, a new row component, a composable and a jest golden), so it can't reach those tests. I'm not porting a fix because there isn't one on development yet. Per the lane rules this PR gets no more commits; it should go green once development is fixed and merged in.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Frontend Check (test:l10n:parity) failing: not this PR's. This note also covers the base-red checks that have not finished yet.

Parity fails on the key "We could not count the objects. Close this window and try again.", which is missing from the locale catalogues. The check is equally red on development's head a1fd993f8. This PR adds and changes no translatable strings, and that string is not in its diff.

These checks are still running here and are already red on that base: test:l10n, format, eslint, phpcs, phpstan, psalm, phpmd, PHPUnit, Integration Tests (Newman) and the 7 base Hydra gates. If they fail here, it is that base failure; this PR changes no PHP, and none of its files show up in the frontend findings on #7498. I won't add a comment per check. Lane rules forbid more commits to this open PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Frontend Check (format): two findings here are this PR's (correcting my previous comment). The fix is on a separate branch.

The format job is red on development too, but two of the files it flags were added by this PR: src/composables/nextcloudFiles.js and src/views/object/ObjectDetails.relations.dom.golden.spec.js. Both need prettier line-wrapping, and there are no logic changes.

The fix is d3ae37c17 on cloud/k35-object-details-format (this PR's head plus prettier on those two files). After it, prettier --check passes on every file this PR touches, eslint reports no errors, and npx jest src/views/object src/modals/file passes with snapshots unchanged. Lane rules forbid pushing to an open PR, so the coordinator decides how it lands: cherry-pick, or a follow-up PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Hydra Gates: one failure is this PR's (gate-122); the fix is on the format-fix branch.

Hydra reports 8 failed gates here. Seven also fail on development's head a1fd993f8. The eighth comes from this PR: [gate-122] sig-maintainability. Running the same ratchet locally (check_sig_maintainability.py ratchet --base-ref origin/development) names the finding: src/views/object/ObjectRelationItem.vue:4-14 is an 8-line clone of the existing src/components/shared/CountListItem.vue:4-15.

The fix is e4fbd5cb4 on cloud/k35-object-details-format, after the prettier commit d3ae37c17. It deletes ObjectRelationItem.vue; the Uses and Used by rows now use CountListItem with :forceDisplayActions="true" (it falls through to the NcListItem root) and the cube icon in its #icon slot. ObjectDetails.relations.dom.golden.spec.js passes unchanged, which shows the rendered rows are identical. The local ratchet on that branch reports 0 findings, and prettier and eslint are clean. The lane is still within its target with all K35 fix branches merged: vue_red 170 against a target of 171, where it was 163 before this switch. Lane rules forbid pushing to an open PR, so the coordinator decides how it lands.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit 3d99ca7 into main Nov 9, 2026
37 of 50 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 2d7a29e

Check PHP Vue Security License Tests
lint ✅
phpcs ❌
phpmd ❌
psalm ❌
phpstan ❌
phpmetrics ✅
eslint ❌
stylelint ✅
build ✅
check-specs ✅
test-l10n ❌
test-l10n-parity ❌
format ❌
check-schema-l10n ✅
test-coverage-ratchet ✅
composer ✅ ✅ 168/168
npm ✅ ✅ 641/641
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌ 49035/49045 · 19 skipped
Newman ❌ 1625/1628
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-09 15:19 UTC

Download the full PDF report from the workflow artifacts.

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.

2 participants