Skip to content

refactor: drop exact from envelope and envelopeskeleton - #13625

Open
GretaD wants to merge 1 commit into
mainfrom
refactor/drop-exact
Open

refactor: drop exact from envelope and envelopeskeleton#13625
GretaD wants to merge 1 commit into
mainfrom
refactor/drop-exact

Conversation

@GretaD

@GretaD GretaD commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

ref: #13622

Vue Router 4 matches routes exactly by default, making the exact
prop a no-op. Dropped the binding in Envelope.vue and the prop
declaration + template binding in EnvelopeSkeleton.vue.

🤖 AI (if applicable)

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

Summary by CodeRabbit

  • Bug Fixes
    • Updated envelope list navigation so items remain active when viewing related nested routes.
    • Removed exact route matching from envelope skeleton links.

Signed-off-by: greta <gretadoci@gmail.com>
@GretaD
GretaD requested a review from GVodyanov September 2, 2026 14:29
@GretaD GretaD self-assigned this Sep 2, 2026
@ChristophWurst

Copy link
Copy Markdown
Member

And that is compatible with the current router too?

@ChristophWurst

Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The envelope components no longer use exact route matching. Envelope.vue stops passing the option, and EnvelopeSkeleton.vue stops binding it to router-link.

Changes

Envelope route matching

Layer / File(s) Summary
Remove exact route matching
src/components/Envelope.vue, src/components/EnvelopeSkeleton.vue
The envelope link now receives only its destination route. The exact route-matching binding was removed from both component usage and the router-link wrapper.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: 🔵 Low · up to b05da

Removing exact route matching may cause the wrong envelope to appear selected when a message route includes a draft identifier. This is a bounded UI correctness risk; the PR is otherwise mergeable with explicit owner awareness or follow-up.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the exact behavior from Envelope and EnvelopeSkeleton.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/drop-exact

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: faf7dcc4-503b-4348-8c23-1a02e832a215

📥 Commits

Reviewing files that changed from the base of the PR and between a83e908 and b05da80.

📒 Files selected for processing (2)
  • src/components/Envelope.vue
  • src/components/EnvelopeSkeleton.vue
💤 Files with no reviewable changes (1)
  • src/components/Envelope.vue

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

:custom="to ? true : null"
:to="to"
:exact="to ? exact : null">
:to="to">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 2 '"vue-router"' --glob 'package*.json' --glob '*lock*' .
rg -n -C 4 'message|children:|EnvelopeSkeleton|:exact|isExactActive' src

Repository: nextcloud/mail

Length of output: 50371


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- EnvelopeSkeleton.vue ---'
cat -n src/components/EnvelopeSkeleton.vue

printf '%s\n' '--- Vue Router dependency declarations ---'
rg -n -C 3 '"vue-router"' package.json package-lock.json yarn.lock pnpm-lock.yaml 2>/dev/null || true

printf '%s\n' '--- EnvelopeSkeleton usages and route definitions ---'
rg -n -C 5 'EnvelopeSkeleton|name:\s*['"'"'"'"'"']message|children\s*:|isExactActive|:exact' src --glob '*.vue' --glob '*.js' --glob '*.ts' --glob '*.json' | head -n 400

Repository: nextcloud/mail

Length of output: 32299


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Change for EnvelopeSkeleton.vue ---'
git diff --unified=12 -- src/components/EnvelopeSkeleton.vue

printf '%s\n' '--- Envelope link target and active-state inputs ---'
sed -n '1,40p' src/components/Envelope.vue
sed -n '770,810p' src/components/Envelope.vue
rg -n -C 6 '<EnvelopeSkeleton|<Envelope\b|active=|:active=' src/components src/views --glob '*.vue' | head -n 300

printf '%s\n' '--- Router configuration ---'
cat -n src/router.js | sed -n '1,70p'

Repository: nextcloud/mail

Length of output: 8332


🌐 Web query:

Vue Router 3.6.5 exact router-link isActive isIncludedRoute source query hash optional params

💡 Result:

In Vue Router 3.6.5, the router-link component determines active state based on route records and parameters, intentionally excluding query strings and hashes from the matching logic [1][2]. 1. isActive (router-link-active): This class is applied when the current route matches the route record and includes the same parameter values [1]. Because the matching is inclusive, it remains active for nested routes [3][1]. 2. isExactActive (router-link-exact-active): This class is applied only when the current route is an exact match for the link's target, meaning it must match the same route record and parameters, and it must not be an ancestor route [1]. 3. Optional Params: Optional parameters are handled within the path matching logic. For a link to be active, provided parameters must match the current route's parameters [4][5]. If a parameter is optional and not present, it does not prevent an active match provided the path segment otherwise aligns [6]. 4. Query/Hash: These are ignored during the active/exact active state calculation [1][2]. The router does not use them to determine if a link is "active," as the determination is strictly based on the route record and path parameters [1]. If you require active status to account for query parameters, you must implement custom logic using the v-slot API (which exposes isActive, route, etc.) to manually compare the current route's query object with your target query object [3][7].

Citations:


Preserve exact active-state matching for draft routes.

Removing :exact allows the message link to remain active when the current message route includes its optional draftId. Because EnvelopeSkeleton styles the row from isActive, the wrong envelope can appear selected. Keep :exact and add a regression test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants