Skip to content

✨ Add possibility to link to open faq question#1184

Merged
mariush2 merged 2 commits into
mainfrom
feat/faq-direct-link
Nov 27, 2025
Merged

✨ Add possibility to link to open faq question#1184
mariush2 merged 2 commits into
mainfrom
feat/faq-direct-link

Conversation

@mariush2

@mariush2 mariush2 commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

Azure DevOps links

User story


  • Needs to be tested locally by reviewer

Description

Add possibility for an faq question to start open if the first hash contains its id

@mariush2 mariush2 requested a review from a team as a code owner November 24, 2025 12:42
Copilot AI review requested due to automatic review settings November 24, 2025 12:42

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 pull request adds functionality to open FAQ questions via URL hash, enabling deep linking to specific FAQ items. When a user navigates to a URL like /faq#faq-1, the corresponding FAQ question will be displayed in an expanded state on page load.

Key Changes

  • Enhanced FAQ question component to detect and respond to URL hash fragments on initial render
  • Added test coverage for the initially-open-question scenario
  • Updated existing test assertions to use async/await pattern for consistency

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/organisms/Faq/Category/Question/Question.tsx Implemented hash-based initial expansion logic using useLocation().hash to check if the URL hash matches the FAQ item's ID, with proper animation state handling for initially-open questions
src/organisms/Faq/Faq.stories.tsx Added new test story InitiallyOpenQuestion to verify hash-based opening works correctly, and updated existing test expectations to use async/await pattern

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

@github-actions

github-actions Bot commented Nov 24, 2025

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔴 Lines 99.62% (🎯 100%) 16243 / 16304
🔴 Statements 99.62% (🎯 100%) 16243 / 16304
🔴 Functions 99.65% (🎯 100%) 1166 / 1170
🔴 Branches 99.67% (🎯 100%) 4007 / 4020
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/organisms/Faq/Category/Question/Question.tsx 100% 100% 100% 100%
Generated in workflow #1959 for commit caaf25e by the Vitest Coverage Report Action

@aslakihle aslakihle 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.

😎

@mariush2 mariush2 merged commit 20374bf into main Nov 27, 2025
9 of 11 checks passed
@mariush2 mariush2 deleted the feat/faq-direct-link branch November 27, 2025 06:30
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.

3 participants