Skip to content

Add feature to limit show context.#178

Merged
sebschmi merged 4 commits into
mainfrom
159-allow-show-svgs-to-focus-on-necessary-characters-only
May 8, 2026
Merged

Add feature to limit show context.#178
sebschmi merged 4 commits into
mainfrom
159-allow-show-svgs-to-focus-on-necessary-characters-only

Conversation

@sebschmi
Copy link
Copy Markdown
Collaborator

@sebschmi sebschmi commented May 8, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 8, 2026 07:41
@sebschmi sebschmi linked an issue May 8, 2026 that may be closed by this pull request
@sebschmi sebschmi self-assigned this May 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an option to restrict how much sequence context is rendered around template switches when generating the SVG output, plumbing a new CLI flag through to the SVG renderer and introducing arrangement-trimming utilities to remove columns outside the desired context window.

Changes:

  • Add --restrict-context-to <N> to tsalign show and pass it into lib_tsshow::svg::SvgConfig.
  • Extend SVG generation to optionally crop both TS and no-TS arrangements to a shared context range.
  • Add arrangement utilities for context limiting and range-based column removal, plus supporting helpers (source lengths, saturating subtraction).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsalign/src/show.rs Adds CLI flag and forwards it into SvgConfig.
lib_tsshow/src/ts_arrangement/source.rs Stores original reference/query lengths and exposes accessors used as fallbacks for cropping.
lib_tsshow/src/ts_arrangement/index_types.rs Adds saturating_sub for index newtypes.
lib_tsshow/src/ts_arrangement.rs Introduces context-limiting and column-range removal utilities, plus “interesting column” detection.
lib_tsshow/src/svg.rs Applies context restriction to TS arrangement and mirrors the same crop window onto the no-TS arrangement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib_tsshow/src/ts_arrangement.rs Outdated
Comment thread lib_tsshow/src/ts_arrangement.rs
Comment thread lib_tsshow/src/ts_arrangement.rs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread lib_tsshow/src/ts_arrangement.rs
Comment thread lib_tsshow/src/ts_arrangement.rs
Comment thread lib_tsshow/src/ts_arrangement.rs Outdated
Comment thread lib_tsshow/src/ts_arrangement/source.rs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread lib_tsshow/src/ts_arrangement.rs
Comment thread lib_tsshow/src/ts_arrangement/source.rs
@sebschmi sebschmi merged commit 2415e46 into main May 8, 2026
32 checks passed
@sebschmi sebschmi deleted the 159-allow-show-svgs-to-focus-on-necessary-characters-only branch May 8, 2026 08:42
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.

Allow show svgs to focus on necessary characters only

2 participants