Skip to content

feat: click TOC entries to jump to section#184

Merged
RivoLink merged 1 commit into
RivoLink:mainfrom
giovannipapini:feat/toc-mouse-navigation
Jun 26, 2026
Merged

feat: click TOC entries to jump to section#184
RivoLink merged 1 commit into
RivoLink:mainfrom
giovannipapini:feat/toc-mouse-navigation

Conversation

@giovannipapini

@giovannipapini giovannipapini commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stores the rendered TOC panel rect in app.toc_area (same pattern as content_area)
  • Builds a toc_display_to_toc_index map inside refresh_toc_cache so each visible display row maps back to its toc entry
  • Adds scroll_to_toc_display_line(display_idx) on App
  • In the mouse handler, a left-click inside the TOC list area (below the header) calls that method to jump to the section

Test plan

  • Open a Markdown file with multiple headings and press t to show the TOC
  • Click a level-1 heading entry — document jumps to that section
  • Click a level-2 sub-entry — document jumps to that sub-section
  • Click the "TABLE OF CONTENTS" header row — nothing happens
  • Clicking the right-border column of the TOC panel — nothing happens
  • Numkey (19) navigation still works unchanged

Closes #183

@RivoLink

Copy link
Copy Markdown
Owner

Hi @giovannipapini
Thanks for your interest in the project and for your PR, I really appreciate it.

A couple of requests:

  • Squash into a single commit as feat: toc mouse navigation and please remove Claude as co-author.
  • Signed commit: GPG signing is required on main. If you can sign it, great. If not, no worries, I'll handle it and preserve you as author.

GPG signing docs : https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

@giovannipapini giovannipapini force-pushed the feat/toc-mouse-navigation branch 2 times, most recently from c8766c8 to e7a71e5 Compare June 26, 2026 07:30
@giovannipapini

Copy link
Copy Markdown
Contributor Author

Hi @RivoLink, thanks for the review! All done:

  • Squashed into a single commit titled feat: toc mouse navigation
  • Removed Claude as co-author (and dropped the Claude line from the PR description)
  • Signed the commit — it now shows as Verified on GitHub

Ready for another look whenever you have a moment.

@giovannipapini giovannipapini force-pushed the feat/toc-mouse-navigation branch from 3060fa8 to b520614 Compare June 26, 2026 08:27
@RivoLink

Copy link
Copy Markdown
Owner

Hi,
It’s perfect, thank you so much 😊

@RivoLink

Copy link
Copy Markdown
Owner

No worries about the cargo audit.
It’s not related to your update, I’ll fix it.

@RivoLink

Copy link
Copy Markdown
Owner

I’m on it. I may need you to rebase after my fix.
Sorry, it’s my bad.

@RivoLink

Copy link
Copy Markdown
Owner

Hi @giovannipapini
Can you rebase the branch from main to fix the Cargo audit issue in CI?

@giovannipapini giovannipapini force-pushed the feat/toc-mouse-navigation branch from b520614 to 41d6b01 Compare June 26, 2026 09:45
@RivoLink

Copy link
Copy Markdown
Owner

Perfect, thank you so much 😊

@RivoLink RivoLink merged commit 2439820 into RivoLink:main Jun 26, 2026
1 check passed

@RivoLink RivoLink left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 😊

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.

feat: click TOC entries to jump to section

2 participants