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

Fix autocomplete url #1204

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Fix autocomplete url #1204

wants to merge 5 commits into from

Conversation

manila
Copy link
Collaborator

@manila manila commented Apr 19, 2022


What's this PR do?

Add auto complete domain when adding a new server, similar UX to the mobile apps when adding a new server.

Fixes #1012

Any background context you want to provide?

This is my first implementation and I anticipate that this could be farther improved. My main goal was to keep this logic in the scope of the new-server-form. I suspect this could be better implemented in a separate module

Screenshots
zulip-autocomplete-domain

You have tested this PR on:

  • Windows
  • Linux/Ubuntu
  • macOS

@@ -56,6 +56,7 @@ export function initNewServerForm({$root, onChange}: NewServerFormProps): void {
"input.setting-input-value",
)!;

<<<<<<< HEAD
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Can you remove this merge conflict marker?

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I think perhaps you remove this in the second commit; in general it's worth reviewing each individual commit with a took like gitk --all for readability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Where has gitk been all my life!? Very useful tool, thanks for suggesting

This should be removed now

class="setting-input-add-server"
autofocus
placeholder="your-organization.zulipchat.com"
style="width: 34ch"
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Can you do all the styles in CSS files? It's generally harder to read code split between places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That makes sense, I went ahead and made this change in my most recent commit

My original thought was that by having this specific rule inline it would be contextual and less of a magic number. 34ch is the initial width of the input field which is the width of the placeholder text

Maybe I should add a comment in the stylesheet? or perhaps it's obvious

@manila manila force-pushed the Fix-AutocompleteUrl branch 2 times, most recently from dca3703 to 0535542 Compare May 6, 2022 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add organization: url: attempt to autocomplete with zulipchat.com
4 participants