feat: add navigation actions for office - #130
Conversation
7602e7d to
50dece7
Compare
|
TL;DR: Solid feature — real routing, good test discipline, no security issues, translations work correctly. One real accessibility bug slipped through because the existing tests assert on props passed to stubbed components rather than rendered output. Proposed fixes below. Findings and proposed fixes1. Sidebar doesn't dedupe creators sharing a category (medium)
$seen = [];
foreach ($this->categoryService->listCreators() as $creator) {
$id = $this->categoryService->categoryId($creator);
if (isset($seen[$id])) {
continue;
}
$seen[$id] = true;
...
}
Proposed fix — mirror the backend's dedupe on the frontend: // One nav entry per category — two suites can register a creator for the
// same category, and only the first is addressable at its URL.
const navigationCreators = computed(() => {
const seen = new Set<string>()
return creators.value.filter(creator => {
const id = categoryId(creator)
if (seen.has(id)) return false
seen.add(id)
return true
})
})and use 2. That exact scenario is untested (medium)The new it('renders one nav entry per category, even when two creators share one', async () => {
const other = makeCreator({ app: 'otheroffice', extension: '.odt', label: 'OtherOffice Doc' })
getTemplatesMock.mockResolvedValue([documents, other])
const wrapper = await mountWithBothCategories('/documents') // or equivalent setup
const items = wrapper.findAllComponents({ name: 'NcAppNavigationItem' })
expect(items).toHaveLength(1)
})(Adjust to however the suite's existing fixtures/mocks are wired — the point is asserting on count/rendered state, not just the props passed in.) 3.
|
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
50dece7 to
91077b3
Compare
|
@moodyjmz implemented all your review comments incl. the performance issue (number 4). |
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
91077b3 to
bf350d0
Compare
Bildschirmaufnahme_20260824_175411.webm
TODO
In richdocuments the creators need to get proper
order, usesetOrderproperly.🤖 AI (if applicable)