Add a simple way to open Cards by number#2665
Open
janrenz wants to merge 2 commits intobasecamp:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates global search so users can jump directly to a Card page by entering a card “ticket number” query, reusing the existing auto-submit redirect behavior when a card is found.
Changes:
- Add a
find_cardhelper inSearchesControllerto resolve certain queries directly to a Card. - Extend controller tests to cover redirect behavior for card id / number queries and “no matches” behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/controllers/searches_controller.rb | Introduces find_card helper to resolve queries to a card (via id/number) before running full search. |
| test/controllers/searches_controller_test.rb | Adds assertions around auto-submit redirect behavior for card id/number queries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hello reviewers, my team and I at Koble Systems would very much like this to get reviewed and merged. We use Fizzy in our daily standup and if this gets added we'd use it nearly every day. |
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up on the discussion in #2190 i added a possibility to easy open a ticket by entering the number.
Summary
#123) are interpreted as card numbers.card.idlookups so that searching by ticket number jumps straight to the card page.#prefix.Details
The
SearchesControllerpreviously only tried to treat the query (q) as acard.idvia:Current.user.accessible_cards.find_by_id(@query)This meant that users could not quickly jump to a card by the visible ticket number they see in the UI.
This change introduces a small
find_cardhelper inSearchesController:qmatches\A#?\d+\z, we treat it as a card number (with an optional#prefix) and look it up viaCurrent.user.accessible_cards.find_by(number: number).id.If a card is found, the search page behaves as before and auto-submits a form that redirects to the card show page.
Testing
mise exec -- bin/rails test test/controllers/searches_controller_test.rbThe controller test now verifies:
q: "#{@card.number}"redirects to the card.Prototype.number.search.mov