Skip to content
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

Chrome: Adding the Permalink popup #1042

Merged
merged 6 commits into from
Jun 7, 2017
Merged

Conversation

youknowriad
Copy link
Contributor

refs #577

  • This PRs adds a read-only permalink popup (for now).
  • I'm also adding a generic ClipboardButton based on the clipboard package

@youknowriad youknowriad added the General Interface Parts of the UI which don't fall neatly under other labels. label Jun 6, 2017
@youknowriad youknowriad added this to the Beta milestone Jun 6, 2017
@youknowriad youknowriad self-assigned this Jun 6, 2017
@youknowriad
Copy link
Contributor Author

Editing permalinks is not always authorised, a permalink format containing the "slug" is required to allow editing the slug.

AFAIK It's not possible to fetch the permalink format using the Rest API right now. Thoughts on this @nylen

@jasmussen
Copy link
Contributor

NICE! Thanks for working on this.

Let's make a few visual improvements. I can help with this, and it can be in a separate PR.

For example, let's pretend the title field is a block. So it gets the same 2px gray block boundary as a selected block is.

That lets us also position the permalink popup in the exact same coordinates as the block toolbars are. That is, indended from the left edge of the selected border the block padding distance, and 2px pushed down from the top border so it's "sitting on the border":

screen shot 2017-06-06 at 14 28 54

Can we change the text of the copy button to say "Copied!" when you click?

Can we make the permalink clickable, in addition to being editable?

@youknowriad
Copy link
Contributor Author

@jasmussen Thanks for the review, I've tried to address the feedback as I could.

@jasmussen
Copy link
Contributor

Love this! Really impressive work. Teensy nitpick — can we add the same fade animation to the title border as the normal blocks have? Otherwise, visually SOLID. Thank! 👍

@mtias mtias removed this from the Beta milestone Jun 7, 2017
@ellatrix
Copy link
Member

ellatrix commented Jun 7, 2017

When I focus the title, then focus a block, and then again the title, some UI lingers.

screenshot 2017-06-07 13 54 02

return (
<Button
ref={ ref => this.button = ref }
className={ classes }
Copy link
Member

Choose a reason for hiding this comment

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

It's a bit confusing that that there's no click handler here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, that's how the clipboard library works.

document.activeElement === textarea &&
textarea.selectionStart !== textarea.selectionEnd
) {
this.select();
Copy link
Member

Choose a reason for hiding this comment

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

Might it be better to name this onSelect?

}

handleClickOutside() {
this.setState( { isSelected: false } );
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't blur work here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't because of the popup

Copy link
Member

@ellatrix ellatrix left a comment

Choose a reason for hiding this comment

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

Works nicely.

@youknowriad youknowriad merged commit 311582e into master Jun 7, 2017
@youknowriad youknowriad deleted the add/readonly-permalink branch June 7, 2017 14:49
@aduth
Copy link
Member

aduth commented Jun 12, 2017

Created core ticket ( + patch ) for REST API permalink_structure setting:

https://core.trac.wordpress.org/ticket/41014

@aduth aduth mentioned this pull request Jun 12, 2017
@jasmussen
Copy link
Contributor

Did this regress? I don't see it in master anymore...

@jasmussen jasmussen mentioned this pull request Jun 20, 2017
@youknowriad
Copy link
Contributor Author

@jasmussen Did you save your post?

@jasmussen
Copy link
Contributor

Ah of course, that's it.

}

onSelectionChange() {
const textarea = this.textareaContainer.textarea;
Copy link
Member

Choose a reason for hiding this comment

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

What is this doing? Can we add an inline comment?

Copy link
Member

Choose a reason for hiding this comment

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

See #5422

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants