Skip to content

[Epic] Hyperlinks 2.0 & Click Actions — ScreenTip, sound, macro, hover, jump-to-slide #21

@MHoroszowski

Description

@MHoroszowski

Problem

Hyperlinks work, but only the basic happy path. Tooltip / ScreenTip is unsupported despite the attribute being present on <a:hlinkClick tooltip=> (scanny/python-pptx#1022, #425). Click-actions for "run program" / "run macro" / "play sound" / "hover-vs-click" cannot be authored (#734 sound action 11c, #976 run function on click). Run-level internal hyperlinks that jump to a specific slide in slideshow mode (#1077) are missing. Hyperlink text-color override is broken (#940, 11c; #821, 5c). Hyperlinks on images and chart elements have no API (#576, #962).

Sub-features

  • Hyperlink.tooltip getter+setter — emits <a:hlinkClick tooltip=>
  • Hyperlink.color setter — emits <a:rPr> color override on hyperlink runs
  • Click-action: Shape.click_action.target_program(path), .run_macro(name), .play_sound(audio_part)
  • Hover-action via <a:hlinkHover> parallel to click-action
  • Slideshow-mode jump-to-slide on text runs (closes #1077)
  • Picture/Image hyperlinks — Picture.hyperlink property
  • Chart element hyperlinks (data point, axis title) — <a:hlinkClick> inside chart text run
  • Unify Run.hyperlink and Shape.click_action interfaces (closes scanny/python-pptx#455)

Prior art

  • Open PRs: none directly addressing this surface in upstream queue.
  • User issues this would close: #236, #367, #425, #455, #576, #734, #821, #940, #962, #976, #1022, #1077.
  • OOXML: DrawingML §22.1.4.1 <a:hlinkClick action= tooltip= invalidUrl= history=>, §22.1.4.2 <a:hlinkHover>. Action values: ppaction://hlinkfile, ppaction://program, ppaction://macro?name=, ppaction://hlinksldjump, ppaction://hlinkshowjump?jump=nextslide|previousslide|firstslide|lastslide|endshow, ppaction://hlinkpres?slideindex=N. Sound: <a:snd r:embed=>.
  • Code paths: src/pptx/text/text.py (Hyperlink), src/pptx/action.py (ActionSettings), src/pptx/shapes/base.py, src/pptx/oxml/text.py.

Acceptance criteria

  • A run authored with run.hyperlink.tooltip = "Click for details" shows that text on hover in PowerPoint.
  • A shape with shape.click_action.run_macro("MyMacro") triggers the macro on click.
  • Picture.hyperlink.address = "https://..." works without manipulating XML.
  • 18+ unit tests + 6 behave scenarios.

Effort: M

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:hyperlinksFeature area: hyperlinksepicMulti-feature roadmap epicprior-art:noneNo known prior art — greenfieldpriority:P1Important but not urgent

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions