Skip to content

feat: add short code alias for peer connection#12

Open
naremloa wants to merge 2 commits into
jermainee:masterfrom
naremloa:feat/short-code
Open

feat: add short code alias for peer connection#12
naremloa wants to merge 2 commits into
jermainee:masterfrom
naremloa:feat/short-code

Conversation

@naremloa

@naremloa naremloa commented Jun 9, 2026

Copy link
Copy Markdown

Fixes #11

Adds a 6-character short code as an alternative to sharing the full peer ID during setup. The code only lives during the setup phase. Once the real connection is established, both sides switch to the primary peer ID and the short-code peer is torn down.

Expected behaviour:

  • Host sees their code immediately; it stays visible until a peer connects or
    they leave.
  • Joiner enters the code → resolved to real peer ID → reload → normal connection completes.
  • After connect: chat runs on the real peer ID; the alias is destroyed and
    effectively single-use.
  • Existing <domain>/#<full-peer-id> flow unchanged

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a temporary 6-character alias “peer” to make initial connection setup easier (especially for manual entry), while preserving the existing /#<full-peer-id> linking flow once the real connection is established.

Changes:

  • Added alias generation helper with an unambiguous character set.
  • Updated Chat to (a) display a host code during setup and (b) resolve 6-char hashes as aliases before reconnecting via the real peer id.
  • Added connection timeout/error handling and alias-peer teardown hooks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/Service/ChatHelper.ts Adds generateAlias() to produce short, human-friendly setup codes.
src/Chat.tsx Implements alias registration, alias-based join flow, UI for code display/input, and updated connect timeout/error behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Chat.tsx Outdated
Comment thread src/Chat.tsx Outdated
Comment thread src/Chat.tsx
Comment thread src/Chat.tsx
@naremloa naremloa removed their assignment Jun 10, 2026
@naremloa

Copy link
Copy Markdown
Author

Addressed the Copilot review feedback in 5760f2f.

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.

Need optional short code for connecting

2 participants