Skip to content

feat(links): hide broken links section for read-only users and i18n b…#1140

Merged
perber merged 3 commits into
mainfrom
feat/hide-broken-links-readonly
Jun 8, 2026
Merged

feat(links): hide broken links section for read-only users and i18n b…#1140
perber merged 3 commits into
mainfrom
feat/hide-broken-links-readonly

Conversation

@perber

@perber perber commented Jun 8, 2026

Copy link
Copy Markdown
Owner

…acklink strings

Broken link info is only actionable for editors; viewers see no benefit from it. Guard the section with useIsReadOnly() and move all hardcoded backlink strings into the viewer locale.

…acklink strings

Broken link info is only actionable for editors; viewers see no benefit
from it. Guard the section with useIsReadOnly() and move all hardcoded
backlink strings into the viewer locale.
Copilot AI review requested due to automatic review settings June 8, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the UI link metadata pane to (1) hide the “Broken links” section for read-only users and (2) internationalize backlink-related UI strings by moving them into the viewer locale namespace.

Changes:

  • Add viewer.backlinks.* strings to the English viewer locale and wire them into the backlinks UI.
  • Guard the “Broken links” subsection behind useIsReadOnly() so it only appears for users who can act on it.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ui/leafwiki-ui/src/locales/en/viewer.json Adds markdownPreview and backlinks translation keys under the viewer namespace.
ui/leafwiki-ui/src/features/links/LinkInfo.tsx Uses viewer i18n keys for backlink UI strings and hides the broken-links group for read-only users.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui/leafwiki-ui/src/features/links/LinkInfo.tsx Outdated
perber added 2 commits June 8, 2026 22:08
…p on error

Moves the error message outside the read-only guard so read-only users
see the error instead of a misleading empty backlinks state. Also hides
the broken links group entirely when an error occurred.
@perber
perber merged commit 1862bb1 into main Jun 8, 2026
9 checks passed
@perber
perber deleted the feat/hide-broken-links-readonly branch June 8, 2026 20:20
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