Skip to content

feat(avatar): support guestFallback and version query params - #916

Merged
Antreesy merged 1 commit into
mainfrom
fix/noid/generate-avatar-url-compat
Sep 16, 2026
Merged

Antreesy merged 1 commit into
mainfrom
fix/noid/generate-avatar-url-compat

Conversation

@Antreesy

@Antreesy Antreesy commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Provide a full match the backend's getAvatar() method:

NcAvatar has almost identical implementation, so would make sense to use this one a single source of truth. vue-library version can be shortened to this (keeping dark-theme check as a missing gap):

export function getAvatarUrl(user: string, options?: AvatarUrlOptions): string {
      return generateAvatarUrl(user, {
              isDarkTheme: options?.isDarkTheme ?? checkIfDarkTheme(document.body),
              isGuestUser: options?.isGuest,
              size: options?.size,
              guestFallback: true,
              // version: options?.version,
      })
}

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.11%. Comparing base (6b5036c) to head (4369ba9).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #916      +/-   ##
==========================================
+ Coverage   93.58%   94.11%   +0.52%     
==========================================
  Files           2        2              
  Lines          78       85       +7     
  Branches       35       38       +3     
==========================================
+ Hits           73       80       +7     
  Misses          2        2              
  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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- provide a full match the backend's getAvatar() method:
  - `guestFallback` param (checked stable32 and newer)
  - `v` param (added in nextcloud/server#64295, not backported atm)
- copy and adjust test coverage from nextcloud/vue version for missing gap

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy
Antreesy force-pushed the fix/noid/generate-avatar-url-compat branch from 9153d0c to 4369ba9 Compare September 16, 2026 11:37
@Antreesy

Copy link
Copy Markdown
Contributor Author

Rebased, only added test coverage (copied from nextcloud/vue)

@Antreesy
Antreesy marked this pull request as ready for review September 16, 2026 11:38
@Antreesy
Antreesy merged commit 584a2e9 into main Sep 16, 2026
16 checks passed
@Antreesy
Antreesy deleted the fix/noid/generate-avatar-url-compat branch September 16, 2026 12:28
@Antreesy Antreesy mentioned this pull request Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants