Skip to content

Topic cards: a click on the title opens the topic in the app - #431

Merged
TripleU613 merged 1 commit into
mainfrom
cards-open-in-app
Nov 23, 2026
Merged

TripleU613 merged 1 commit into
mainfrom
cards-open-in-app

Conversation

@TripleU613

Copy link
Copy Markdown
Owner

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 the a.raw-topic-link itself (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's topic-list-item-click transformer now catches a click inside the link and opens the topic with core's navigateToTopic. 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)

  • JTech theme

Test plan

  • New jtech_theme_part1_spec.rb example: 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.
  • Verified on dev with this branch's theme: in-app navigation, 198 ms.
  • eslint (import sort), prettier, ember-tsc, rubocop, stree: clean.

Checklist

  • pnpm lint is clean
  • bundle exec rubocop is clean
  • New / changed settings have entries in config/locales/server.en.yml or client.en.yml (none)
  • New / changed behavior has a spec (a bug fix has one that fails without it)
  • Follows the repository rules: no access past core, visibility checked, nothing core already does
  • No Ruby file references a non-existent setting name

🤖 Generated with Claude Code

https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T02:36:37.727494Z 9cc9857 PR opened
🔒 Security Review ✅ Completed 2026-11-23T02:37:27.157750Z 9cc9857 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TripleU613
TripleU613 merged commit 4101083 into main Nov 23, 2026
10 checks passed
@TripleU613
TripleU613 deleted the cards-open-in-app branch November 23, 2026 02:35
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.

1 participant