# Feature COMMS-293 - Highlight the relevant target element when the user gets to a page via a deep link 

Project: Stream Communicator
Status: closed
URL: https://community.openproject.org/work_packages/COMMS-293

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 16.5.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Use cases

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

| ID | Type | Subject | Status | Assignee | Target versions | Spent time | Module |
| --- | --- | --- | --- | --- | --- | --- | --- |
| COMMS-397 | Bug | Highlighted comment's position is off on mobile | rejected |  | 16.5.1 |  | Modules and project features / Comments and activity |
| COMMS-398 | Bug | Highlighted comment's link is not working when opened from the same work package where that comment belongs | rejected |  | 16.6.0 |  | Modules and project features / Comments and activity |
| COMMS-479 | Bug | Posted comment doesn't scroll into view | rejected |  | 17.0.0 |  | Modules and project features / Comments and activity |
| COMMS-464 | Bug | Mobile web: When deep linking to a comment the comment is not fully scrolled into view | closed |  | 17.7.0 |  | Modules and project features / Comments and activity |
| COMMS-476 | Bug | When deep linking after a large image comment, the highlighted comment is out of view | confirmed |  | Product Backlog |  | Modules and project features / Comments and activity |
| COMMS-399 | Bug | Highlighted comments: Bottom border is sligthly narrower than the rest of the borders | confirmed |  | Product Backlog |  | Modules and project features / Comments and activity |

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Frontend components and Primer design system |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups | https://www.figma.com/design/w0YoqQ5v0JGNT5NS5NZJZq/Comments-with-restricted-visibility?node-id=563-5329 |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Developers | OP Dev Comms Team |
| Designer | Parimal Satyal |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** a user who follows a deep link on a page (with an anchor)  
**I want to** get to the page in the right scroll position and the item highlighted in some way  
**so that** I know which element I should be looking at

**Acceptance criteria**

  - When the user follows a link with an anchor (eg. to a specific comment in the Activity tab or a meeting agenda item)
    
      - Auto-scroll such that the deep-linked element is around the top of the page
        
          - Leave a 100px gap at the top so that it doesn't sit flush with the top and doesn't end up being hidden behind the header
    
      - Highlight that element with a blue outside border (like in GitHub)
        
          - Colour:  `--borderColor-accent-emphasis`
        
          - Width: 2px
    
      - Same colours for restricted comments (the colours will be the same across the application).

  - The browser url (with anchor) is replaced with the canonical URL after the next user interaction (eg. click anywhere on the page).
    
      - The blue outline is also removed.

**Technical notes**

  - Would we use the [**:target CSS pseudo-class**](https://developer.mozilla.org/en-US/docs/Web/CSS/:target)?

  - How does GitHub do the replacing of an anchored deep-link with the canonical? Can we take inspiration from that?

**Mockups**

Please see [Figma file](https://www.figma.com/design/w0YoqQ5v0JGNT5NS5NZJZq/Comments-with-restricted-visibility?node-id=563-5329) for the most up-to-date mockups. The following is just a reference:

<img class="image_resized op-uc-image op-uc-image_inline" style="width:529px;" src="/api/v3/attachments/404829/content">

GitHub uses a blue border (eg. [Deep-linked comment on a PR](https://github.com/opf/openproject-website/pull/3475#pullrequestreview-2318494347))**:**

<img class="image_resized op-uc-image op-uc-image_inline" style="width:506px;" src="/api/v3/attachments/400730/content">

**Permissions and visibility considerations**

  - *Nothing specific*

**Translation considerations**

  - *None*

**Out of scope**

  - [Animation](https://primer.style/brand/getting-started/animation) is not in this scope, although Primer seems to afford some (but in Primer)
