Repository navigation
feat(xlsx): links of cells, in a card under the selected cell - #62
Merged
Merged
Conversation
… in a text, in a card under the selected cell - the file's <hyperlink>s are read (to a web address, to a place in the workbook): they follow the rows / columns inserted and deleted and the sheets renamed, as the sheet is saved - a formula calling HYPERLINK with a text links where it says - web and mail addresses written in a text (https://…, www.…, name@host) are underlined, in the color of links (`--de-sheet-link`), unless the cell has a color of its own - the selected cell's links show in a card under it: each opens (a page in a new tab, a place in the workbook), is copied, and a link of the text or of a formula is edited with the cell; Escape puts the card away - no icon of the site: it would be fetched from the site's server, which would learn the sheet was looked at Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A workbook's links were not read at all: a cell with a
<hyperlink>showed its text and led nowhere. Cells now have links, and the selected cell's links show in a card under it, as in Google Sheets.Where a cell's link comes from (
src/core/xlsx/links.ts)The first that applies:
<hyperlink>: to an address outside the file (its relationship, alocationadded as a fragment), or to a place in the workbook ('Sheet 2'!B3, a defined name). The links are kept as read, and where each is now is worked out with the sameshiftsandrenamesthatfollowSheetTailapplies when the sheet is saved. Inserted / deleted rows and columns, undo and renamed sheets give the same cell in the view as in the saved file.HYPERLINKwith a text:=HYPERLINK("https://…", "name"), or"#Sheet2!A1"for a place.findLinksinsrc/core/url.ts):https://,ftp://,www.,mailto:andname@host.tld. A stop, a comma or a closing bracket the address did not open is not part of it.xlsx.cellreturns them asCellDetail.links. The bulk Replace leaves them out: it reads only the value.In the view (
src/react/xlsx/XlsxView.tsx)--de-sheet-link(#1155cc, a new paper token). A cell with its own text color keeps it. The file's links look as their cell style says, as in Excel.noopener noreferrer), or a place in the workbook (selected and scrolled to, on its sheet);safeHref, with a scheme required).javascript:and another file's relative path are shown as text, and can still be copied.Not in this PR
Inserting, editing or removing a file's link (Ctrl+K, unlink) means writing
<hyperlinks>and the sheet's relationships, with undo and collaboration ops. That is left for a follow-up.Tests
test/xlsx-links.test.ts(11):findLinkscases and non-links; file links on a cell and on a range, with tooltip and fragment; links following inserted / deleted rows and undo; a renamed sheet and a defined name as the place; a relative or missing relationship;HYPERLINK; addresses typed in; the saved<hyperlink ref>matching the view.e2e/xlsx-links.spec.ts(4):'Other Sheet'!C5;theme.tslists the new token.🤖 Generated with Claude Code