Skip to content

Conversation

@jivey
Copy link
Member

@jivey jivey commented Jan 12, 2022

No description provided.

@jivey jivey self-assigned this Jun 27, 2022
@jivey jivey requested a review from TomWoodward August 1, 2022 19:56
@jivey jivey marked this pull request as ready for review August 1, 2022 19:56

let contentPath: number[] | undefined;

if (serializationData.type === xPathDiscriminator) {
Copy link
Member

Choose a reason for hiding this comment

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

can we not limit this to just one serialization strategy? you have access to the dom nodes here you should be able to get everything you need

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm testing out some changes to this to use text position. I'm not sure if there's a case where the strategies could get mixed, but my guess is no, and that it's safe to say comparisons would always be the same type for a given reference id. Since xpath is the default it's hard for me to understand how text position gets used in real content (though how it is represented is very simple.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay I checked today and it looks like Tutor is using Xpath not TextSelector, so I'm not sure of a "real" test. But I think this approach here will work, since the highlighted text parent should always be the reference element, so just return 0 and the offset: 6cf0fd3#diff-db95139714bd7e6e07fffb3e5099c11f8fcb08d2263985401647db6d2c6e8f15R10

package.json Outdated
"tslint": "^5.11.0",
"tslint-loader": "^3.6.0",
"typescript": "^3.1.1",
"typescript": "3.5",
Copy link
Member

Choose a reason for hiding this comment

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

updating typescript is fine, but was there a reason to do it as part of this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was running into these errors when building: Argument of type 'string' is not assignable to parameter of type 'NewHighlightColorEnum' and Cannot find name 'GlobalFetch'. Possibly something messed up with my setup if it was building fine before though 🤔

@jivey
Copy link
Member Author

jivey commented Aug 18, 2022

Some of the build errors will go away once the client types are updated to production, but there are some others I'm not sure of the cause from, I'll look into those.

@TomWoodward
Copy link
Member

@jivey is this ready for review? a bunch of tests are failing

@jivey jivey changed the title WIP send content path send content path Aug 22, 2022
@jivey
Copy link
Member Author

jivey commented Aug 22, 2022

@TomWoodward yes meant to ping you after changing it to use a simple path for text strategy. The tests are failing because of the highlights-client, maybe we can pair on that soon because I can't figure out why it isn't building... I ran this locally without publish and linked it to highligher: https://github.com/openstax/ox-bin/blob/main/lib/build-swagger-client and it fixed the GlobalFetch error, but I still get Argument of type 'string' is not assignable to parameter of type 'NewHighlightColorEnum' (including on main) which makes me confused how this ever worked before.

@jivey jivey removed their assignment Jul 31, 2023
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.

3 participants