Skip to content

feat: Add sticky Markdown copy button to Portfolio AI Analysis - #362

Closed
Sujallukhi04 wants to merge 1 commit into
Fincept-Corporation:mainfrom
Sujallukhi04:feat/portfolio-copy-button
Closed

feat: Add sticky Markdown copy button to Portfolio AI Analysis#362
Sujallukhi04 wants to merge 1 commit into
Fincept-Corporation:mainfrom
Sujallukhi04:feat/portfolio-copy-button

Conversation

@Sujallukhi04

Copy link
Copy Markdown
Contributor

Scope gate (required)

  • This PR closes an issue that carries the good-first-issue, help-wanted, or scope:approved label.
  • I confirmed the scope with a maintainer on the issue before writing code.
  • This PR is from a topic branch (not main on my fork).
  • This PR makes one logical change. It does not bundle unrelated fixes.
  • I did not run Black / autopep8 / isort / clang-format / Prettier on files I did not otherwise modify.
  • Diff is minimal — no reformatting of surrounding lines that are unrelated to the change.

What does this PR do?

Adds a sticky, custom-rendered floating copy button to the top-right corner of the Portfolio -> AI Analysis output. The button remains fixed at the top-right when scrolling, shifts to prevent overlapping with the vertical scrollbar, copies the raw Markdown (.md) text format (preserving headers, bold tags, lists, and tables), and shows a green success checkmark on click.

Type of change

  • Bug fix
  • New feature / screen
  • Performance improvement
  • Refactoring (with linked issue)
  • Documentation
  • Build / config change

Changes made

  • fincept-qt/src/screens/portfolio/PortfolioInsightsPanel.h: Added eventFilter() override and ai_copy_btn_ pointer.
  • fincept-qt/src/screens/portfolio/PortfolioInsightsPanel.cpp:
    • Implemented custom overlapping-sheet copy icons and checkmark icons using QPainter.
    • Instantiated ai_copy_btn_ overlay parented to ai_content_ (to keep it sticky).
    • Used eventFilter on the viewport resize event to dynamically align the button to the left of the scrollbar (leaving a 12px gap).
    • Wired clipboard copy handling to pull raw Markdown from ai_cache_ (with plain text fallback) and update icons on success.
    • Hidden button when output is empty or contains an error.

How to test

  1. Open the Portfolio screen and click AI Analysis on the right panel.
  2. Select any analysis type and click RUN.
  3. Verify that the floating copy button (clipboard icon) appears in the top-right of the box once the analysis loads.
  4. Scroll through the analysis and verify that the button remains fixed at the top-right and does not overlap with the scrollbar.
  5. Hover over the button to see it highlight to amber, and click it to copy the raw Markdown formatted text to your clipboard.
  6. Verify that it flashes a green checkmark for 1500ms on success.

Architecture / code-quality checklist

  • Builds without errors on my target platform (Windows)
  • UI thread is never blocked (no waitForFinished() on main thread) — see CLAUDE.md P1
  • Timers start/stop in showEvent() / hideEvent() — see P3
  • No sensitive data committed
  • Tested manually on: Windows

Screenshots / logs

Copied State:

image

@github-actions

Copy link
Copy Markdown
Contributor

Hi @Sujallukhi04 — thanks for the PR!

Our automated scope gate flagged the following:

No scope-approved linked issue. This PR must close an issue that carries one of: good-first-issue, help-wanted, scope:approved. Link it in the PR body with Closes #NNN or via GitHub's "Linked issues" sidebar.

Please read CONTRIBUTING.md. Once an issue with the appropriate label exists and is linked here, re-run this check by pushing an empty commit or editing the PR description. A maintainer can also bypass this gate by adding the scope:approved label to this PR.

PRs that remain unresolved for 7 days will be closed automatically.

@github-actions github-actions Bot added the needs-scope-approval Auto-applied by pr-gate.yml to PRs that fail the scope gate. label Jul 25, 2026
@github-actions github-actions Bot added the Stale label Aug 2, 2026
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Closing this PR because it has had the needs-scope-approval label for 7+ days without a maintainer-approved issue being linked.

This is not personal — see CONTRIBUTING.md for the scope-approval flow. You are welcome to open a new PR once an issue carrying good-first-issue, help-wanted, or scope:approved exists and the change is agreed with a maintainer.

@github-actions github-actions Bot added the invalid Closed as not meeting contribution policy. Applied automatically by stale-close workflow. label Aug 2, 2026
@github-actions github-actions Bot closed this Aug 2, 2026
@alljudaleon-hash

alljudaleon-hash commented Aug 5, 2026 via email

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Closed as not meeting contribution policy. Applied automatically by stale-close workflow. needs-scope-approval Auto-applied by pr-gate.yml to PRs that fail the scope gate. Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants