Skip to content

Commit 1c6fdb2

Browse files
unhappychoiceclaude
andcommitted
chore: Update Twitter references to X platform
- Update SharingPlatform enum from Twitter to X - Update sharing URLs from twitter.com to x.com - Update info dialog platform references and keybindings - Update CHANGELOG.md to reflect platform rebrand - Maintain backward compatibility in functionality Closes: #121 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a47c2a6 commit 1c6fdb2

File tree

6 files changed

+19
-22
lines changed

6 files changed

+19
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
176176
- feat: add Go language support ([1baa6fc](https://github.com/unhappychoice/gittype/commit/1baa6fc))
177177
- feat: add Ruby language support ([aa293da](https://github.com/unhappychoice/gittype/commit/aa293da))
178178
- feat: improve typing screen UI/UX ([f89e6e8](https://github.com/unhappychoice/gittype/commit/f89e6e8))
179-
- feat: add info dialog with GitHub and Twitter links ([9d3a407](https://github.com/unhappychoice/gittype/commit/9d3a407))
179+
- feat: add info dialog with GitHub and X links ([9d3a407](https://github.com/unhappychoice/gittype/commit/9d3a407))
180180
- feat: enhance exit summary screen with session-based sharing ([86fced3](https://github.com/unhappychoice/gittype/commit/86fced3))
181181
- feat: add comprehensive SNS sharing functionality ([5f110b1](https://github.com/unhappychoice/gittype/commit/5f110b1))
182182
- feat: improve progress reporting for parallel AST parsing ([614b0ac](https://github.com/unhappychoice/gittype/commit/614b0ac))

src/game/screens/exit_summary_screen.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,7 @@ impl ExitSummaryScreen {
365365
if let Event::Key(key_event) = event::read()? {
366366
match key_event.code {
367367
KeyCode::Char('1') => {
368-
let _ = Self::share_session_result(
369-
session_summary,
370-
SharingPlatform::Twitter,
371-
);
368+
let _ = Self::share_session_result(session_summary, SharingPlatform::X);
372369
break;
373370
}
374371
KeyCode::Char('2') => {
@@ -426,9 +423,9 @@ impl ExitSummaryScreen {
426423
session_summary: &SessionSummary,
427424
) -> String {
428425
match platform {
429-
SharingPlatform::Twitter => {
426+
SharingPlatform::X => {
430427
format!(
431-
"https://twitter.com/intent/tweet?text={}",
428+
"https://x.com/intent/tweet?text={}",
432429
urlencoding::encode(text)
433430
)
434431
}

src/game/screens/info_dialog.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::io::{stdout, Write};
1010

1111
pub enum InfoAction {
1212
OpenGithub,
13-
OpenTwitter,
13+
OpenX,
1414
Close,
1515
}
1616

@@ -21,7 +21,7 @@ impl InfoDialog {
2121
let mut selected_option = 0;
2222
let options = [
2323
("GitHub Repository", InfoAction::OpenGithub),
24-
("Twitter #gittype", InfoAction::OpenTwitter),
24+
("X #gittype", InfoAction::OpenX),
2525
("Close", InfoAction::Close),
2626
];
2727

@@ -48,7 +48,7 @@ impl InfoDialog {
4848
KeyCode::Char(' ') => {
4949
return Ok(match selected_option {
5050
0 => InfoAction::OpenGithub,
51-
1 => InfoAction::OpenTwitter,
51+
1 => InfoAction::OpenX,
5252
_ => InfoAction::Close,
5353
});
5454
}
@@ -80,7 +80,7 @@ impl InfoDialog {
8080
}
8181
KeyCode::Esc | KeyCode::Char('q') => return Ok(InfoAction::Close),
8282
KeyCode::Char('g') => return Ok(InfoAction::OpenGithub),
83-
KeyCode::Char('t') => return Ok(InfoAction::OpenTwitter),
83+
KeyCode::Char('x') => return Ok(InfoAction::OpenX),
8484
_ => {}
8585
}
8686
}
@@ -193,10 +193,10 @@ impl InfoDialog {
193193
Ok(())
194194
}
195195

196-
pub fn open_twitter() -> Result<()> {
197-
let url = "https://twitter.com/search?q=%23gittype";
196+
pub fn open_x() -> Result<()> {
197+
let url = "https://x.com/search?q=%23gittype";
198198
if open::that(url).is_err() {
199-
Self::show_url_fallback("Twitter Search", url)?;
199+
Self::show_url_fallback("X Search", url)?;
200200
}
201201
Ok(())
202202
}

src/game/screens/result_screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ impl ResultScreen {
759759
if let Event::Key(key_event) = event::read()? {
760760
match key_event.code {
761761
KeyCode::Char('1') => {
762-
let _ = SharingService::share_result(metrics, SharingPlatform::Twitter);
762+
let _ = SharingService::share_result(metrics, SharingPlatform::X);
763763
break;
764764
}
765765
KeyCode::Char('2') => {

src/game/screens/title_screen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ impl TitleScreen {
296296
InfoAction::OpenGithub => {
297297
InfoDialog::open_github()?;
298298
}
299-
InfoAction::OpenTwitter => {
300-
InfoDialog::open_twitter()?;
299+
InfoAction::OpenX => {
300+
InfoDialog::open_x()?;
301301
}
302302
InfoAction::Close => {
303303
// Do nothing, just close the dialog

src/sharing.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crossterm::event::KeyCode;
44

55
#[derive(Debug, Clone)]
66
pub enum SharingPlatform {
7-
Twitter,
7+
X,
88
Reddit,
99
LinkedIn,
1010
Facebook,
@@ -13,15 +13,15 @@ pub enum SharingPlatform {
1313
impl SharingPlatform {
1414
pub fn name(&self) -> &'static str {
1515
match self {
16-
Self::Twitter => "Twitter",
16+
Self::X => "X",
1717
Self::Reddit => "Reddit",
1818
Self::LinkedIn => "LinkedIn",
1919
Self::Facebook => "Facebook",
2020
}
2121
}
2222

2323
pub fn all() -> Vec<Self> {
24-
vec![Self::Twitter, Self::Reddit, Self::LinkedIn, Self::Facebook]
24+
vec![Self::X, Self::Reddit, Self::LinkedIn, Self::Facebook]
2525
}
2626
}
2727

@@ -47,9 +47,9 @@ impl SharingService {
4747
let text = Self::create_share_text(metrics);
4848

4949
match platform {
50-
SharingPlatform::Twitter => {
50+
SharingPlatform::X => {
5151
format!(
52-
"https://twitter.com/intent/tweet?text={}",
52+
"https://x.com/intent/tweet?text={}",
5353
urlencoding::encode(&text)
5454
)
5555
}

0 commit comments

Comments
 (0)