Skip to content

feat(home+auth): external-link rel safety + organizationSetup error alert#4237

Merged
PierreBrisorgueil merged 1 commit into
masterfrom
feat/promote-content-org-ux
Jun 3, 2026
Merged

feat(home+auth): external-link rel safety + organizationSetup error alert#4237
PierreBrisorgueil merged 1 commit into
masterfrom
feat/promote-content-org-ux

Conversation

@PierreBrisorgueil
Copy link
Copy Markdown
Collaborator

Summary

Promotes two generic UX improvements from trawl_vue downstream back to the devkit. Part of the drift cleanup audit (infra#38, Tasks T8 + T9).

  • T8 — External-link safety (home.content.component.vue): adds buttonTarget and buttonRel computed props that auto-apply target="_blank" + rel="noopener noreferrer" whenever setup.button.link is an external URL. An explicit setup.button.target override is respected. Bindings added to the <v-btn> element.

  • T9 — Org-setup error alert (organizationSetup.component.vue): replaces the silent console.error on createOrganization failure with a dismissible v-alert type="error" variant="tonal" that surfaces err.response.data.message, err.message, or a generic fallback. Adds error: null to data() and clears it at the start of each submit.

Unit tests added for both (6 new for T8, 5 new for T9 — all green).

Closes

Test plan

  • npm run lint — no issues
  • npm run test:unit — 29 tests pass in the two modified test files (pre-existing unrelated failures in app.router / legal.router tests not introduced by this PR)

…om trawl

T8: add buttonTarget/buttonRel computed props to home.content.component.vue
— auto-applies target=_blank + rel=noopener noreferrer for external links
T9: add user-visible error alert to organizationSetup.component.vue
— replaces console.error with v-alert on createOrganization failure

Closes #4236. Partially closes pierreb-projects/infra#38 (T8+T9).
Copilot AI review requested due to automatic review settings June 3, 2026 12:24
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Warning

Review limit reached

@PierreBrisorgueil, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 57 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 744c7d79-5f3a-4b6d-abca-c5c6e3ef09c7

📥 Commits

Reviewing files that changed from the base of the PR and between 7be1220 and a4e958b.

📒 Files selected for processing (4)
  • src/modules/auth/components/organizationSetup.component.vue
  • src/modules/auth/tests/auth.organizationSetup.component.unit.tests.js
  • src/modules/home/components/utils/home.content.component.vue
  • src/modules/home/tests/home.content.component.unit.tests.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/promote-content-org-ux

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.56%. Comparing base (0560aab) to head (a4e958b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4237   +/-   ##
=======================================
  Coverage   99.56%   99.56%           
=======================================
  Files          31       31           
  Lines        1162     1162           
  Branches      329      329           
=======================================
  Hits         1157     1157           
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil PierreBrisorgueil merged commit 8e0be0f into master Jun 3, 2026
8 checks passed
@PierreBrisorgueil PierreBrisorgueil deleted the feat/promote-content-org-ux branch June 3, 2026 12:27
Copy link
Copy Markdown

Copilot AI left a comment

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 promotes two UX improvements into the devkit: safer handling of external links rendered by the home content utility component, and a user-visible error alert when organization creation fails during auth onboarding (drift cleanup tasks T8 + T9).

Changes:

  • Add buttonTarget / buttonRel computed props to automatically apply target="_blank" + rel="noopener noreferrer" for external http(s) button links in HomeContentComponent.
  • Replace the silent console.error behavior on organization creation failure with a dismissible <v-alert type="error"> surfaced in the org setup UI.
  • Add/extend unit tests covering the new computed props and org-setup error state.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/modules/home/components/utils/home.content.component.vue Adds computed target/rel and binds them to the button for external-link safety.
src/modules/home/tests/home.content.component.unit.tests.js Adds unit tests for the new buttonTarget / buttonRel behavior.
src/modules/auth/components/organizationSetup.component.vue Adds an error state + error alert for failed org creation and clears error on submit.
src/modules/auth/tests/auth.organizationSetup.component.unit.tests.js Adds tests for the new error state behavior on failures and retries.

Comment on lines +186 to +191
buttonTarget() {
const explicit = this.setup.button?.target;
if (explicit) return explicit;
const link = this.setup.button?.link || '';
return /^https?:\/\//i.test(link) ? '_blank' : null;
},
Comment on lines +192 to +194
buttonRel() {
return this.buttonTarget === '_blank' ? 'noopener noreferrer' : null;
},
Comment on lines 150 to +153
if (!form.valid) return;

this.loading = true;
this.error = null;
Comment on lines +178 to +184
it('buttonTarget returns _blank for an external https link', () => {
const wrapper = mount(HomeContentComponent, {
props: { setup: { ...baseSetup, button: { title: 'Go', link: 'https://example.com' } } },
global: globalOpts(vuetify),
});
expect(wrapper.vm.buttonTarget).toBe('_blank');
});
Comment on lines +135 to +146
it('sets error from response data message on createOrganization failure', async () => {
const apiError = { response: { data: { message: 'Name already taken' } } };
createOrganizationMock.mockRejectedValueOnce(apiError);

const wrapper = mountComponent();
await flushPromises();

wrapper.vm.organizationName = 'Duplicate Org';
await wrapper.vm.submit();

expect(wrapper.vm.error).toBe('Name already taken');
});
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.

feat(home+auth): promote external-link safety + org-setup error UX from trawl downstream

2 participants