Skip to content

fix: safe router navigation encoding and /users/search test coverage#133

Merged
grillinr merged 2 commits intoadd-commentsfrom
copilot/sub-pr-128-again
Mar 6, 2026
Merged

fix: safe router navigation encoding and /users/search test coverage#133
grillinr merged 2 commits intoadd-commentsfrom
copilot/sub-pr-128-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 5, 2026

Two router.push calls in the messages tab interpolated usernames directly into path strings, breaking navigation for usernames containing reserved URL characters. The /users/search endpoint also lacked any test coverage.

Changes

  • frontend/app/(tabs)/message.tsx — Replace string-interpolated router.push with the object form in both handleSelectSuggestion and handleStartChat:

    // Before
    router.push(`/conversation/${username}`);
    
    // After
    router.push({ pathname: "/conversation/[username]", params: { username } });

    Consistent with the existing pattern in _layout.tsx and MessageThreadItem.tsx.

  • backend/api/internal/tests/main_test.go — Register GET /users/search on the test router so the endpoint is reachable in tests.

  • backend/api/internal/tests/user_test.go — Add three test cases for /users/search:

    • Empty q[]
    • Prefix match (q=dev) → returns dev_user1
    • count exceeding 20 is capped (q=d&count=100) → returns both matching users

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: elifouts <116454864+elifouts@users.noreply.github.com>
Copilot AI changed the title [WIP] Add messages tab for direct messages feature fix: safe router navigation encoding and /users/search test coverage Mar 5, 2026
@grillinr grillinr marked this pull request as ready for review March 6, 2026 00:21
@grillinr grillinr merged commit e294a80 into add-comments Mar 6, 2026
@grillinr grillinr deleted the copilot/sub-pr-128-again branch March 6, 2026 00:22
@grillinr
Copy link
Collaborator

grillinr commented Mar 6, 2026

Closes #129

grillinr added a commit that referenced this pull request Mar 7, 2026
* wip: add messaging

* feat: add messages tab

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: derive WebSocket URL from API_BASE_URL in conversation screen (#130)

* Initial plan

* fix: use API_BASE_URL for WebSocket URL in conversation screen

Co-authored-by: grillinr <169214325+grillinr@users.noreply.github.com>

* fix: merge reconnection logic from base branch while keeping API_BASE_URL approach

Co-authored-by: elifouts <116454864+elifouts@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: grillinr <169214325+grillinr@users.noreply.github.com>
Co-authored-by: elifouts <116454864+elifouts@users.noreply.github.com>
Co-authored-by: Eli Fouts <eligfouts@gmail.com>

* feat: enhance MessageBubble and MessageComposer components

- Added authorLabel prop to MessageBubble for displaying message authors.
- Improved styling in MessageBubble for better visual consistency.
- Updated MessageComposer to include layout animations for dynamic height adjustments.
- Refactored input handling in MessageComposer to optimize performance.
- Removed unused terminal animation code from MyHeader component.
- Added terminal icon mapping in IconSymbol for better icon management.

* fix: safe router navigation encoding and /users/search test coverage (#133)

* fix: exclude sentinel user from search results and correct stale test expectations (#136)

* Initial plan

* fix: exclude deleted_user sentinel from search results and update test expectations

Co-authored-by: grillinr <169214325+grillinr@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: grillinr <169214325+grillinr@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Nathan Grilliot <grillinr.mail.uc.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: grillinr <169214325+grillinr@users.noreply.github.com>
Co-authored-by: elifouts <116454864+elifouts@users.noreply.github.com>
Co-authored-by: Eli Fouts <eligfouts@gmail.com>
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