Skip to content

Function header#321

Merged
bleakley merged 7 commits intomasterfrom
function-header
Nov 14, 2025
Merged

Function header#321
bleakley merged 7 commits intomasterfrom
function-header

Conversation

@bleakley
Copy link
Copy Markdown
Contributor

@bleakley bleakley commented Nov 13, 2025

This will fix the issue on Hyperparam.app where the prompt controls overlap the standard column controls. The idea is that the user of hightable can specify a custom function header component and can choose where to place the controls element (which contains sort and column options) within the header, or even choose to exclude it completely. See the Functional Header Component story for an example.

@bleakley bleakley requested review from platypii and severo November 13, 2025 18:49
@bleakley bleakley marked this pull request as ready for review November 13, 2025 18:49
Copy link
Copy Markdown
Contributor

@severo severo left a comment

Choose a reason for hiding this comment

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

I'm not against allowing more control on how to render the headers, but the PR adds complexity... If we're in a hurry to add features, maybe we can merge, and come back later to it to make it a bit simpler (at least: one way of doing things, in either of the three cases)


const headerContent = useMemo(() => {
const { headerComponent } = columnConfig
if (typeof headerComponent === 'function') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

detail: you can declare isFunctionalHeader above, and use it here

Comment thread src/HighTable.module.css

// If the hightable user provides a custom header component, they can choose where to place these controls inside it
const controls = useMemo(() =>
<div className={styles['ht-header-controls']}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this mean that we now have two modes? one where the sort indicator is done with pure CSS? and another one, if columnConfig.headerComponent is a function, where it's done with a span with text content (and thus the content cannot be changed with CSS)?

@bleakley
Copy link
Copy Markdown
Contributor Author

I talked to Kenny in person this morning, he said he thinks we should just merge this. Although it is a little complicated to be honest I can't really think of a better way to do it.

@bleakley bleakley merged commit 9c6930d into master Nov 14, 2025
5 checks passed
@bleakley bleakley deleted the function-header branch November 14, 2025 17:34
@bleakley bleakley mentioned this pull request Nov 18, 2025
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