Repository navigation
Topic cards: a click on the title opens the topic in the app - #431
Merged
Merged
Conversation
The card's title link is core's TopicLink, which now wraps the words in a span. Core opens a topic in the app only when the click lands on the raw-topic-link itself, and its click interceptor leaves raw links to the row's handler; so a click on the words (nearly every click) did a full page load: the whole app booted again for every topic opened, about 550 ms instead of about 230 ms on dev. The row transformer now opens it with core's navigateToTopic when the click is inside the link; modifier keys and middle-click still open a new tab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
Opening a topic from the JTech theme's topic cards reloaded the whole page: the app booted again for every topic opened. That's the main reason the forum felt jerky next to other Discourse sites.
The card's title link is core's
TopicLink, and current core wraps the title in a<span dir="auto">. Core opens the topic in-app only when the click lands on thea.raw-topic-linkitself (event.target.classList.contains("raw-topic-link")in topic-list/item.gjs), and its click interceptor skips raw links on purpose. So a click on the words, which is almost every click, fell through to a full page load. The theme'stopic-list-item-clicktransformer now catches a click inside the link and opens the topic with core'snavigateToTopic. Modifier keys and middle-click still open a new tab.Measured on dev (same core as prod), headless Chrome: opening a topic took 549 ms with a full reload; now 198 ms in-app. With themes off it's 156 ms.
Affected module(s)
Test plan
jtech_theme_part1_spec.rbexample: clicking the card title's words opens the topic without a page reload (a window marker survives the click). The plugin test container's older core has no span, so the bug can't happen there and the example passes trivially. CI runs current core, which has the span.Checklist
pnpm lintis cleanbundle exec rubocopis cleanconfig/locales/server.en.ymlorclient.en.yml(none)🤖 Generated with Claude Code
https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs