Skip to content

feat: #30 Allow for variable-width columns and more than two columns #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

andrew-polk
Copy link
Contributor

@andrew-polk andrew-polk commented Dec 20, 2022

This change is Reviewable

BREAKING CHANGE: Makes changes to the expected css for formatting columns. So clients must make those changes to their respective css files to get the desired results.

<div className='notion-spacer' />`;
}

// This is a hack.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is a hack

// So we use 'notion-client' which uses the unofficial API.
// Once the official API gives us access to the format information, we can remove this
// and the 'notion-client' dependency.
async function getStyleInJsxFormat(blockId: string): Promise<string> {
Copy link
Member

Choose a reason for hiding this comment

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

This is fine, but consider if it would be cleaner to just have this as getColumnWidthPixels() and then have

style=`width=${widthInPixels}px`

"\n\n"
)}\n\n</div>`;
)}\n\n</div>
<div className='notion-spacer' />`;
Copy link
Member

Choose a reason for hiding this comment

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

Could use a comment

Copy link
Contributor Author

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @hatton)


src/transformers/ColumnTransformer.ts line 32 at r1 (raw file):

Previously, hatton (John Hatton) wrote…

Could use a comment

Done.


src/transformers/ColumnTransformer.ts line 35 at r1 (raw file):

Previously, hatton (John Hatton) wrote…

I don't think this is a hack

Done.


src/transformers/ColumnTransformer.ts line 40 at r1 (raw file):

Previously, hatton (John Hatton) wrote…

This is fine, but consider if it would be cleaner to just have this as getColumnWidthPixels() and then have

style=`width=${widthInPixels}px`

We want it as a percentage so it flexes with the size of the window like Notion does.
But I took your point about returning the width rather than the whole style.

@andrew-polk
Copy link
Contributor Author

Converting to draft because running this on bloom-docs revealed issues.

@andrew-polk andrew-polk marked this pull request as draft December 20, 2022 17:25
@andrew-polk andrew-polk changed the title feat: Allow for variable-width columns feat: #30 Allow for variable-width columns and more than two columns Dec 20, 2022
Copy link
Member

@hatton hatton left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @andrew-polk)


src/transformers/ColumnTransformer.ts line 40 at r1 (raw file):

Previously, andrew-polk wrote…

We want it as a percentage so it flexes with the size of the window like Notion does.
But I took your point about returning the width rather than the whole style.

Oh, sorry, and before it was a just a number, but now it is a CSS expression, so the simplification benefit mostly went away :-) Ah well.

@andrew-polk
Copy link
Contributor Author

Converting to draft because running this on bloom-docs revealed issues.

Ok, the problem is that the css changes have to be copied to the client apps.... which makes this somewhat of a breaking change.
I need to figure out the best way to document that.
And I'll have to fix paratext-manual, too, I guess.

@andrew-polk andrew-polk marked this pull request as ready for review December 20, 2022 17:37
BREAKING CHANGE: Makes changes to the expected css for formatting columns. So clients must make those changes to their respective css files to get the desired results.
@andrew-polk andrew-polk merged commit 4fc81c7 into main Dec 20, 2022
@andrew-polk andrew-polk deleted the VariableColumnWidth branch December 20, 2022 17:52
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.

2 participants